mordred-descriptor/mordred

View on GitHub

Showing 64 of 136 total issues

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

def get_all_descriptors():
    v = StrictVersion(__version__)
    for mdl in descriptors.all:
        ds = []
        for Desc in get_descriptors_in_module(mdl, submodule=False):
Severity: Minor
Found in docs/scripts/gen_default_descs.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):
        N = self.mol.GetNumAtoms()

        mat = 0.001 * np.ones((N, N))

Severity: Minor
Found in mordred/BCUT.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