Showing 4 of 6 total issues
Function cond_probs
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def cond_probs(obs):
"""
Computes a discrete conditional probability distribution from two lists of observations.
:param obs:
- Read upRead up
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 mutual_information
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def mutual_information(x, y, normalized=False, base=2):
"""
Compute the mutual information between two sets of observations.
First converts observations to discrete conditional probability distribution, then computes their MI.
- Read upRead up
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 kldiv
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def kldiv(X, Y, isprobs=False):
if isprobs == False:
p = probs(X)
q = probs(Y)
else:
- Read upRead up
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 match_arrays
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def match_arrays(x, y):
"""
Will add 0's to wichever array is shorter, until it matches the length of the longer array.
No-op if they are the same length.
- Read upRead up
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"