zincware/MDSuite

View on GitHub

Showing 107 of 113 total issues

Function _get_processor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def _get_processor(simulation_data):
    """Read in one file."""
    if isinstance(simulation_data, str) or isinstance(simulation_data, pathlib.Path):
        suffix = pathlib.Path(simulation_data).suffix
        if suffix == ".lammpstraj":
Severity: Minor
Found in mdsuite/experiment/experiment.py - About 45 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_number_of_atoms has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _compute_number_of_atoms(self, reference: dict):
        """
        Compute the number of atoms total in the selected set of species.

        Parameters
Severity: Minor
Found in mdsuite/calculators/angular_distribution_function.py - About 45 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 add_dataset has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def add_dataset(self, architecture: dict):
        """
        Add a dataset of the necessary size to the database_path.

        Just as a separate method exists for building the group structure of the hdf5
Severity: Minor
Found in mdsuite/database/simulation_database.py - About 45 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 __call__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

    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
    Severity: Minor
    Found in mdsuite/utils/meta_functions.py - About 45 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

    Consider simplifying this complex logical expression.
    Open

            if (
                box[0] == 0
                and box[1] == 0
                or box[0] == 0
                and box[2] == 0
    Severity: Major
    Found in mdsuite/utils/meta_functions.py - About 40 mins to fix

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

          def load_data(
      Severity: Minor
      Found in mdsuite/database/simulation_database.py - About 35 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 get2dHistogram has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def get2dHistogram(x, y, value_range, nbins=100, dtype=tf.dtypes.int32):
          Severity: Minor
          Found in mdsuite/utils/linalg.py - About 35 mins to fix

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

            def optimize_batch_size(
            Severity: Minor
            Found in mdsuite/utils/meta_functions.py - About 35 mins to fix

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

              def get_triplets(
              Severity: Minor
              Found in mdsuite/utils/neighbour_list.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_ionic_conductivity.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/potential_of_mean_force.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/green_kubo_ionic_conductivity.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/green_kubo_viscosity_flux.py - About 35 mins to fix

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

                            def batch_generator(  # noqa: C901
                        Severity: Minor
                        Found in mdsuite/database/data_manager.py - About 35 mins to fix

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

                              def __init__(
                          Severity: Minor
                          Found in mdsuite/file_io/lammps_flux_files.py - About 35 mins to fix

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

                                def __init__(
                            Severity: Minor
                            Found in mdsuite/utils/report_computer_characteristics.py - About 35 mins to fix

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

                                  def load_matrix(
                              Severity: Minor
                              Found in mdsuite/experiment/experiment.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/green_kubo_thermal_conductivity.py - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language