pylhc_submitter/sixdesk_tools/troubleshooting.py
Function check_sixtrack_output_data
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
Open
def check_sixtrack_output_data(jobname: str, basedir: Path):
"""Presence checks for SixDesk tracking output data.
This checks recursively all directories in `track`.
Will be busy for a while.
- 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
Avoid deeply nested control flow statements. Open
Open
if not len(angle_dirs):
raise OSError(f"No angle-dirs present in {str(turn_dir)}.")
Avoid deeply nested control flow statements. Open
Open
for angle_dir in angle_dirs:
if not angle_dir.is_dir():
continue
htcondor_files = list(angle_dir.glob("htcondor.*"))
Avoid deeply nested control flow statements. Open
Open
if not turn_dir.is_dir():
continue