Showing 113 of 113 total issues
File structure_factor.py
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
File green_kubo_distinct_diffusion_coefficients.py
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
Function _perform_graph_decomposition
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _perform_graph_decomposition(self, adjacency_matrix: tf.Tensor) -> dict:
"""
Reduce an adjacency matrix into a linear combination of sub-matrices.
This is the process of graph decomposition in which one large graph is
- 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 einstein_distinct_diffusion_coefficients.py
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
File scheme.py
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
File green_kubo_self_diffusion_coefficients.py
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
File project.py
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
File spatial_distribution_function.py
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
File einstein_diffusion_coefficients.py
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
Identical blocks of code found in 2 locations. Consider refactoring. Open
@pytest.fixture(autouse=True)
def prepare_env():
"""Prepare temporary environment."""
temp_dir = TemporaryDirectory()
os.chdir(temp_dir.name)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 54.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
@pytest.fixture(autouse=True)
def prepare_env():
"""Prepare temporary environment."""
temp_dir = TemporaryDirectory()
os.chdir(temp_dir.name)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 54.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File test_project_add_experiment.py
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
ExperimentDatabase
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class ExperimentDatabase:
"""Experiment Database helper class for lazy access."""
temperature = LazyProperty()
time_step = LazyProperty()
File green_kubo_ionic_conductivity.py
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
MDSuite: A Zincwarecode package.
License
-------
Function get_prop_through_transformation
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_prop_through_transformation(self, sp_name, prop):
# todo prevent infinite recursion
# (e.g. unwrap_pos calls wrap_pos calls unwrap_pos calls ...)
from mdsuite.transformations.transformation_dict import (
property_to_transformation_dict,
- 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 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(
Function __init__
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function add_data
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def add_data(self, chunk: TrajectoryChunkData):
"""
Add new data to the dataset.
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 __call__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(
Function __call__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(