Showing 64 of 136 total issues
File ExtendedTopochemicalAtom.py
has 577 lines of code (exceeds 250 allowed). Consider refactoring. Open
r"""Extended Topochemical Atom(ETA) descriptor.
References
* :doi:`10.1021/ci0342066`
* :doi:`10.1016/j.jhazmat.2013.03.023`
File calculator.py
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import print_function
import sys
import warnings
from types import ModuleType
Function calculate
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def calculate(self):
new = Chem.RWMol(Chem.Mol())
ids = {}
for a in self.mol.GetAtoms():
if a.GetAtomicNum() == 1:
- Read upRead up
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
File descriptor.py
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
import inspect
import operator
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from distutils.version import StrictVersion
File CPSA.py
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
r"""charged partial surface area descriptor.
References
* :doi:`10.1021/ac00220a013`
Function get_descriptors_in_module
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get_descriptors_in_module(mdl, submodule=True):
r"""Get descriptors in module.
Parameters:
mdl(module): module to search
- Read upRead up
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 main_process
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def main_process(
input, parser, output, nproc, quiet, stream, descriptor, with3D, verbosity
):
mols = (m for i in input for m in parser(i))
- Read upRead up
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
Calculator
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Calculator(object):
r"""descriptor calculator.
Parameters:
descs: see Calculator.register() method
Descriptor
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Descriptor(six.with_metaclass(DescriptorMeta, object)):
r"""Abstract base class of descriptors.
Attributes:
mol(rdkit.Mol): target molecule
Function _get_sulfur_contrib
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _get_sulfur_contrib(cls, atom):
nH = cls._hydrogen_count(atom)
cnt = cls._bond_type_count(atom)
if atom.GetFormalCharge() != 0:
- Read upRead up
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
File _atomic_property.py
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import division
import os
import six
Function _calculate_one
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _calculate_one(self, cxt, desc, reset):
if desc in self._cache:
return self._cache[desc]
if reset:
- Read upRead up
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_query
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def from_query(cls, mol, require_3D, explicit_hydrogens, kekulizes, id, config):
if not isinstance(mol, Chem.Mol):
raise TypeError("{!r} is not rdkit.Chem.Mol instance".format(mol))
n_frags = len(Chem.GetMolFrags(mol))
- Read upRead up
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 merge
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def merge(self):
for i in range(1, len(self.Q) + 1):
ns, lsp = self.Q[-i]
common = ns & self.nodes
if len(common) == 0:
- Read upRead up
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 preset
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def preset(cls, version):
for fused in [False, True]:
for arom in [None, True, False]:
for hetero in [None, True]:
yield cls(None, False, fused, arom, hetero)
- Read upRead up
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 _register
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _register(self, desc, version, ignore_3D):
if not hasattr(desc, "__iter__"):
if is_descriptor_class(desc):
if desc.since > version:
return
- Read upRead up
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 _bond_ids_to_atom_ids
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _bond_ids_to_atom_ids(self, p):
it = iter(p)
try:
a0f, a0t = self._bonds[next(it)]
- Read upRead up
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 main_process
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def main_process(
Function calculate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def calculate(self):
L = 0
pi = 0
self._gen_bonds()
- Read upRead up
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 _code
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _code(self, tree, before, trail):
if len(tree) == 0:
yield trail
else:
- Read upRead up
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"