Showing 9 of 15 total issues
Function find_all
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def find_all(self):
for dirpath, dirnames, filenames in os.walk(self._search_path):
for filename in filenames:
if not self._filename_matcher or self._filename_matcher(filename):
yield os.path.join(dirpath, filename)
- 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 __exit__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __exit__(self, exc_type, exc_val, exc_tb):
self._context_exception = (exc_type, exc_val, exc_tb)
sub_context_failures = self._any_sub_steps_failed()
if self._step_exception != NO_EXCEPTION:
- 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, test_script, data_provider, data, start_time, status, exception):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, test_script, data_provider, iteration, start_time, status, exception):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, test_script, data_provider, start_time, status, exceptions):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, step, status, result, start_time, exception=(None, None, None)):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, data=None, name=None, description=None, tags=None, **_kwargs):
Function tests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def tests(self):
test_script_class_loader = ClassLoader(TestScript)
python_file_finder = FileFinder(self._root_dir,
filename_matcher=lambda name: name.lower().endswith('.py'))
- 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 _deep_merge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _deep_merge(self, base, update):
if not (isinstance(base, dict) and isinstance(update, dict)):
return update
for key in update:
- 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"