Python: Add many medium precision queries to the code-quality-extended suite.

This commit is contained in:
Michael Nebel
2025-09-10 16:03:11 +02:00
parent 046d0d4938
commit 7c0aa78e39
15 changed files with 43 additions and 25 deletions

View File

@@ -2,9 +2,9 @@
* @name Overwriting attribute in super-class or sub-class
* @description Assignment to self attribute overwrites attribute previously defined in subclass or superclass `__init__` method.
* @kind problem
* @tags reliability
* maintainability
* modularity
* @tags quality
* reliability
* correctness
* @problem.severity warning
* @sub-severity low
* @precision medium

View File

@@ -3,9 +3,10 @@
* @description Making a class a context manager allows instances to be used in a 'with' statement.
* This improves resource handling and code readability.
* @kind problem
* @tags maintainability
* @tags quality
* maintainability
* readability
* convention
* performance
* @problem.severity recommendation
* @sub-severity high
* @precision medium

View File

@@ -2,8 +2,10 @@
* @name Useless class
* @description Class only defines one public method (apart from `__init__` or `__new__`) and should be replaced by a function
* @kind problem
* @tags maintainability
* @tags quality
* maintainability
* useless-code
* complexity
* @problem.severity recommendation
* @sub-severity low
* @precision medium

View File

@@ -2,8 +2,9 @@
* @name Non-portable comparison using is when operands support `__eq__`
* @description Comparison using 'is' when equivalence is not the same as identity and may not be portable.
* @kind problem
* @tags portability
* maintainability
* @tags quality
* reliability
* correctness
* @problem.severity recommendation
* @sub-severity low
* @precision medium

View File

@@ -2,11 +2,10 @@
* @name Ignored return value
* @description Ignoring return values may result in discarding errors or loss of information.
* @kind problem
* @tags reliability
* @tags quality
* reliability
* correctness
* readability
* convention
* statistical
* non-attributable
* external/cwe/cwe-252
* @problem.severity recommendation
* @sub-severity high

View File

@@ -2,9 +2,9 @@
* @name Importing value of mutable attribute
* @description Importing the value of a mutable attribute directly means that changes in global state will not be observed locally.
* @kind problem
* @tags reliability
* maintainability
* modularity
* @tags quality
* reliability
* correctness
* @problem.severity warning
* @sub-severity high
* @precision medium

View File

@@ -3,7 +3,8 @@
* @description An assert statement testing a literal constant value may exhibit
* different behavior when optimizations are enabled.
* @kind problem
* @tags reliability
* @tags quality
* reliability
* correctness
* @problem.severity recommendation
* @sub-severity low

View File

@@ -3,8 +3,10 @@
* @description Using a Break or Return statement in a finally block causes the
* Try-finally block to exit, discarding the exception.
* @kind problem
* @tags reliability
* maintainability
* @tags quality
* reliability
* error-handling
* correctness
* external/cwe/cwe-584
* @problem.severity warning
* @sub-severity low

View File

@@ -3,7 +3,9 @@
* @description Omitting documentation strings from public classes, functions or methods
* makes it more difficult for other developers to maintain the code.
* @kind problem
* @tags maintainability
* @tags quality
* maintainability
* readability
* @problem.severity recommendation
* @sub-severity low
* @precision medium

View File

@@ -2,7 +2,8 @@
* @name Use of 'return' or 'yield' outside a function
* @description Using 'return' or 'yield' outside a function causes a 'SyntaxError' at runtime.
* @kind problem
* @tags reliability
* @tags quality
* reliability
* correctness
* @problem.severity error
* @sub-severity low

View File

@@ -4,8 +4,10 @@
* makes the built-in object unusable within the current scope and makes the code
* more difficult to read.
* @kind problem
* @tags maintainability
* @tags quality
* maintainability
* readability
* correctness
* @problem.severity recommendation
* @sub-severity low
* @precision medium

View File

@@ -4,8 +4,10 @@
* makes the global variable unusable within the current scope and makes the code
* more difficult to read.
* @kind problem
* @tags maintainability
* @tags quality
* maintainability
* readability
* correctness
* @problem.severity recommendation
* @sub-severity low
* @precision medium

View File

@@ -2,7 +2,8 @@
* @name Use of an undefined placeholder variable
* @description Using a variable before it is initialized causes an exception.
* @kind problem
* @tags reliability
* @tags quality
* reliability
* correctness
* @problem.severity error
* @sub-severity low

View File

@@ -2,7 +2,8 @@
* @name Potentially uninitialized local variable
* @description Using a local variable before it is initialized causes an UnboundLocalError.
* @kind problem
* @tags reliability
* @tags quality
* reliability
* correctness
* @problem.severity error
* @sub-severity low

View File

@@ -2,7 +2,10 @@
* @name Unused parameter
* @description Parameter is defined but not used
* @kind problem
* @tags maintainability
* @tags quality
* reliability
* correctness
* readability
* @problem.severity recommendation
* @sub-severity high
* @precision medium