Showing 113 of 113 total issues
Function resize_datasets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def resize_datasets(self, structure: dict):
"""
Resize a dataset so more tensor_values can be added.
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 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
data_path: list = None,
database: Database = None,
parallel: bool = 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 _read_process_n_configurations
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _read_process_n_configurations(
self,
file,
n_configs: int,
n_header_lines: int = 0,
- 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 construct_plot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def construct_plot(
Avoid deeply nested control flow statements. Open
if workaround_time_in_axis_1:
database[dataset_name][:, start_index:stop_index, :] = (
np.swapaxes(write_data, 0, 1)
)
else:
Avoid deeply nested control flow statements. Open
if not isinstance(val, collections.abc.Iterable):
val = [val]
val = tf.convert_to_tensor(val, dtype=self.dtype)
Function _get_processor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_processor(simulation_data):
"""Read in one file."""
if isinstance(simulation_data, str) or isinstance(simulation_data, pathlib.Path):
suffix = pathlib.Path(simulation_data).suffix
if suffix == ".lammpstraj":
- 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 _compute_number_of_atoms
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _compute_number_of_atoms(self, reference: dict):
"""
Compute the number of atoms total in the selected set of species.
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 add_dataset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_dataset(self, architecture: dict):
"""
Add a dataset of the necessary size to the database_path.
Just as a separate method exists for building the group structure of the hdf5
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(
Function find_item
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_item(obj, key):
"""
Function to recursively retrieve values given a key for nested dictionaries.
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
Consider simplifying this complex logical expression. Open
if (
box[0] == 0
and box[1] == 0
or box[0] == 0
and box[2] == 0
Function load_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def load_data(
Function run_minibatch_loop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_minibatch_loop(self, atoms, stop, n_atoms, minibatch_start, positions_tensor):
Function get2dHistogram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get2dHistogram(x, y, value_range, nbins=100, dtype=tf.dtypes.int32):
Function optimize_batch_size
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def optimize_batch_size(
Function get_triplets
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_triplets(
Function __call__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(
Function __call__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(
Function __call__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(