Skip to content

Commit 30c6637

Browse files
committed
CPP: Tag the Power of 10 queries.
1 parent aba73f4 commit 30c6637

23 files changed

+60
-15
lines changed

cpp/ql/src/Power of 10/Rule 1/UseOfGoto.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* @id cpp/power-of-10/use-of-goto
66
* @problem.severity warning
77
* @tags maintainability
8+
* readability
89
*/
910

1011
import cpp

cpp/ql/src/Power of 10/Rule 1/UseOfJmp.ql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* @kind problem
55
* @id cpp/power-of-10/use-of-jmp
66
* @problem.severity warning
7+
* @tags correctness
8+
* portability
9+
* readability
710
*/
811

912
import cpp

cpp/ql/src/Power of 10/Rule 1/UseOfRecursion.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/power-of-10/use-of-recursion
77
* @problem.severity warning
8+
* @tags maintainability
9+
* readability
810
*/
911

1012
import cpp

cpp/ql/src/Power of 10/Rule 2/BoundedLoopIterations.ql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
This check excludes loops that are meant to be nonterminating (like schedulers).
55
* @kind problem
66
* @id cpp/power-of-10/bounded-loop-iterations
7-
* @problem.severity warning
7+
* @problem.severity recommendation
8+
* @precision low
9+
* @tags correctness
10+
* reliability
811
*/
912

1013
import cpp

cpp/ql/src/Power of 10/Rule 2/ExitPermanentLoop.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* @description Permanent loops (like "while(1) {..}") are typically meant to be non-terminating and should not be terminated by other means.
44
* @kind problem
55
* @id cpp/power-of-10/exit-permanent-loop
6-
* @problem.severity warning
6+
* @problem.severity recommendation
7+
* @precision low
8+
* @tags correctness
79
*/
810

911
import cpp

cpp/ql/src/Power of 10/Rule 3/DynamicAllocAfterInit.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
* @description Dynamic memory allocation (using malloc() or calloc()) should be confined to the initialization routines of a program.
44
* @kind problem
55
* @id cpp/power-of-10/dynamic-alloc-after-init
6-
* @problem.severity warning
6+
* @problem.severity recommendation
7+
* @tags resources
78
*/
89

910
import cpp

cpp/ql/src/Power of 10/Rule 4/FunctionTooLong.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* @description Function length should be limited to what can be printed on a single sheet of paper (60 logical lines).
44
* @kind problem
55
* @id cpp/power-of-10/function-too-long
6-
* @problem.severity warning
6+
* @problem.severity recommendation
7+
* @tags maintainability
8+
* readability
79
*/
810

911
import cpp

cpp/ql/src/Power of 10/Rule 4/OneStmtPerLine.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* @description Putting more than one statement on a single line hinders program understanding.
44
* @kind problem
55
* @id cpp/power-of-10/one-stmt-per-line
6-
* @problem.severity warning
6+
* @problem.severity recommendation
7+
* @tags maintainability
8+
* readability
79
*/
810

911
import cpp

cpp/ql/src/Power of 10/Rule 5/AssertionDensity.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* @description Each function over 20 logical lines should have at least two assertions.
44
* @kind problem
55
* @id cpp/power-of-10/assertion-density
6-
* @problem.severity warning
6+
* @problem.severity recommendation
7+
* @tags maintainability
8+
* reliability
79
*/
810

911
import semmle.code.cpp.commons.Assertions

cpp/ql/src/Power of 10/Rule 5/AssertionSideEffect.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* @kind problem
66
* @id cpp/power-of-10/assertion-side-effect
77
* @problem.severity warning
8+
* @tags correctness
89
*/
910

1011
import semmle.code.cpp.commons.Assertions

0 commit comments

Comments
 (0)