zincware/MDSuite

View on GitHub

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
-------
Severity: Minor
Found in mdsuite/calculators/structure_factor.py - About 3 hrs to fix

    File green_kubo_distinct_diffusion_coefficients.py has 300 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    MDSuite: A Zincwarecode package.
    
    License
    -------
    Severity: Minor
    Found in mdsuite/calculators/green_kubo_distinct_diffusion_coefficients.py - About 3 hrs to fix

      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
      Severity: Minor
      Found in mdsuite/graph_modules/molecular_graph.py - About 2 hrs to fix

      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
      -------
      Severity: Minor
      Found in mdsuite/calculators/einstein_distinct_diffusion_coefficients.py - About 2 hrs to fix

        File scheme.py has 280 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """
        MDSuite: A Zincwarecode package.
        
        License
        -------
        Severity: Minor
        Found in mdsuite/database/scheme.py - About 2 hrs to fix

          File green_kubo_self_diffusion_coefficients.py has 275 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """
          MDSuite: A Zincwarecode package.
          
          License
          -------
          Severity: Minor
          Found in mdsuite/calculators/green_kubo_self_diffusion_coefficients.py - About 2 hrs to fix

            File project.py has 273 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """
            MDSuite: A Zincwarecode package.
            
            License
            -------
            Severity: Minor
            Found in mdsuite/project/project.py - About 2 hrs to fix

              File spatial_distribution_function.py has 267 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """
              MDSuite: A Zincwarecode package.
              
              License
              -------
              Severity: Minor
              Found in mdsuite/calculators/spatial_distribution_function.py - About 2 hrs to fix

                File einstein_diffusion_coefficients.py has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """
                MDSuite: A Zincwarecode package.
                
                License
                -------
                Severity: Minor
                Found in mdsuite/calculators/einstein_diffusion_coefficients.py - About 2 hrs to fix

                  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)
                  Severity: Major
                  Found in CI/unit_tests/project/test_project_load_experiments.py and 1 other location - About 2 hrs to fix
                  CI/unit_tests/project/test_project_database.py on lines 39..48

                  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

                  Further Reading

                  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)
                  Severity: Major
                  Found in CI/unit_tests/project/test_project_database.py and 1 other location - About 2 hrs to fix
                  CI/unit_tests/project/test_project_load_experiments.py on lines 38..47

                  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

                  Further Reading

                  File test_project_add_experiment.py has 260 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """
                  MDSuite: A Zincwarecode package.
                  
                  License
                  -------
                  Severity: Minor
                  Found in CI/unit_tests/project/test_project_add_experiment.py - About 2 hrs to fix

                    ExperimentDatabase has 21 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class ExperimentDatabase:
                        """Experiment Database helper class for lazy access."""
                    
                        temperature = LazyProperty()
                        time_step = LazyProperty()
                    Severity: Minor
                    Found in mdsuite/database/experiment_database.py - About 2 hrs to fix

                      File green_kubo_ionic_conductivity.py has 253 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """
                      MDSuite: A Zincwarecode package.
                      
                      License
                      -------
                      Severity: Minor
                      Found in mdsuite/calculators/green_kubo_ionic_conductivity.py - About 2 hrs to fix

                        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,
                        Severity: Minor
                        Found in mdsuite/transformations/transformations.py - About 1 hr to fix

                        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__(
                        Severity: Major
                        Found in mdsuite/calculators/angular_distribution_function.py - About 1 hr to fix

                          Function __init__ has 14 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(
                          Severity: Major
                          Found in mdsuite/database/data_manager.py - About 1 hr to fix

                            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
                            Severity: Minor
                            Found in mdsuite/database/simulation_database.py - About 1 hr to fix

                            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__(
                            Severity: Major
                            Found in mdsuite/calculators/radial_distribution_function.py - About 1 hr to fix

                              Function __call__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __call__(
                              Severity: Major
                              Found in mdsuite/calculators/einstein_distinct_diffusion_coefficients.py - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language