dev-pipeline/dev-pipeline-build-order

View on GitHub

Showing 3 of 3 total issues

Function _do_dot has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def _do_dot(targets, components, tasks, layer_fn):
    print("digraph dependencies {")
    try:

        def _make_attribute_fn():
Severity: Minor
Found in lib/devpipeline_buildorder/dot.py - About 2 hrs 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 _print_layers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def _print_layers(targets, components, tasks):
    """
    Print dependency information, grouping components based on their position
    in the dependency graph.  Components with no dependnecies will be in layer
    0, components that only depend on layer 0 will be in layer 1, and so on.
Severity: Minor
Found in lib/devpipeline_buildorder/dot.py - About 45 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 _execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _execute(arguments):
    def _list_methods():
        for key in sorted(_ORDER_OUTPUTS):
            print("{} - {}".format(key, _ORDER_OUTPUTS[key][1]))

Severity: Minor
Found in lib/devpipeline_buildorder/build_order.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