File meta_functions.py
has 433 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
Function get_dimensionality
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_dimensionality(box: list) -> int:
"""
Calculate the dimensionality of the experiment box.
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 golden_section_search
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def golden_section_search(
Function golden_section_search
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def golden_section_search(
data: np.array,
a: float,
b: float,
tol: float = 1e-5,
- 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 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 optimize_batch_size
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def optimize_batch_size(