mordred-descriptor/mordred

View on GitHub

Showing 64 of 136 total issues

Avoid too many return statements within this function.
Open

                return self.C[jc] + lsp[ic]
Severity: Major
Found in mordred/DetourMatrix.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return 9.81
    Severity: Major
    Found in mordred/TopoPSA.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return self._calc()
      Severity: Major
      Found in mordred/AtomCount.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return 0.0
        Severity: Major
        Found in mordred/TopoPSA.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              return 8.38
          Severity: Major
          Found in mordred/TopoPSA.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return np.log(An.sum() + 1)
            Severity: Major
            Found in mordred/WalkCount.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                  return 25.30
              Severity: Major
              Found in mordred/TopoPSA.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return 19.21
                Severity: Major
                Found in mordred/TopoPSA.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return rdMolDescriptors.CalcNumHeteroatoms(self.mol)
                  Severity: Major
                  Found in mordred/AtomCount.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                        return 32.09
                    Severity: Major
                    Found in mordred/TopoPSA.py - About 30 mins to fix

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

                          def _serial(self, mols, nmols, quiet, ipynb, id):
                              with self._progress(quiet, nmols, ipynb) as bar:
                                  for m in mols:
                                      with Capture() as capture:
                                          r = self._wrap_result(
                      Severity: Minor
                      Found in mordred/_base/calculator.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 _import_all_descriptors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def _import_all_descriptors():
                          import os
                          from importlib import import_module
                          from .._base.descriptor import is_descriptor_class
                      
                      
                      Severity: Minor
                      Found in mordred/descriptors/__init__.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 calculate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def calculate(self):
                              chain = []
                              path = []
                              path_cluster = []
                              cluster = []
                      Severity: Minor
                      Found in mordred/Chi.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_descriptors_from_module has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def get_descriptors_from_module(mdl, submodule=False):
                          r"""[DEPRECATED] Get descriptors from module.
                      
                          Parameters:
                              mdl(module): module to search
                      Severity: Minor
                      Found in mordred/_base/calculator.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 parallel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def parallel(calc, mols, nproc, nmols, quiet, ipynb, id):
                          with MolPool(calc, nproc) as pool, calc._progress(quiet, nmols, ipynb) as bar:
                              for mol, (r, err) in pool.map(mols, id):
                                  for e in err:
                                      e = e.rstrip()
                      Severity: Minor
                      Found in mordred/_base/parallel.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 description has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def description(self):
                              if self._type == "any":
                                  t = ""
                              elif self._type == "X":
                                  t = " on halogen atoms"
                      Severity: Minor
                      Found in mordred/MolecularId.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __init__(self, type="any", averaged=False, _eps=1e-10):
                              self._orig_type = self._type = type
                              self._averaged = averaged
                              self._eps = _eps
                      
                      
                      Severity: Minor
                      Found in mordred/MolecularId.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 _search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _search(self, u):
                              if self.timeout_at < time.time():
                                  raise Timeout()
                      
                              self.visited.add(u)
                      Severity: Minor
                      Found in mordred/DetourMatrix.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 calculate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def calculate(self):
                              if self._type == "X":
                                  return self._calc_X()
                              elif self._type in ["Atom", "HeavyAtom"]:
                                  return self._calc_all()
                      Severity: Minor
                      Found in mordred/AtomCount.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 _dfs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _dfs(self, u):
                              neighbors = self.neighbors[u]
                              self.visited.add(u)
                              self.degrees.add(len(neighbors))
                      
                      
                      Severity: Minor
                      Found in mordred/Chi.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