carocad/CodeInk

View on GitHub

Showing 3 of 15 total issues

Function sketch_footprint has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def sketch_footprint(absfilepath, project_dirs):
    """Creates a graph of all the modules related to `absfilepath` by his
    imports. The directories used to resolve an import are `project_dirs`.
    Note that the relations are recursive,i.e. the modules imported by `absfilepath`
    as well as modules imported by those other modules, are included in the graph
Severity: Minor
Found in codeink/atelier/draftsman.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 sketch_accusation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def sketch_accusation(targetpath, modulepaths, project_dirs):
    """Creates a graph of all the modules in `modulepaths` that import
    the module at `targetpath`. The directories used to resolve an import are `project_dirs`

    Args:
Severity: Minor
Found in codeink/atelier/draftsman.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

Function get_directories has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_directories(dirpath, extension='.py'):
    """ recursively get all subdirectories including `dirpath`
    that contain files with the requested extension.

    Args:
Severity: Minor
Found in codeink/parchment/pkginfo.py - About 25 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

Severity
Category
Status
Source
Language