File test.py
has 722 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; specifically version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
Function _run_test
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _run_test(self):
"""
Auxiliary method to run setup and test method.
"""
self._tag_start()
- 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
Test
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Test(unittest.TestCase, TestData):
"""
Base implementation for the test class.
You'll inherit from this to write your own tests. Typically you'll want
Function get_data
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_data(self, filename, source=None, must_exist=True):
"""
Retrieves the path to a given data file.
This implementation looks for data file in one of the sources
- 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 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
methodName="test",
name=None,
params=None,
Function __init__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
methodName="test",
name=None,
params=None,
- 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 _get_datadir
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _get_datadir(self, source):
path_components = self._data_sources_mapping.get(source)
if path_components is None:
return
- 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 fetch_asset
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def fetch_asset(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(