File plugin.py
has 433 lines of code (exceeds 250 allowed). Consider refactoring. Open
import argparse
import operator
import platform
import sys
import traceback
Function pytest_benchmark_group_stats
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def pytest_benchmark_group_stats(config, benchmarks, group_by):
groups = defaultdict(list)
for bench in benchmarks:
key = ()
for grouping in group_by.split(','):
- 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 pytest_collection_modifyitems
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def pytest_collection_modifyitems(config, items):
bs = config._benchmarksession
skip_bench = pytest.mark.skip(reason='Skipping benchmark (--benchmark-skip active).')
skip_other = pytest.mark.skip(reason='Skipping non-benchmark (--benchmark-only active).')
for item in items:
- 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 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 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 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 benchmark
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def benchmark(request):
bs = request.config._benchmarksession
if bs.skip:
pytest.skip('Benchmarks are skipped (--benchmark-skip was used).')
- 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"