Consider possible security implications associated with subprocess module. Open
import subprocess
- Exclude checks
subprocess call - check for execution of untrusted input. Open
subprocess.Popen( # pylint: disable=W1509
cmd,
close_fds=True,
stdin=in_out,
stdout=in_out,
- Exclude checks
Function run
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def run(self, config):
def _get_name(test):
return str(test["id"])
def _get_name_no_id(test):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File diff.py
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
Function _get_sysinfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_sysinfo(resultsdir, pre_post):
sysinfo_dir = os.path.join(resultsdir, "sysinfo", pre_post)
sysinfo = []
for path, _, files in os.walk(sysinfo_dir):
for name in sorted(files):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _cdiff
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _cdiff(self, diff):
for line in diff:
if line.startswith("+"):
yield self.term.COLOR_GREEN + line
elif line.startswith("-"):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"