Skip to content

Commit a4bd586

Browse files
authored
Merge pull request #456 from geoffw0/query-tags
CPP: Query tags 1
2 parents 4e2d40a + b4846dc commit a4bd586

File tree

8 files changed

+22
-5
lines changed

8 files changed

+22
-5
lines changed

cpp/ql/src/Best Practices/Magic Constants/MagicNumbersUseConstant.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* @kind problem
55
* @id cpp/use-number-constant
66
* @problem.severity recommendation
7+
* @precision low
8+
* @tags maintainability
79
*/
810
import cpp
911
import MagicConstants

cpp/ql/src/Best Practices/Magic Constants/MagicStringsUseConstant.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* @kind problem
55
* @id cpp/use-string-constant
66
* @problem.severity recommendation
7+
* @precision low
8+
* @tags maintainability
79
*/
810
import cpp
911
import MagicConstants

cpp/ql/src/Best Practices/NVI.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
* to enforce invariants that should hold for the whole hierarchy.
55
* @kind problem
66
* @id cpp/nvi
7-
* @problem.severity warning
7+
* @problem.severity recommendation
8+
* @precision low
9+
* @tags maintainability
810
*/
911
import cpp
1012

cpp/ql/src/Best Practices/NVIHub.ql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
* to enforce invariants that should hold for the whole hierarchy.
55
* This is especially problematic in classes with many
66
* dependencies or dependents.
7-
* @kind table
7+
* @kind problem
88
* @id cpp/nvi-hub
9+
* @problem.severity recommendation
10+
* @precision low
11+
* @tags maintainability
912
*/
1013
import cpp
1114

@@ -19,4 +22,4 @@ where f.hasSpecifier("public") and
1922
fclass = f.getDeclaringType() and
2023
hubIndex = fclass.getMetrics().getAfferentCoupling() * fclass.getMetrics().getEfferentCoupling() and
2124
hubIndex > 100
22-
select f.getFile(), f, "Avoid having public virtual methods (NVI idiom)"
25+
select f, "Avoid having public virtual methods (NVI idiom)"

cpp/ql/src/Best Practices/Unused Entities/UnusedIncludes.ql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
* the included elements are used.
55
* @kind problem
66
* @id cpp/unused-includes
7-
* @problem.severity warning
7+
* @problem.severity recommendation
8+
* @precision low
9+
* @tags maintainability
10+
* useless-code
811
*/
912

1013
import cpp

cpp/ql/src/Likely Bugs/Memory Management/Padding/More64BitWaste.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* @kind problem
55
* @id cpp/more-64-bit-waste
66
* @problem.severity warning
7+
* @tags maintainability
8+
* portability
79
*/
810

911
import semmle.code.cpp.padding.Padding

cpp/ql/src/Likely Bugs/Memory Management/Padding/NonPortablePrintf.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* @kind problem
66
* @id cpp/non-portable-printf
77
* @problem.severity warning
8+
* @tags maintainability
9+
* portability
810
*/
911

1012
import cpp

cpp/ql/src/Likely Bugs/Memory Management/Padding/Suboptimal64BitType.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
* that by reordering them one could reduce the amount of internal padding on a 64-bit architecture.
55
* @kind problem
66
* @id cpp/suboptimal-64-bit-type
7-
* @problem.severity warning
7+
* @problem.severity recommendation
8+
* @tags efficiency
89
*/
910

1011
import semmle.code.cpp.padding.Padding

0 commit comments

Comments
 (0)