Function compute_constraints
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def compute_constraints(self):
for p in self.parameters:
if p.is_full:
array = [c for c in p.constraints if len(c) != 0]
con = list(itertools.product(*array))
- 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 simplify_constraints
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def simplify_constraints(self):
items_to_remove = set()
copy = list(self.constraints.copy())
for i in range(len(copy)):
is_brake = False
- 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 clean_hash_table
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def clean_hash_table(self, combination_matrix, t_value):
for constraint in self.constraints:
if len(constraint) > t_value:
continue
parameters_in_constraint = []
- 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 get_possible_values
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_possible_values(self, row, parameter):
"""
Compute all possible values for the given parameter.
These values are based on constraints and already picked 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"
Further reading
Avoid deeply nested control flow statements. Open
if len(c) > len(constraint_array):
if set(c) > set(constraint_array):
remove.add(c)
if not has_subset:
Avoid deeply nested control flow statements. Open
for pair in range(len(constraint[c])):
constraint_array.add(constraint[c][pair])
constraint_array = sorted(
Avoid deeply nested control flow statements. Open
if set(copy[i]).issubset(set(copy[j])):
items_to_remove.add(copy[j])
for item in items_to_remove:
Avoid deeply nested control flow statements. Open
if value == constraint[counter][self.CON_NAME]:
value_array.append([constraint[counter][self.CON_VAL]])
if (counter + 1) != len(constraint):
counter += 1
else:
Avoid deeply nested control flow statements. Open
if len(c) < len(constraint_array):
if set(c) < set(constraint_array):
has_subset = True
break
if len(c) > len(constraint_array):