pylhc/submitter

View on GitHub
pylhc_submitter/sixdesk_tools/troubleshooting.py

Summary

Maintainability
D
1 day
Test Coverage
F
0%

Function check_sixtrack_output_data has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
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.
Severity: Minor
Found in pylhc_submitter/sixdesk_tools/troubleshooting.py - About 1 day to fix

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

                    if not len(angle_dirs):
                        raise OSError(f"No angle-dirs present in {str(turn_dir)}.")
Severity: Major
Found in pylhc_submitter/sixdesk_tools/troubleshooting.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        for angle_dir in angle_dirs:
                            if not angle_dir.is_dir():
                                continue
    
                            htcondor_files = list(angle_dir.glob("htcondor.*"))
    Severity: Major
    Found in pylhc_submitter/sixdesk_tools/troubleshooting.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if not turn_dir.is_dir():
                              continue
      
      Severity: Major
      Found in pylhc_submitter/sixdesk_tools/troubleshooting.py - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status