zincware/MDSuite

View on GitHub

Showing 107 of 113 total issues

Function golden_section_search has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

def golden_section_search(
Severity: Major
Found in mdsuite/utils/meta_functions.py - About 1 hr to fix

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

        def __call__(
    Severity: Major
    Found in mdsuite/calculators/spatial_distribution_function.py - About 1 hr to fix

      Function add_experiment has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def add_experiment(
      Severity: Major
      Found in mdsuite/project/project.py - About 1 hr to fix

        Function golden_section_search has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        def golden_section_search(
            data: np.array,
            a: float,
            b: float,
            tol: float = 1e-5,
        Severity: Minor
        Found in mdsuite/utils/meta_functions.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 ensemble_generator has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def ensemble_generator(self, system: bool = False, glob_data: dict = None) -> tuple:
                """
                Build a generator for the ensemble loop.
        
                Parameters
        Severity: Minor
        Found in mdsuite/database/data_manager.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 _get_property_to_column_idx_dict has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        def _get_property_to_column_idx_dict(
            header: str, var_names: dict
        ) -> typing.Tuple[int, typing.Dict[str, typing.List[int]]]:
            """
            Get the property summary from the header data.
        Severity: Minor
        Found in mdsuite/file_io/extxyz_files.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 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __call__(
        Severity: Major
        Found in mdsuite/calculators/einstein_diffusion_coefficients.py - About 1 hr to fix

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

              def __call__(
          Severity: Major
          Found in mdsuite/calculators/green_kubo_self_diffusion_coefficients.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 extract_properties_from_header has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def extract_properties_from_header(
                header_property_names: list, database_correspondence_dict: dict
            ) -> dict:
                """
                Takes the property names from a file header, sees if there is a corresponding
            Severity: Minor
            Found in mdsuite/file_io/lammps_trajectory_files.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 _get_metadata has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def _get_metadata(self) -> TrajectoryMetadata:
                    """Get the necessary metadata out of chemfiles.
            
                    Trajectory and the first chemfiles.Frame
                    """
            Severity: Minor
            Found in mdsuite/file_io/chemfiles_read.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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Major
            Found in mdsuite/experiment/experiment.py - About 50 mins to fix

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

                  def __init__(
              Severity: Major
              Found in mdsuite/memory_management/memory_manager.py - About 50 mins to fix

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