Function run
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def run(self, data_file: Optional[str] = None):
"""Run the transformation."""
ttd_file_name = os.path.join(
self.input_base_dir, "P1-01-TTD_target_download.txt"
)
- 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_ttd_file
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_ttd_file(self, file: str) -> dict:
"""Parse entire TTD download file.
(a few megs, not very mem efficient, but
should be okay), and return a dict of dicts of lists
- 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_line
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_line(self, line: str, id_sep="; ") -> list:
r"""Parse one line of data from P1-01-TTD_target_download.
Return list of:
[target_id, abbrev, data_list]
- 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"