zincware/MDSuite

View on GitHub

Showing 107 of 113 total issues

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

    def __call__(
Severity: Minor
Found in mdsuite/calculators/green_kubo_viscosity.py - About 35 mins to fix

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

        def __call__(
    Severity: Minor
    Found in mdsuite/calculators/coordination_number_calculation.py - About 35 mins to fix

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

          def __call__(
      Severity: Minor
      Found in mdsuite/calculators/einstein_helfand_thermal_kinaci.py - About 35 mins to fix

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

            def __call__(
        Severity: Minor
        Found in mdsuite/calculators/einstein_helfand_thermal_conductivity.py - About 35 mins to fix

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

              def __init__(
                  self,
                  experiment: Experiment,
                  molecule_input_data: Molecule,
              ):
          Severity: Minor
          Found in mdsuite/graph_modules/molecular_graph.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 _get_species_information has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _get_species_information(
                  self, file, header_property_names: list, n_particles: int
              ):
                  """
                  Get the information which species are present and which particle ids/ lines in
          Severity: Minor
          Found in mdsuite/file_io/lammps_trajectory_files.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 load_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def load_data(
                  self,
                  path_list: list = None,
                  select_slice: np.s_ = np.s_[:],
                  dictionary: bool = False,
          Severity: Minor
          Found in mdsuite/database/simulation_database.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 _build_path_input has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _build_path_input(structure: dict) -> dict:
                  """
                  Build an input to a hdf5 database_path from a dictionary.
          
                  In many cases, whilst a dict can be passed on to a method, it is not ideal for
          Severity: Minor
          Found in mdsuite/database/simulation_database.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 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 species has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def species(self, value: dict):
                  """Save the SpeciesInfo to the SQL database.
          
                  Parameters
                  ----------
          Severity: Minor
          Found in mdsuite/database/experiment_database.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 _run_visualization has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _run_visualization(self, plot_data: tf.Tensor, colour_map: np.ndarray):
                  """
                  Run the visualizer.
          
                  Parameters
          Severity: Minor
          Found in mdsuite/calculators/spatial_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 _get_time has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def _get_time(header: str) -> float:
              """
              Retrieve the time value from a header line.
              Can be used to infer the sampling step by calling on consecutive config headers.
          
          
          Severity: Minor
          Found in mdsuite/file_io/extxyz_files.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

          Function get_neighbour_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def get_neighbour_list(positions: tf.Tensor, cell=None, batch_size=None) -> tf.Tensor:
              """
              Generate the neighbour list.
          
              Parameters
          Severity: Minor
          Found in mdsuite/utils/neighbour_list.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

          Function get_computation_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def get_computation_data(self) -> db.Computation:
                  """Query the database for computation data.
          
                  This method used the self.args dataclass to look for matching
                  calculator attributes and returns a db.Computation object if
          Severity: Minor
          Found in mdsuite/database/calculator_database.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

          Function save_db_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def save_db_data(self):
                  """Save all the collected computationattributes and computation data to the
                  database.
          
                  This will be run after the computation was successful.
          Severity: Minor
          Found in mdsuite/database/calculator_database.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

          Function run_calculator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def run_calculator(self):
                  """Perform the distinct coefficient analysis analysis."""
                  self.check_input()
                  for combination in self.combinations:
                      species_values = list(combination)
          Severity: Minor
          Found in mdsuite/calculators/einstein_distinct_diffusion_coefficients.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

          Function _compute_atomwise_minibatch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def _compute_atomwise_minibatch(self, data_range: int):
                  """
                  Compute the number of atoms which can be loaded in at one time.
          
                  Parameters
          Severity: Minor
          Found in mdsuite/memory_management/memory_manager.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

          Function molecules has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def molecules(self, value):
                  """Save the molecules dict to the database."""
                  if value is None:
                      return
          
          
          Severity: Minor
          Found in mdsuite/database/experiment_database.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

          Function _prepare_database_entry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def _prepare_database_entry(self, species: str, system_tensor=False):
                  """
                  Add or extend the dataset in which the transformation result is stored.
          
                  Parameters
          Severity: Minor
          Found in mdsuite/transformations/transformations.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

          Function assertDeepAlmostEqual has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def assertDeepAlmostEqual(expected, actual, *args, **kwargs):
              """
              Assert that two complex structures have almost equal contents.
              Compares lists, dicts and tuples recursively. Checks numeric values
              using test_case's :py:meth:`unittest.TestCase.assertAlmostEqual` and
          Severity: Minor
          Found in mdsuite/utils/testing.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

          Severity
          Category
          Status
          Source
          Language