Showing 64 of 136 total issues
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 _get_phosphorus_contrib
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _get_phosphorus_contrib(cls, atom):
nH = cls._hydrogen_count(atom)
cnt = cls._bond_type_count(atom)
if atom.GetFormalCharge() != 0 or atom.GetIsAromatic():
- 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_json
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _from_json(obj, descs):
name = obj.get("name")
args = obj.get("args") or {}
if name is None:
raise ValueError("invalid json: {}".format(obj))
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def main(out):
wb = Workbook()
ws = wb.active
ws.title = "descriptors"
- 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 parallel
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def parallel(calc, mols, nproc, nmols, quiet, ipynb, id):
Function doi_role
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def doi_role(name, rawtext, text, lineno, inliner, options={}, context=[]):
Function pandas
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def pandas(self, mols, nproc=None, nmols=None, quiet=False, ipynb=False, id=-1):
Function description
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def description(self):
if self._order is None:
o = ""
elif self._greater:
o = "{}-or-greater-membered ".format(self._order)
- 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 map
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def map(self, mols, nproc=None, nmols=None, quiet=False, ipynb=False, id=-1):
Function from_query
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def from_query(cls, mol, require_3D, explicit_hydrogens, kekulizes, id, config):
Function autodoc_process_docstring
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def autodoc_process_docstring(app, what, name, obj, options, lines):
Function _serial
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _serial(self, mols, nmols, quiet, ipynb, id):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, mols, coords, n_frags, name, config):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __str__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self):
attrs = []
if self._greater:
attrs.append("G")
- 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 __new__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __new__(cls, classname, bases, dict):
__init__ = dict.get("__init__")
if __init__ is None:
for base in bases:
__init__ = getattr(base, "__init__", None)
- 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 calculate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def calculate(self, P, chi=None):
if self._order <= 0:
chi = ChiBonds([], [{a.GetIdx()} for a in self.mol.GetAtoms()], [], [])
x = 0.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 __call__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self):
timeout_at = None if self.timeout is None else time.time() + self.timeout
for bcc in networkx.biconnected_component_subgraphs(self.G, False):
lsp = LongestSimplePath(bcc, self.weight, timeout_at)()
- 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 calculate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def calculate(self, An=None, T=None, W=None):
if self._total:
if self._order == 1:
return self.mol.GetNumAtoms() + W
- 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
Avoid too many return
statements within this function. Open
return np.log(An.sum() + 1)