UliEngineering/Utils/Files.py
Function list_recursive
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def list_recursive(directory, relative=False, files_only=True):
"""
List a directory recursively, yielding each filename
(with the filename being relative to the directory).
- 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 extract_numeric_column
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def extract_numeric_column(flo, isline=__standard_isline, postproc=functoolz.identity,
Function extract_column
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def extract_column(flo, isline=__standard_isline, preproc=_strip_newline,
Function extract_column
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def extract_column(flo, isline=__standard_isline, preproc=_strip_newline,
postproc=functoolz.identity, extractcol=_csv_firstcol):
"""
Lazily extract a column from a file, for example extract a column from a CSV file.
The values are run through a postprocessing function and placed in a list which is returned.
- 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"