bjmorgan/kinisi

View on GitHub

Showing 42 of 42 total issues

Avoid deeply nested control flow statements.
Open

                    if isinstance(value, h5py._hl.dataset.Dataset):
                        if isinstance(value[()], (str, bytes)):
                            if value[()] == b'NULL':
                                my_dict[key].append(None)
                            else:
Severity: Major
Found in kinisi/analyzer.py - About 45 mins to fix

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

        def from_universe(cls,
    Severity: Minor
    Found in kinisi/conductivity_analyzer.py - About 35 mins to fix

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

          def sample_until_normal(array: np.ndarray,
      Severity: Minor
      Found in kinisi/diffusion.py - About 35 mins to fix

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

            def from_file(cls,
        Severity: Minor
        Found in kinisi/conductivity_analyzer.py - About 35 mins to fix

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

          def _get_molecules(structure: "ase.atoms.Atoms" or "pymatgen.core.structure.Structure"
          Severity: Minor
          Found in kinisi/parser.py - About 35 mins to fix

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

                def from_pymatgen(cls,
            Severity: Minor
            Found in kinisi/conductivity_analyzer.py - About 35 mins to fix

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

                  def from_ase(cls,
              Severity: Minor
              Found in kinisi/conductivity_analyzer.py - About 35 mins to fix

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

                    def __init__(self,
                Severity: Minor
                Found in kinisi/diffusion.py - About 35 mins to fix

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

                      def from_Xdatcar(cls,
                  Severity: Minor
                  Found in kinisi/conductivity_analyzer.py - About 35 mins to fix

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

                        def _from_file(cls, trajectory: Union[str, List[str]], parser_params: dict, dtype: str = None, **kwargs):
                            """
                            Create a :py:class:`Analyzer` object from a single or a list of Xdatcar file(s).
                    
                            :param trajectory: The file or list of Xdatcar files to be analysed.
                    Severity: Minor
                    Found in kinisi/analyzer.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_indices has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def get_indices(structure: "MDAnalysis.universe.Universe", specie: str,
                                        framework_indices: List[int]) -> Tuple[np.ndarray, np.ndarray]:
                            """
                            Determine framework and non-framework indices for an :py:mod:`MDAnalysis` compatible file.
                    
                    
                    Severity: Minor
                    Found in kinisi/parser.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_indices has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def get_indices(structure: "ase.atoms.Atoms", specie: "str",
                                        framework_indices: List[int]) -> Tuple[np.ndarray, np.ndarray]:
                            """
                            Determine framework and non-framework indices for a :py:mod:`ase` compatible file.
                    
                    
                    Severity: Minor
                    Found in kinisi/parser.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 bootstrap_GLS has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def bootstrap_GLS(self,
                                          start_dt: float,
                                          cond_max: float = 1e16,
                                          model: bool = False,
                                          fit_intercept: bool = True,
                    Severity: Minor
                    Found in kinisi/diffusion.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_indices has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def get_indices(structure: "pymatgen.core.structure.Structure",
                                        specie: Union["pymatgen.core.periodic_table.Element", "pymatgen.core.periodic_table.Specie",
                                                      "pymatgen.core.periodic_table.Species", List["pymatgen.core.periodic_table.Element"],
                                                      List["pymatgen.core.periodic_table.Specie"],
                                                      List["pymatgen.core.periodic_table.Species"]],
                    Severity: Minor
                    Found in kinisi/parser.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 _from_pymatgen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _from_pymatgen(cls,
                                           trajectory: List[Union['pymatgen.core.structure.Structure',
                                                                  List['pymatgen.core.structure.Structure']]],
                                           parser_params: dict,
                                           dtype: str = None,
                    Severity: Minor
                    Found in kinisi/analyzer.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 _from_ase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _from_ase(cls,
                                      trajectory: List[Union['ase.atoms.Atoms', List['ase.atoms.Atoms']]],
                                      parser_params: dict,
                                      dtype: str = None,
                                      **kwargs):
                    Severity: Minor
                    Found in kinisi/analyzer.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 to_dict has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def to_dict(self) -> dict:
                            """
                            :return: Dictionary description of the :py:class:`Bootstrap`.
                            """
                            my_dict = {
                    Severity: Minor
                    Found in kinisi/diffusion.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 from_dict has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def from_dict(cls, my_dict: dict) -> 'Bootstrap':
                            """
                            Generate a :py:class:`Bootstrap` object from a dictionary.
                    
                            :param my_dict: The input dictionary.
                    Severity: Minor
                    Found in kinisi/diffusion.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 _from_Xdatcar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _from_Xdatcar(cls,
                                          trajectory: Union['pymatgen.io.vasp.outputs.Xdatcar', List['pymatgen.io.vasp.outputs.Xdatcar']],
                                          parser_params: dict,
                                          dtype: str = None,
                                          **kwargs):
                    Severity: Minor
                    Found in kinisi/analyzer.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 _from_universe has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _from_universe(cls,
                                           trajectory: 'MDAnalysis.core.universe.Universe',
                                           parser_params: dict,
                                           dtype: str = None,
                                           **kwargs):
                    Severity: Minor
                    Found in kinisi/analyzer.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