LucaCappelletti94/dictances

View on GitHub

Showing 7 of 57 total issues

Function nth_variation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def nth_variation(a: Dict, b: Dict, exp: float = 2, overlap: bool = False) -> float:
    """Return the nth power distance beetween the given dictionaries.

    Parameters
    ----------------------------
Severity: Minor
Found in dictances/nth_variation.py - About 55 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 chi_square has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def chi_square(a: Dict, b: Dict) -> float:
    """Return the chi square distance beetween the two given dictionaries.

    Parameters
    ----------------------------
Severity: Minor
Found in dictances/chi_square.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 normal_chi_square has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def normal_chi_square(a: Dict, b: Dict) -> float:
    """Return the normalized chi square distance beetween the two given dictionaries.

    Parameters
    ----------------------------
Severity: Minor
Found in dictances/normal_chi_square.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 intersection_nth_variation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def intersection_nth_variation(a: Dict, b: Dict, exp: float=2, overlap: bool=False)->float:
    """Return the nth power distance beetween the insersection of a and b."""
    total = 0
    n = 0
    bget = b.__getitem__
Severity: Minor
Found in dictances/intersection_nth_variation.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 canberra has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def canberra(a: Dict, b: Dict) -> float:
    """Return the canberra distance beetween the given dictionaries.

    Parameters
    ----------------------------
Severity: Minor
Found in dictances/canberra.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 kullback_leibler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def kullback_leibler(p: Dict, q: Dict) -> float:
    """Determine the Kullback Leibler divergence beetween the given dictionaries.

    Parameters
    ----------------------------
Severity: Minor
Found in dictances/kullback_leibler.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 chebyshev has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def chebyshev(a: Dict, b: Dict) -> float:
    """Determine the Chebyshev distance beetween the given dictionaries.

    Parameters
    ----------------------------
Severity: Minor
Found in dictances/chebyshev.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