Showing 47 of 49 total issues
Function main
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def main():
parser = make_parser()
args = parser.parse_args()
level = Logger.QUIET if args.quiet else Logger.NORMAL
if args.verbose:
- 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 _make_runner
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _make_runner(self, function_to_benchmark, args, kwargs):
def runner(loops_range, timer=self._timer):
gc_enabled = gc.isenabled()
if self._disable_gc:
gc.disable()
- 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 __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, config):
self.verbose = config.getoption('benchmark_verbose')
self.quiet = False if self.verbose else config.getoption('benchmark_quiet')
level = Logger.QUIET if self.quiet else Logger.NORMAL
if self.verbose:
- 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 handle_saving
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def handle_saving(self):
save = self.save or self.autosave
if save or self.json:
if not self.benchmarks:
if not self.disabled:
- 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 exec_in_env
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def exec_in_env():
env_path = base_path / '.tox' / 'bootstrap'
if sys.platform == 'win32':
bin_path = env_path / 'Scripts'
else:
- 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 _raw_pedantic
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _raw_pedantic(self, target, args=(), kwargs=None, setup=None, rounds=1, warmup_rounds=0, iterations=1):
Function pedantic
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def pedantic(self, target, args=(), kwargs=None, setup=None, rounds=1, warmup_rounds=0, iterations=1):
Function _tooltip_data
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _tooltip_data(self, node, value, x, y, classes=None, xlabel=None):
Function pytest_benchmark_scale_unit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def pytest_benchmark_scale_unit(config, unit, benchmarks, best, worst, sort):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, columns, sort, histogram, name_format, logger, scale_unit):
Function pytest_benchmark_scale_unit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def pytest_benchmark_scale_unit(config, unit, benchmarks, best, worst, sort):
Function compute_baseline_scale
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compute_baseline_scale(baseline, value, width):
if not width:
return ''
if value == baseline:
return ' (1.0)'.ljust(width)
- 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
Avoid deeply nested control flow statements. Open
if self.compare_fail:
for check in self.compare_fail:
fail = check.fails(bench, flat_bench)
if fail:
self.performance_regressions.append((self.name_format(flat_bench), fail))
Function pytest_runtest_setup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def pytest_runtest_setup(item):
marker = item.get_closest_marker('benchmark')
if marker:
if marker.args:
raise ValueError("benchmark mark can't have positional arguments.")
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, hosts, index, doctype, project_name, logger, default_machine_id=None):
Function pytest_benchmark_generate_json
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def pytest_benchmark_generate_json(config, benchmarks, include_data, machine_info, commit_info):
Function pytest_benchmark_generate_json
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def pytest_benchmark_generate_json(config, benchmarks, include_data, machine_info, commit_info):
Function make_histogram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_histogram(output_prefix, name, benchmarks, unit, adjustment):
Function short_filename
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def short_filename(path, machine_id=None):
parts = []
try:
last = len(path.parts) - 1
except AttributeError:
- 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 _parse_hosts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _parse_hosts(storage_url, netrc_file):
# load creds from netrc file
path = os.path.expanduser(netrc_file)
creds = None
if netrc_file and os.path.isfile(path):
- 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"