pylhc/submitter

View on GitHub
pylhc_submitter/sixdesk_tools/create_workspace.py

Summary

Maintainability
A
2 hrs
Test Coverage
C
75%

Function remove_twiss_fail_check has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def remove_twiss_fail_check(jobname: str, basedir: Path):
    """ Comments out the "Twiss fail" check from mad6t.sh """
    LOG.info("Applying twiss-fail hack.")
    for mad6t_path in (
        get_mad6t_mask_path(jobname, basedir),
Severity: Minor
Found in pylhc_submitter/sixdesk_tools/create_workspace.py - About 1 hr 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

Function set_max_materialize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Invalid

def set_max_materialize(sixdesk: Path, max_materialize: int = None):
    """ Adds the ``max_materialize`` option into the htcondor sixtrack
    submission-file."""
    if max_materialize is None:
        return
Severity: Minor
Found in pylhc_submitter/sixdesk_tools/create_workspace.py - About 1 hr 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

Function create_job has 7 arguments (exceeds 4 allowed). Consider refactoring.
Invalid

def create_job(jobname: str, basedir: Path, executable: Union[Path, str], mask_text: str,
Severity: Major
Found in pylhc_submitter/sixdesk_tools/create_workspace.py - About 50 mins to fix

    Function fix_pythonfile_call has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def fix_pythonfile_call(jobname: str, basedir: Path):
        """ Removes '<' in the `binary file` line in mad6t.sh so __file__ works. """
        LOG.info("Applying python-file call fix.")
        for mad6t_path in (
                get_mad6t_mask_path(jobname, basedir),
    Severity: Minor
    Found in pylhc_submitter/sixdesk_tools/create_workspace.py - About 35 mins 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

    There are no issues that match your filters.

    Category
    Status