Showing 89 of 104 total issues
Function __eq__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __eq__(self, other):
for attr in ["d", "run", "fold", "rep", "final"]:
if getattr(self, attr) is None:
if getattr(other, attr) is not None:
return 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 inverse_transform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def inverse_transform(self, data_t):
"""Inverse transform samples from the warped space back to the original space
Parameters
----------
- 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 too many return
statements within this function. Open
return Real(*dimension, **kwargs)
Avoid too many return
statements within this function. Open
return list(obj)
Avoid too many return
statements within this function. Open
return (key, value)
Avoid too many return
statements within this function. Open
return Real(*dimension, **kwargs)
Avoid too many return
statements within this function. Open
return Categorical(dimension, **kwargs)
Avoid too many return
statements within this function. Open
return obj
Avoid too many return
statements within this function. Open
return (tuple(pd.util.hash_pandas_object(obj, index=True)), tuple(obj.columns))
Avoid too many return
statements within this function. Open
return Categorical(dimension, **kwargs)
Function reinitialize_callbacks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reinitialize_callbacks(callbacks):
"""Ensures the contents of `callbacks` are valid Keras callbacks
Parameters
----------
- 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 visit_Return
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def visit_Return(self, node):
try:
self.returns.append(node.value.id)
except AttributeError:
for element in node.value.elts:
- 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_time_to_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_time_to_content(content, add_time=False):
"""Construct a string containing the original `content`, in addition to the current time
Parameters
----------
- 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 _validate_estimator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _validate_estimator(estimator: EstTypes, *valid_values: EstTypes) -> Optional[bool]:
# TODO: Add docstring
for valid_value in valid_values:
if isinstance(valid_value, str) and estimator == valid_value.upper():
return 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
Function initialize_dummy_model
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize_dummy_model(model_initializer, build_fn, wrapper_params):
"""Creates a dummy model with placeholder values wherever hyperparameter options are provided
via `hyperparameter_hunter.space` classes in order to produce a valid Keras model, albeit one
with semi-useless values, which also contains attributes injected by
:mod:`hyperparameter_hunter.importer`, and :mod:`hyperparameter_hunter.tracers` in order to
- 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 _set_direction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _set_direction(self, direction):
"""Ensure provided `direction` is valid and inferred if necessary
Parameters
----------
- 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_keras_attr
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_keras_attr(model, attr, max_depth=3, default=sentinel_default_value):
"""Retrieve specific Keras model attributes safely across different versions of Keras
Parameters
----------
- 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, v_str: str):
"""Parse and compare HyperparameterHunter version strings
Comparisons must be performed with a valid version string or another `HHVersion` instance.
- 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 __call__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __call__(cls, *args, **kwargs):
if getattr(G, "use_dummy_tracer", False) is True:
space = (Real, Integer, Categorical)
_args = [_ if not isinstance(_, space) else _.bounds[0] for _ in args]
_kwargs = {k: v if not isinstance(v, space) else v.bounds[0] for k, v in kwargs.items()}
- 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 subdict
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def subdict(d, keep=None, drop=None, key=None, value=None):
"""Compute the "subdictionary" of a dict, `d`
Parameters
----------
- 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"