Showing 36 of 50 total issues
Function plot_search_paths
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def plot_search_paths(
path,
optimizer,
opt_para,
n_iter_max,
- 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 evaluate
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def evaluate(self, score_new):
if self.simplex_step != 0:
self.prev_pos = self.positions_valid[-1]
if self.simplex_step == 1:
- 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
SearchTracker
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class SearchTracker:
def __init__(self):
super().__init__()
self._pos_new = None
Function iterate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def iterate(self):
# while loop for constraint opt
while True:
# If this is the first iteration:
# Generate the direction and return initial_position
- 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 search_path_gif
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def search_path_gif(
Function plot_search_paths
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_search_paths(
Function iterate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def iterate(self):
while True:
self.current_subspace = self.select_next_subspace()
if self.current_subspace:
pos = self.current_subspace.center_pos
- 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 _init_vertices
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _init_vertices(self, n_pos):
positions = []
for _ in range(n_pos):
for _ in range(100):
vertex = self._get_random_vertex()
- 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 print_info
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def print_info(
Function search
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def search(
Function init_search
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def init_search(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get_pos_space
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_pos_space(self):
if self.max_sample_size < self.conv.search_space_size:
n_samples_array = self.get_n_samples_dims()
return self.random_choices(n_samples_array)
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 no_change
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def no_change(score_new_list, early_stopping):
if "n_iter_no_change" not in early_stopping:
print(
"Warning n_iter_no_change-parameter must be set in order for early stopping to work"
)
- 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 __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _init_grid_search
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _init_grid_search(self, n_pos):
positions = []
if n_pos == 0:
return positions
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(