Showing 126 of 141 total issues
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
.
Formatting a regular string which could be a f-string Open
errors.append(TraceabilityException("No automatic reverse relation: {source} {relation} "
- 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.
Formatting a regular string which could be a f-string Open
raise TraceabilityException('item {item} has invalid attribute ({attr}={value})'
- 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
raise ValueError('Traceability: combination of forward+reverse relations for item-tree: %s' % rel)
- 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 60 to the 15 allowed. Open
def perform_replacement(self, app, collection):
- 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
Using open without explicitly specifying an encoding Open
with open(fname, 'w') as outfile:
- Read upRead up
- Exclude checks
It is better to specify an encoding when opening documents. Using the system default implicitly can create problems on other operating systems. See https://peps.python.org/pep-0597/
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
retval += '\t{text} {relation}\n'.format(text=description, relation=relation)
- 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
.
Use of insecure MD2, MD4, MD5, or SHA1 hash function. Open
data['content-hash'] = hashlib.md5(self.content.encode('utf-8')).hexdigest()
- Exclude checks
Formatting a regular string which could be a f-string Open
headers['Authorization'] = 'token {}'.format(private_token)
- 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("The query did not return a description. URL = {}. Response = {}.".format(url, response))
- 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
raise ValueError('Update error {old} vs {new}'.format(old=self.identifier, new=other.identifier))
- 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('Expected value for coverage option to fully match regex {}; got {!r}'
- 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
.
Too many local variables (16/15) Confirmed
def build_pie_chart(self, sizes, labels, colors, env):
- Read upRead up
- Exclude checks
Used when a function or method has too many local variables.
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
Formatting a regular string which could be a f-string Open
report_warning('Traceability: unknown relation for %s: %s' % (self.name, rel),
- 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 itemid in self.items:
- 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 += '\t\t{target}\n'.format(target=tgtid)
- 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
.