civictechro/website-alba-iulia-smart-city

View on GitHub
trellis/lib/trellis/utils/output.py

Summary

Maintainability
B
6 hrs
Test Coverage

Function display has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def display(obj, result):
    msg = ''
    result = result._result
    display = obj._display.display
    wrap_width = 77
Severity: Minor
Found in trellis/lib/trellis/utils/output.py - About 4 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 replace_item_with_key has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def replace_item_with_key(obj, result):
    item = '_ansible_item_label' if '_ansible_item_label' in result._result else 'item'
    should_replace = (
        not obj._display.verbosity
        and 'label' not in result._task._ds.get('loop_control', {})
Severity: Minor
Found in trellis/lib/trellis/utils/output.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 system has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def system(vagrant_version=None):
    # Get most recent Trellis CHANGELOG entry
    changelog_msg = ''
    ansible_path = os.getenv('ANSIBLE_CONFIG', os.getcwd())
    changelog = os.path.join(ansible_path, 'CHANGELOG.md')
Severity: Minor
Found in trellis/lib/trellis/utils/output.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

There are no issues that match your filters.

Category
Status