zincware/MDSuite

View on GitHub
mdsuite/calculators/radial_distribution_function.py

Summary

Maintainability
D
2 days
Test Coverage

File radial_distribution_function.py has 713 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
MDSuite: A Zincwarecode package.

License
-------
Severity: Major
Found in mdsuite/calculators/radial_distribution_function.py - About 1 day to fix

    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 check_input has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_input(self):
              """
              Check the input of the call method and store defaults if needed.
      
              Returns
      Severity: Minor
      Found in mdsuite/calculators/radial_distribution_function.py - About 55 mins 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 bin_minibatch has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def bin_minibatch(
      Severity: Major
      Found in mdsuite/calculators/radial_distribution_function.py - About 50 mins to fix

        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):
        Severity: Minor
        Found in mdsuite/calculators/radial_distribution_function.py - About 35 mins to fix

          Function ideal_correction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def ideal_correction(self) -> float:
                  """Get the correct ideal gas term.
          
                  In the case of a cutoff value greater than half of the box size, the ideal gas
                  term of the experiment must be corrected due to the lack of spherical symmetry
          Severity: Minor
          Found in mdsuite/calculators/radial_distribution_function.py - About 35 mins 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 _calculate_prefactor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def _calculate_prefactor(self, species: Union[str, tuple] = None):
                  """
                  Calculate the relevant prefactor for the analysis.
          
                  Parameters
          Severity: Minor
          Found in mdsuite/calculators/radial_distribution_function.py - About 25 mins 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

          There are no issues that match your filters.

          Category
          Status