Showing 23 of 35 total issues
Function min_sums
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def min_sums(self, numbers, n_sum):
self.set_numbers(numbers)
n = len(self.numbers_)
all_sums_cnt = [None] * n
- 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 fit_id3
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fit_id3(x, y, criterion="entropy"):
# x, y are supposed to be pandas DataFrame format
partition_disorder = functools.partial(util.partition_disorder, y=y, criterion=criterion)
disorder_by_feature = x.apply(partition_disorder)
min_disorder_feature = np.argmin(disorder_by_feature)
- 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 how_many
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def how_many(self, values):
self.set_values(values)
count = 0
values_for_above = dict(self.values_)
- 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"