zincware/MDSuite

View on GitHub

Showing 113 of 113 total issues

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

    def resize_datasets(self, structure: dict):
        """
        Resize a dataset so more tensor_values can be added.

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

    def __init__(
        self,
        data_path: list = None,
        database: Database = None,
        parallel: bool = False,
Severity: Minor
Found in mdsuite/memory_management/memory_manager.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 _read_process_n_configurations has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _read_process_n_configurations(
        self,
        file,
        n_configs: int,
        n_header_lines: int = 0,
Severity: Minor
Found in mdsuite/file_io/tabular_text_files.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 construct_plot has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def construct_plot(
Severity: Minor
Found in mdsuite/visualizer/d2_data_visualization.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if workaround_time_in_axis_1:
                                database[dataset_name][:, start_index:stop_index, :] = (
                                    np.swapaxes(write_data, 0, 1)
                                )
                            else:
    Severity: Major
    Found in mdsuite/database/simulation_database.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if not isinstance(val, collections.abc.Iterable):
                                  val = [val]
                              val = tf.convert_to_tensor(val, dtype=self.dtype)
      Severity: Major
      Found in mdsuite/transformations/transformations.py - About 45 mins to fix

        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
                            Severity
                            Category
                            Status
                            Source
                            Language