gwpy/plot/colorbar.py

Summary

Maintainability
A
2 hrs
Test Coverage

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

def process_colorbar_kwargs(
    figure,
    mappable=None,
    ax=None,
    cax=None,
Severity: Minor
Found in gwpy/plot/colorbar.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 _colorbar_bounds has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def _colorbar_bounds(
    ax,
    location="right",
    width=None,
    length=1.,
Severity: Minor
Found in gwpy/plot/colorbar.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 find_mappable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def find_mappable(*axes):
    """Find the most recently added mappable layer in the given axes

    Parameters
    ----------
Severity: Minor
Found in gwpy/plot/colorbar.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

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

def _make_inset_axes(
    ax,
    location='right',
    width=0.012,
    length=1.,
Severity: Minor
Found in gwpy/plot/colorbar.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

There are no issues that match your filters.

Category
Status