Function run
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def run(web_type, args) -> None:
script_dir = os.path.dirname(os.path.abspath(inspect.stack()[0][1]))
app = Flask(__name__, template_folder=os.path.join(script_dir, "..", "templates"))
app.debug = True
- 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
File web.py
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
import inspect
import os
from collections import defaultdict
import math
import logging
Function create_slice_2d
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def create_slice_2d(i: int, j: int, experiment: bopt.Experiment,
resolution: int, n_dims: int, x_slice: List[float], model: GPy.models.GPRegression,
sample: bopt.Sample, show_marginal: int) -> Slice2D:
p1 = experiment.hyperparameters[i]
- 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 create_slice_1d
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_slice_1d(i: int, experiment: bopt.Experiment, resolution: int,
n_dims: int, x_slice: List[float], model: GPy.models.GPRegression, sample: bopt.Sample,
show_marginal: int) -> Slice1D:
param = experiment.hyperparameters[i]
- 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 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function create_slice_2d
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_slice_2d(i: int, j: int, experiment: bopt.Experiment,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, param: bopt.Hyperparameter, x: List[float],
Function create_slice_1d
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_slice_1d(i: int, experiment: bopt.Experiment, resolution: int,
Avoid deeply nested control flow statements. Open
if i == j:
slices_1d.append(create_slice_1d(i, experiment,
resolution, n_dims, x_slice, model, sample, show_marginal))
elif i < j:
Avoid deeply nested control flow statements. Open
for v, h in zip(value, experiment.hyperparameters):
kernel_param_timeline["{}_{}".format(key, h.name)].append(v)
else:
TODO found Open
# TODO: zbytek asi neni potreba mit pod lockem, ale pak nejde
- Exclude checks