Showing 126 of 141 total issues
Formatting a regular string which could be a f-string Open
report_warning('Item-matrix with title {!r} has bad coverage: {} evaluates to False'
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Formatting a regular string which could be a f-string Open
report_warning('Traceability: unknown relation for item-tree: %s' % rel, env.docname, self.lineno)
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Merge this if statement with the enclosing one. Open
if target in database[relation]:
- Read upRead up
- Exclude checks
Merging collapsible if
statements increases the code's readability.
Noncompliant Code Example
if condition1: if condition2: # ...
Compliant Solution
if condition1 and condition2: # ...
subprocess call - check for execution of untrusted input. Open
plantuml_path = subprocess.check_output(["whereis", "-u", "plantuml"])
- Exclude checks
Formatting a regular string which could be a f-string Open
selectors = ".{0}:active,\n.{0}:hover".format(class_name)
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Formatting a regular string which could be a f-string Open
report_warning("Your custom attribute {!r} overlaps with an option of directive(s) {!r} in which your "
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Consider iterating with .items() Open
for attribute in self.attributes:
- Read upRead up
- Exclude checks
Emitted when iterating over the keys of a dictionary and accessing the value by index lookup. Both the key and value can be accessed by iterating using the .items() method of the dictionary instead.
Formatting a regular string which could be a f-string Open
retval += '\tAttribute {attribute} = {value}\n'.format(attribute=attribute,
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Formatting a regular string which could be a f-string Open
expression = '{} {}'.format(percentage, self['coverage'])
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed. Open
def process_options(self, node, options, docname=None):
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed. Open
def _postprocess_tbody(self, tbody):
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Starting a process with a partial executable path Open
plantuml_path = subprocess.check_output(["whereis", "-u", "plantuml"])
- Exclude checks
Formatting a regular string which could be a f-string Open
report_warning("The arguments of the '{}' option must be space-separated without commas; "
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Unnecessary elif
after raise
, remove the leading el
from elif
Open
if relation in self.explicit_relations and target in self.explicit_relations[relation]:
- Read upRead up
- Exclude checks
Used in order to highlight an unnecessary block of code following an if containing a raise statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a raise statement.
Starting a process with a partial executable path Open
plantuml_path = subprocess.check_output(["where", "/F", "plantuml.jar"])
- Exclude checks
Unrecognized option found: files-output, bad-functions, function-name-hint, variable-name-hint, const-name-hint, attr-name-hint, argument-name-hint, class-attribute-name-hint, inlinevar-name-hint, class-name-hint, module-name-hint, method-name-hint, no-space-check Open
[MASTER]
- Read upRead up
- Exclude checks
Used when we detect an option that we do not recognize.
Too many local variables (20/15) Open
def make_internal_item_ref(self, app, item_id):
- Read upRead up
- Exclude checks
Used when a function or method has too many local variables.
Formatting a regular string which could be a f-string Open
raise TraceabilityException("Item '{identification}' has no reference to source document."
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Formatting a regular string which could be a f-string Open
"Item-matrix directive should have the same number of values for the options 'target' and "
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Formatting a regular string which could be a f-string Open
"Item-matrix {!r} cannot combine 'targetcolumns' with more than one 'target'; "
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.