Function _raw_pedantic
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def _raw_pedantic(self, target, args=(), kwargs=None, setup=None, rounds=1, warmup_rounds=0, iterations=1):
if kwargs is None:
kwargs = {}
has_args = bool(args or kwargs)
- 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 fixture.py
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
import cProfile
import gc
import pstats
import sys
import time
Function __init__
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _raw
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _raw(self, function_to_benchmark, *args, **kwargs):
if self.enabled:
runner = self._make_runner(function_to_benchmark, args, kwargs)
duration, iterations, loops_range = self._calibrate_timer(runner)
- 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 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 _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):