Showing 16 of 52 total issues
Function _get_joblib_kwargs
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _get_joblib_kwargs(keyvals: List[str]):
"""
Processes a list of the form `['key1=val1', ...]` into a dict that can be
passed to `joblib.Parallel`.
"""
- 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 pareto_frontier_mask
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def pareto_frontier_mask(arr: np.ndarray) -> np.ndarray:
"""
Computes the Pareto frontier of a set of points. The array must have an
`ndim` of 2.
- 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 a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
problem: Problem,
parameters: Union[
float,
- 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 generate_delta_F_plots
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def generate_delta_F_plots(
benchmark: Benchmark,
n_generations: int = 10,
) -> None:
"""
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def _evaluate(self, x, out, *args, **kwargs):
self._problem._evaluate(x, out, *args, **kwargs)
hist_x = pd.DataFrame(self._problem._history["X"])
n = len(hist_x) - len(x) if len(hist_x) > len(x) else None
# Fit the scaler to the PAST solution set. If there is no PAST
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def _evaluate(self, x, out, *args, **kwargs):
self._problem._evaluate(x, out, *args, **kwargs)
hist_x = pd.DataFrame(self._problem._history["X"])
self._update_kmeans(x)
km = self._best_kmeans()
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def _evaluate(self, x, out, *args, **kwargs):
"""
Applies the KNN-Avg algorithm to the wrapped (noisy) problem's output.
"""
self._problem._evaluate(x, out, *args, **kwargs)
- 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 plot_F_predictions_combined
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def plot_F_predictions_combined(benchmark: nmoo.Benchmark, n_samples: int):
algorithms = benchmark._algorithms.keys()
problems = benchmark._problems.keys()
levels = ["1-knn_avg", "2-gaussian_noise", "3-wrapped_problem"]
for a, p in product(algorithms, problems):
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run(
benchmark: str,
n_jobs: int,
n_post_processing_jobs: int,
verbose: int,
- 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 _resampling_min_on_conv
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _resampling_min_on_conv(self) -> None:
"""
Resampling rate *of elite members* may increase based on a convergence
assessment that uses the $\\varepsilon +$ indicator. Corresponds to
algorithm 3 in Fieldsend's paper.
- 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 v4_to_v5
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def v4_to_v5(benchmark: str, output_dir: Optional[Path]) -> None:
"""
Converts output files from nmoo v4 to v5.
Refer to the changelog for more details.
- 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 plot_performance_indicators
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def plot_performance_indicators(
benchmark: Benchmark,
row: Optional[str] = None,
*,
algorithms: Optional[Iterable[str]] = None,
- 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 _resampling_rate_on_conv
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _resampling_rate_on_conv(self) -> None:
"""
Resampling rate may increase based on a convergence assessment that
uses the $\\varepsilon +$ indicator. Corresponds to algorithm 2 in
Fieldsend's paper.
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
problem: Problem,
mean: Optional[np.ndarray] = None,
covariance: Optional[Union[float, int, np.ndarray]] = None,
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update(self, current_generation: int) -> None:
"""
Adds the current value of `F`, `G` etc. to the sample arrays, and
reverts the value of `F`, `G` etc. to the maximum likelyhood estimate.
- 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 add_to_history
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_to_history(self, **kwargs):
"""
Adds records to the history. The provided keys should match that of the
history (this is not checked at runtime for perfomance reasons). The
provided values should be numpy arrays that all have 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"