Skip to content

Commit 7c0aa78

Browse files
committed
Python: Add many medium precision queries to the code-quality-extended suite.
1 parent 046d0d4 commit 7c0aa78

15 files changed

+43
-25
lines changed

python/ql/src/Classes/OverwritingAttributeInSuperClass.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* @name Overwriting attribute in super-class or sub-class
33
* @description Assignment to self attribute overwrites attribute previously defined in subclass or superclass `__init__` method.
44
* @kind problem
5-
* @tags reliability
6-
* maintainability
7-
* modularity
5+
* @tags quality
6+
* reliability
7+
* correctness
88
* @problem.severity warning
99
* @sub-severity low
1010
* @precision medium

python/ql/src/Classes/ShouldBeContextManager.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* @description Making a class a context manager allows instances to be used in a 'with' statement.
44
* This improves resource handling and code readability.
55
* @kind problem
6-
* @tags maintainability
6+
* @tags quality
7+
* maintainability
78
* readability
8-
* convention
9+
* performance
910
* @problem.severity recommendation
1011
* @sub-severity high
1112
* @precision medium

python/ql/src/Classes/UselessClass.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
* @name Useless class
33
* @description Class only defines one public method (apart from `__init__` or `__new__`) and should be replaced by a function
44
* @kind problem
5-
* @tags maintainability
5+
* @tags quality
6+
* maintainability
67
* useless-code
8+
* complexity
79
* @problem.severity recommendation
810
* @sub-severity low
911
* @precision medium

python/ql/src/Expressions/NonPortableComparisonUsingIs.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
* @name Non-portable comparison using is when operands support `__eq__`
33
* @description Comparison using 'is' when equivalence is not the same as identity and may not be portable.
44
* @kind problem
5-
* @tags portability
6-
* maintainability
5+
* @tags quality
6+
* reliability
7+
* correctness
78
* @problem.severity recommendation
89
* @sub-severity low
910
* @precision medium

python/ql/src/Functions/ReturnValueIgnored.ql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
* @name Ignored return value
33
* @description Ignoring return values may result in discarding errors or loss of information.
44
* @kind problem
5-
* @tags reliability
5+
* @tags quality
6+
* reliability
7+
* correctness
68
* readability
7-
* convention
8-
* statistical
9-
* non-attributable
109
* external/cwe/cwe-252
1110
* @problem.severity recommendation
1211
* @sub-severity high

python/ql/src/Imports/FromImportOfMutableAttribute.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* @name Importing value of mutable attribute
33
* @description Importing the value of a mutable attribute directly means that changes in global state will not be observed locally.
44
* @kind problem
5-
* @tags reliability
6-
* maintainability
7-
* modularity
5+
* @tags quality
6+
* reliability
7+
* correctness
88
* @problem.severity warning
99
* @sub-severity high
1010
* @precision medium

python/ql/src/Statements/AssertLiteralConstant.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
* @description An assert statement testing a literal constant value may exhibit
44
* different behavior when optimizations are enabled.
55
* @kind problem
6-
* @tags reliability
6+
* @tags quality
7+
* reliability
78
* correctness
89
* @problem.severity recommendation
910
* @sub-severity low

python/ql/src/Statements/BreakOrReturnInFinally.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
* @description Using a Break or Return statement in a finally block causes the
44
* Try-finally block to exit, discarding the exception.
55
* @kind problem
6-
* @tags reliability
7-
* maintainability
6+
* @tags quality
7+
* reliability
8+
* error-handling
9+
* correctness
810
* external/cwe/cwe-584
911
* @problem.severity warning
1012
* @sub-severity low

python/ql/src/Statements/DocStrings.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* @description Omitting documentation strings from public classes, functions or methods
44
* makes it more difficult for other developers to maintain the code.
55
* @kind problem
6-
* @tags maintainability
6+
* @tags quality
7+
* maintainability
8+
* readability
79
* @problem.severity recommendation
810
* @sub-severity low
911
* @precision medium

python/ql/src/Statements/ReturnOrYieldOutsideFunction.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* @name Use of 'return' or 'yield' outside a function
33
* @description Using 'return' or 'yield' outside a function causes a 'SyntaxError' at runtime.
44
* @kind problem
5-
* @tags reliability
5+
* @tags quality
6+
* reliability
67
* correctness
78
* @problem.severity error
89
* @sub-severity low

0 commit comments

Comments
 (0)