Environment
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class Environment:
DEFAULT_PARAMS = dict(
environment_params_path=None,
results_path=None,
target_column="target",
Function format_result_paths
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def format_result_paths(self):
"""Remove paths contained in file_blacklist, and format others to prepare for saving results"""
if self.file_blacklist == "ALL" or self.results_path is None:
return
- 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_file_blacklist
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate_file_blacklist(blacklist):
"""Validate contents of blacklist. For most values, the corresponding file is saved upon
completion of the experiment. See the "Notes" section below for details on some special cases
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 experiment_callbacks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def experiment_callbacks(self, value):
if not isinstance(value, list):
self._experiment_callbacks = [value]
else:
self._experiment_callbacks = value
- 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_parameters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_parameters(self):
"""Ensure the provided parameters are valid and properly formatted"""
#################### metrics_params/metrics ####################
if (self.metrics is not None) and ("metrics" in self.metrics_params.keys()):
raise ValueError(
- 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 results_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def results_path(self, value):
self._results_path = value
if self._results_path is None:
G.warn("Received results_path=None. Results will not be stored at all.")
elif isinstance(self._results_path, str):
- 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"