boroivanov/lobo

View on GitHub

Showing 3 of 11 total issues

Function describe_all_load_balancers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def describe_all_load_balancers(elb, elbv2, name):
    '''
    Describe both elb and elbv2 load balancers.

    if `name` is not set.
Severity: Minor
Found in lobo/main.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 loop_load_balancers_pager has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def loop_load_balancers_pager(client, params, key):
    response = None
    lbs = []
    while True:
        if response:
Severity: Minor
Found in lobo/main.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 aggregate_health_states has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def aggregate_health_states(targets):
    '''Aggregate elb or elbv2 health stats'''
    states = {}
    for t in targets:
        if 'TargetHealth' in t:
Severity: Minor
Found in lobo/main.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

Severity
Category
Status
Source
Language