diff --git a/cpp/ql/integration-tests/query-suite/cpp-code-quality-extended.qls.expected b/cpp/ql/integration-tests/query-suite/cpp-code-quality-extended.qls.expected index 85790a23a836..9e33ce500d83 100644 --- a/cpp/ql/integration-tests/query-suite/cpp-code-quality-extended.qls.expected +++ b/cpp/ql/integration-tests/query-suite/cpp-code-quality-extended.qls.expected @@ -1 +1,46 @@ +ql/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql +ql/cpp/ql/src/Best Practices/ComplexCondition.ql +ql/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql +ql/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql +ql/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql +ql/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql +ql/cpp/ql/src/Best Practices/GuardedFree.ql +ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql +ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql +ql/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql +ql/cpp/ql/src/Best Practices/RuleOfTwo.ql +ql/cpp/ql/src/Best Practices/UseOfGoto.ql +ql/cpp/ql/src/Critical/LargeParameter.ql +ql/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql +ql/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql +ql/cpp/ql/src/Documentation/FixmeComments.ql +ql/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/PointlessComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql +ql/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql +ql/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql +ql/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql +ql/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql ql/cpp/ql/src/Likely Bugs/Likely Typos/AmbiguousAssignmentOfComparison.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql +ql/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql +ql/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql +ql/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql +ql/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql +ql/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql +ql/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql +ql/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql +ql/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql +ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql +ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql +ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql diff --git a/cpp/ql/integration-tests/query-suite/cpp-code-quality.qls.expected b/cpp/ql/integration-tests/query-suite/cpp-code-quality.qls.expected index 85790a23a836..9e33ce500d83 100644 --- a/cpp/ql/integration-tests/query-suite/cpp-code-quality.qls.expected +++ b/cpp/ql/integration-tests/query-suite/cpp-code-quality.qls.expected @@ -1 +1,46 @@ +ql/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql +ql/cpp/ql/src/Best Practices/ComplexCondition.ql +ql/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql +ql/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql +ql/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql +ql/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql +ql/cpp/ql/src/Best Practices/GuardedFree.ql +ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql +ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql +ql/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql +ql/cpp/ql/src/Best Practices/RuleOfTwo.ql +ql/cpp/ql/src/Best Practices/UseOfGoto.ql +ql/cpp/ql/src/Critical/LargeParameter.ql +ql/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql +ql/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql +ql/cpp/ql/src/Documentation/FixmeComments.ql +ql/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/PointlessComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql +ql/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql +ql/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql +ql/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql +ql/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql +ql/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql ql/cpp/ql/src/Likely Bugs/Likely Typos/AmbiguousAssignmentOfComparison.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql +ql/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql +ql/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql +ql/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql +ql/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql +ql/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql +ql/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql +ql/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql +ql/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql +ql/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql +ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql +ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql +ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql diff --git a/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql b/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql index be175660bd9c..a35ec36837b1 100644 --- a/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql +++ b/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql @@ -5,9 +5,11 @@ * @problem.severity recommendation * @precision high * @id cpp/complex-block - * @tags testability + * @tags quality + * testability * readability * maintainability + * complexity */ import cpp diff --git a/cpp/ql/src/Best Practices/ComplexCondition.ql b/cpp/ql/src/Best Practices/ComplexCondition.ql index 20ecd1b1adeb..b93d0b371e0b 100644 --- a/cpp/ql/src/Best Practices/ComplexCondition.ql +++ b/cpp/ql/src/Best Practices/ComplexCondition.ql @@ -5,9 +5,11 @@ * @problem.severity recommendation * @precision high * @id cpp/complex-condition - * @tags testability + * @tags quality + * testability * readability * maintainability + * complexity * statistical * non-attributable */ diff --git a/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql b/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql index 1e902579a495..be5a04fedb96 100644 --- a/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql +++ b/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql @@ -5,8 +5,10 @@ * @problem.severity warning * @precision high * @id cpp/rethrow-no-exception - * @tags reliability + * @tags quality + * reliability * correctness + * error-handling * exceptions */ diff --git a/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql b/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql index 28e7541fc744..9ac27287ae3b 100644 --- a/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql +++ b/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql @@ -5,8 +5,11 @@ * @problem.severity warning * @precision very-high * @id cpp/catch-by-value - * @tags efficiency + * @tags quality + * reliability + * efficiency * correctness + * error-handling * exceptions */ diff --git a/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql b/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql index d3848962abda..97ccbdc63e07 100644 --- a/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql +++ b/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql @@ -5,8 +5,11 @@ * @problem.severity warning * @precision high * @id cpp/catch-missing-free - * @tags efficiency + * @tags quality + * reliability + * efficiency * correctness + * error-handling * exceptions * external/cwe/cwe-401 */ diff --git a/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql b/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql index 85c21a28f560..ad73b220868c 100644 --- a/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql +++ b/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql @@ -5,8 +5,11 @@ * @problem.severity warning * @precision high * @id cpp/throwing-pointer - * @tags efficiency + * @tags quality + * reliability + * efficiency * correctness + * error-handling * exceptions */ diff --git a/cpp/ql/src/Best Practices/GuardedFree.ql b/cpp/ql/src/Best Practices/GuardedFree.ql index 3afe1a92e954..76b921e56688 100644 --- a/cpp/ql/src/Best Practices/GuardedFree.ql +++ b/cpp/ql/src/Best Practices/GuardedFree.ql @@ -6,8 +6,10 @@ * @problem.severity recommendation * @precision very-high * @id cpp/guarded-free - * @tags maintainability + * @tags quality + * maintainability * readability + * useless-code */ import cpp diff --git a/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql b/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql index 64e5760ed2b4..b4c0e7854605 100644 --- a/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql +++ b/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql @@ -5,7 +5,8 @@ * @problem.severity recommendation * @precision very-high * @id cpp/declaration-hides-parameter - * @tags maintainability + * @tags quality + * maintainability * readability */ diff --git a/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql b/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql index d10d346c5135..b5d40675c823 100644 --- a/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql +++ b/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql @@ -5,7 +5,8 @@ * @problem.severity recommendation * @precision high * @id cpp/declaration-hides-variable - * @tags maintainability + * @tags quality + * maintainability * readability */ diff --git a/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql b/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql index 52fec3ccbba8..ab9f5a27f0d5 100644 --- a/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql +++ b/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql @@ -5,7 +5,8 @@ * @problem.severity warning * @precision high * @id cpp/slicing - * @tags reliability + * @tags quality + * reliability * correctness * types */ diff --git a/cpp/ql/src/Best Practices/RuleOfTwo.ql b/cpp/ql/src/Best Practices/RuleOfTwo.ql index efc30c0829ee..030c8a706c33 100644 --- a/cpp/ql/src/Best Practices/RuleOfTwo.ql +++ b/cpp/ql/src/Best Practices/RuleOfTwo.ql @@ -7,7 +7,8 @@ * @problem.severity warning * @precision high * @id cpp/rule-of-two - * @tags reliability + * @tags quality + * reliability * readability * language-features */ diff --git a/cpp/ql/src/Best Practices/UseOfGoto.ql b/cpp/ql/src/Best Practices/UseOfGoto.ql index 26d72d69a0a2..5f360f72b869 100644 --- a/cpp/ql/src/Best Practices/UseOfGoto.ql +++ b/cpp/ql/src/Best Practices/UseOfGoto.ql @@ -6,8 +6,10 @@ * @problem.severity warning * @precision high * @id cpp/use-of-goto - * @tags maintainability + * @tags quality + * maintainability * readability + * complexity * language-features */ diff --git a/cpp/ql/src/Critical/LargeParameter.ql b/cpp/ql/src/Critical/LargeParameter.ql index 2df622a4c81c..42fd8215369a 100644 --- a/cpp/ql/src/Critical/LargeParameter.ql +++ b/cpp/ql/src/Critical/LargeParameter.ql @@ -5,7 +5,10 @@ * @problem.severity recommendation * @precision very-high * @id cpp/large-parameter - * @tags efficiency + * @tags quality + * reliability + * performance + * efficiency * readability * statistical * non-attributable diff --git a/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql b/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql index c41a8c5ce29c..d91db6a5a5a6 100644 --- a/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql +++ b/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql @@ -5,7 +5,9 @@ * @problem.severity warning * @precision high * @id cpp/new-array-delete-mismatch - * @tags reliability + * @tags quality + * reliability + * correctness */ import NewDelete diff --git a/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql b/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql index 497ddfe19c4a..c449828da804 100644 --- a/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql +++ b/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql @@ -5,7 +5,9 @@ * @problem.severity warning * @precision high * @id cpp/new-delete-array-mismatch - * @tags reliability + * @tags quality + * reliability + * correctness */ import NewDelete diff --git a/cpp/ql/src/Documentation/FixmeComments.ql b/cpp/ql/src/Documentation/FixmeComments.ql index 5ccbf1292758..0699e1852279 100644 --- a/cpp/ql/src/Documentation/FixmeComments.ql +++ b/cpp/ql/src/Documentation/FixmeComments.ql @@ -5,7 +5,8 @@ * @problem.severity recommendation * @precision very-high * @id cpp/fixme-comment - * @tags maintainability + * @tags quality + * maintainability * documentation * external/cwe/cwe-546 */ diff --git a/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql b/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql index c06cfeabe0d0..7b2a8bb1d1de 100644 --- a/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql +++ b/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql @@ -5,7 +5,7 @@ * @problem.severity error * @precision high * @id cpp/duplicate-include-guard - * @tags reliability + * @tags quality * maintainability * modularity */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql b/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql index dd27e4b7aee2..fba2fcf3f022 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql @@ -5,7 +5,8 @@ * @problem.severity warning * @precision high * @id cpp/bitwise-sign-check - * @tags reliability + * @tags quality + * reliability * correctness */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql b/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql index d4b23265eed5..cd893ca705ee 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql @@ -7,7 +7,8 @@ * @problem.severity warning * @precision very-high * @id cpp/comparison-precedence - * @tags maintainability + * @tags quality + * maintainability * readability */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql b/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql index 1f2a7ca506fd..7f1dfad0c6cf 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql @@ -7,7 +7,8 @@ * @problem.severity recommendation * @precision high * @id cpp/equality-on-floats - * @tags reliability + * @tags quality + * reliability * correctness */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/PointlessComparison.ql b/cpp/ql/src/Likely Bugs/Arithmetic/PointlessComparison.ql index 916f664c4fad..7067f76d38fc 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/PointlessComparison.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/PointlessComparison.ql @@ -8,7 +8,8 @@ * @problem.severity warning * @precision high * @id cpp/constant-comparison - * @tags maintainability + * @tags quality + * maintainability * readability */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql b/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql index d2602c5bd28a..1ab9ee67c404 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql @@ -7,7 +7,8 @@ * @problem.severity warning * @precision high * @id cpp/comparison-of-identical-expressions - * @tags readability + * @tags quality + * readability * maintainability */ diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql b/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql index 7f89569c3ba5..ff2ad98085e3 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql @@ -7,7 +7,9 @@ * @problem.severity warning * @precision very-high * @id cpp/unsigned-comparison-zero - * @tags maintainability + * @tags quality + * reliability + * correctness * readability */ diff --git a/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql b/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql index 5b16fc7cf8f0..b83392c4dfb6 100644 --- a/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql +++ b/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql @@ -7,7 +7,9 @@ * @id cpp/continue-in-false-loop * @problem.severity warning * @precision high - * @tags correctness + * @tags quality + * reliability + * correctness */ import cpp diff --git a/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql b/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql index 924b5d87f90f..b50460262134 100644 --- a/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql +++ b/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql @@ -6,7 +6,9 @@ * @id cpp/array-arg-size-mismatch * @problem.severity warning * @precision high - * @tags reliability + * @tags quality + * reliability + * correctness */ import cpp diff --git a/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql b/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql index 237d20c8f628..b3df230bf70a 100644 --- a/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql +++ b/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql @@ -6,7 +6,8 @@ * @problem.severity warning * @precision high * @id cpp/implicit-bitfield-downcast - * @tags reliability + * @tags quality + * reliability * correctness * types */ diff --git a/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql b/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql index 5b539faa5b4e..5a8fa0b8fa96 100644 --- a/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql +++ b/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql @@ -7,7 +7,8 @@ * @problem.severity recommendation * @precision high * @id cpp/too-many-format-arguments - * @tags reliability + * @tags quality + * reliability * correctness */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql b/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql index 3d2f6830bf54..6e71233672e2 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql @@ -6,7 +6,8 @@ * @problem.severity error * @precision high * @id cpp/assign-where-compare-meant - * @tags reliability + * @tags quality + * reliability * correctness * external/cwe/cwe-481 */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql b/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql index 46c271b11d7e..709545af661e 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql @@ -6,7 +6,8 @@ * @problem.severity error * @precision high * @id cpp/compare-where-assign-meant - * @tags reliability + * @tags quality + * reliability * correctness * external/cwe/cwe-482 */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql b/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql index 819ecbae8ec8..4ab16fbb8d05 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql @@ -6,7 +6,8 @@ * @problem.severity warning * @precision very-high * @id cpp/dubious-null-check - * @tags reliability + * @tags quality + * reliability * readability */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql b/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql index bf724de3d70c..28dccbf47a51 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql @@ -6,7 +6,8 @@ * @problem.severity recommendation * @precision high * @id cpp/empty-if - * @tags reliability + * @tags quality + * reliability * readability */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql b/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql index a1b5d7b8f358..dea16e9606d5 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql @@ -6,7 +6,8 @@ * @problem.severity warning * @precision high * @id cpp/logical-operator-applied-to-flag - * @tags reliability + * @tags quality + * reliability * correctness * external/cwe/cwe-480 */ diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql b/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql index 5b1d54b51f8f..3f633600667a 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql @@ -7,7 +7,9 @@ * @problem.severity error * @precision high * @id cpp/string-copy-return-value-as-boolean - * @tags correctness + * @tags quality + * reliability + * correctness */ import cpp diff --git a/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql b/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql index 958d7aa3c559..7173dfb70c58 100644 --- a/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql +++ b/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql @@ -5,7 +5,9 @@ * @problem.severity error * @precision high * @id cpp/inconsistent-loop-direction - * @tags correctness + * @tags quality + * reliability + * correctness * external/cwe/cwe-835 * @msrc.severity important */ diff --git a/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql b/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql index feca6558ef6e..e028fc8219e1 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql @@ -8,7 +8,8 @@ * @problem.severity warning * @precision high * @id cpp/return-c-str-of-std-string - * @tags reliability + * @tags quality + * reliability * correctness */ diff --git a/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql b/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql index 38cd86a594d9..55d2d620e015 100644 --- a/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql +++ b/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql @@ -7,8 +7,9 @@ * @problem.severity warning * @precision high * @id cpp/constructor-delegation - * @tags maintainability - * readability + * @tags quality + * reliability + * correctness * language-features */ diff --git a/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql b/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql index 7a223f56f57b..366118513aa3 100644 --- a/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql +++ b/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql @@ -5,8 +5,9 @@ * @problem.severity warning * @precision high * @id cpp/virtual-destructor - * @tags reliability - * readability + * @tags quality + * reliability + * correctness * language-features */ diff --git a/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql b/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql index 75252eb45097..2b702d814e58 100644 --- a/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql +++ b/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql @@ -6,8 +6,10 @@ * @problem.severity warning * @precision very-high * @id cpp/throw-in-destructor - * @tags reliability - * readability + * @tags quality + * reliability + * correctness + * error-handling * language-features */ diff --git a/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql b/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql index 661abfd07e9c..45a65d3ea44e 100644 --- a/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql +++ b/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql @@ -5,8 +5,10 @@ * @problem.severity warning * @precision very-high * @id cpp/member-const-no-effect - * @tags maintainability + * @tags quality + * maintainability * readability + * useless-code * language-features */ diff --git a/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql b/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql index 8e921faf2117..912d8a590550 100644 --- a/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql +++ b/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql @@ -7,7 +7,8 @@ * @problem.severity warning * @precision high * @id cpp/implicit-function-declaration - * @tags correctness + * @tags quality + * correctness * maintainability */ diff --git a/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql b/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql index 4e7f85097b8e..f8e24bdaf3d4 100644 --- a/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql +++ b/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql @@ -7,7 +7,8 @@ * @problem.severity warning * @precision very-high * @id cpp/futile-params - * @tags correctness + * @tags quality + * correctness * maintainability */ diff --git a/cpp/ql/src/change-notes/2026-10-12-cpp-code-quality-suite.md b/cpp/ql/src/change-notes/2026-10-12-cpp-code-quality-suite.md new file mode 100644 index 000000000000..da96d01b3bad --- /dev/null +++ b/cpp/ql/src/change-notes/2026-10-12-cpp-code-quality-suite.md @@ -0,0 +1,4 @@ +--- +category: queryMetadata +--- +* Added a new `cpp-code-quality` query suite containing queries that identify maintainability and reliability issues in C and C++ code. diff --git a/cpp/ql/src/codeql-suites/cpp-security-and-quality.qls b/cpp/ql/src/codeql-suites/cpp-security-and-quality.qls index b4f85c4e306e..d6df483208da 100644 --- a/cpp/ql/src/codeql-suites/cpp-security-and-quality.qls +++ b/cpp/ql/src/codeql-suites/cpp-security-and-quality.qls @@ -1,5 +1,92 @@ - description: Security-and-quality queries for C and C++ - queries: . -- apply: security-and-quality-selectors.yml +- apply: security-and-frozen-quality-selectors.yml from: codeql/suite-helpers +- include: + id: + - cpp/ambiguous-assignment-of-comparison + - cpp/ambiguously-signed-bit-field + - cpp/array-arg-size-mismatch + - cpp/array-in-interface + - cpp/assign-where-compare-meant + - cpp/assignment-does-not-return-this + - cpp/bitwise-sign-check + - cpp/catch-by-value + - cpp/catch-missing-free + - cpp/commented-out-code + - cpp/compare-where-assign-meant + - cpp/comparison-of-identical-expressions + - cpp/comparison-precedence + - cpp/complex-block + - cpp/complex-condition + - cpp/constant-comparison + - cpp/constructor-delegation + - cpp/continue-in-false-loop + - cpp/dead-code-goto + - cpp/declaration-hides-parameter + - cpp/declaration-hides-variable + - cpp/dubious-null-check + - cpp/duplicate-include-guard + - cpp/empty-block + - cpp/empty-if + - cpp/equality-on-floats + - cpp/fixme-comment + - cpp/function-in-block + - cpp/futile-params + - cpp/guarded-free + - cpp/implicit-bitfield-downcast + - cpp/implicit-function-declaration + - cpp/include-non-header + - cpp/incomplete-parity-check + - cpp/inconsistent-call-on-result + - cpp/inconsistent-loop-direction + - cpp/inconsistent-null-check + - cpp/inconsistent-virtual-inheritance + - cpp/integer-used-for-enum + - cpp/irregular-enum-init + - cpp/large-parameter + - cpp/leap-year/adding-365-days-per-year + - cpp/leap-year/unchecked-after-arithmetic-year-modification + - cpp/leap-year/unchecked-return-value-for-time-conversion-function + - cpp/local-variable-hides-global-variable + - cpp/logical-operator-applied-to-flag + - cpp/long-switch + - cpp/loop-variable-changed + - cpp/loop-variable-float + - cpp/lossy-function-result-cast + - cpp/lossy-pointer-cast + - cpp/member-const-no-effect + - cpp/missing-case-in-switch + - cpp/missing-header-guard + - cpp/missing-return + - cpp/mistyped-function-arguments + - cpp/nested-loops-with-same-variable + - cpp/new-array-delete-mismatch + - cpp/new-delete-array-mismatch + - cpp/non-member-const-no-effect + - cpp/poorly-documented-function + - cpp/redefined-default-parameter + - cpp/resource-not-released-in-destructor + - cpp/rethrow-no-exception + - cpp/return-c-str-of-std-string + - cpp/rule-of-two + - cpp/short-global-name + - cpp/sizeof-side-effect + - cpp/slicing + - cpp/stack-address-escape + - cpp/string-copy-return-value-as-boolean + - cpp/throw-in-destructor + - cpp/throwing-pointer + - cpp/too-many-format-arguments + - cpp/trivial-switch + - cpp/undisciplined-multiple-inheritance + - cpp/unsigned-comparison-zero + - cpp/unused-local-variable + - cpp/unused-static-function + - cpp/unused-static-variable + - cpp/use-in-own-initializer + - cpp/use-of-goto + - cpp/useless-expression + - cpp/virtual-call-in-constructor + - cpp/virtual-destructor - apply: codeql-suites/exclude-slow-queries.yml diff --git a/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql b/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql index 59a6838c23e3..4f86f64bc435 100644 --- a/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql +++ b/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql @@ -7,7 +7,8 @@ * @problem.severity recommendation * @precision high * @id cpp/missing-header-guard - * @tags efficiency + * @tags quality + * efficiency * maintainability * modularity * external/jsf diff --git a/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql b/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql index ec7d446ac58a..761879c98702 100644 --- a/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql +++ b/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql @@ -5,7 +5,9 @@ * @problem.severity warning * @precision high * @id cpp/virtual-call-in-constructor - * @tags reliability + * @tags quality + * reliability + * correctness * readability * language-features * external/jsf diff --git a/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql b/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql index 85b779903ebf..5a53d903fbc9 100644 --- a/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql +++ b/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql @@ -5,7 +5,9 @@ * @problem.severity warning * @precision high * @id cpp/resource-not-released-in-destructor - * @tags efficiency + * @tags quality + * reliability + * efficiency * readability * external/cwe/cwe-404 * external/jsf diff --git a/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql b/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql index 4f76b4c10eaa..17f6b41b5c7d 100644 --- a/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql +++ b/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql @@ -5,7 +5,8 @@ * @problem.severity recommendation * @precision high * @id cpp/loop-variable-float - * @tags correctness + * @tags quality + * correctness * reliability * external/jsf */