Showing 19 of 527 total issues
File _decorators.py
has 521 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
import os.path
import sys
import subprocess
Function copy_to_residues
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def copy_to_residues(pin, pout, rcf, rf, pcf, pf, acf, af, ccf, cf, bf, prev):
if rcf.get_is(pin):
rpin = rcf.get(pin)
rpout = rf.get(pout)
rpout.set_residue_type(rpin.get_residue_type())
- 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 mkdir
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def mkdir(path, clean=True):
if os.path.isdir(path):
if clean:
# remove any old links
for f in glob.glob(os.path.join(path, "*")):
- 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 _create_atoms
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _create_atoms(helper, mydata, model, cgol, created):
child = False
for ch in helper.get_children():
if _create_atoms(ch, mydata, model, cgol, created):
child = True
- 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 copy_to_residues
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def copy_to_residues(pin, pout, rcf, rf, pcf, pf, acf, af, ccf, cf, bf, prev):
Function _do_it
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _do_it(path):
fh = RMF.open_rmf_file_read_only(path)
mf = RMF.Molecule(fh)
cf = RMF.ChainFactory(fh)
- 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 visit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def visit(node, reference_frame, reference_frame_factory, particle_factory,
Function _create_molecules
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _create_molecules(n, mf, cf, mydata, resolution, created):
if mf.get_is(n) or cf.get_is(n):
_create_molecule(n, mydata, resolution, created)
elif n.get_type() == RMF.BOND and mydata.bond_factory.get_is(n):
_handle_bond(n, created, mydata)
- 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 _handle_atom_coords
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _handle_atom_coords(helper, mydata, model, cgol, pd, at):
Function _create_molecules
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _create_molecules(n, mf, cf, mydata, resolution, created):
Function visit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def visit(node, reference_frame, reference_frame_factory, particle_factory,
segment_factory, ball_factory):
if reference_frame_factory.get_is(node):
reference_frame = RMF.CoordinateTransformer(
reference_frame, reference_frame_factory.get(node))
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, allowed_types, category, name,
Function _handle_atom_element
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _handle_atom_element(helper, mydata, model, cgol, at):
Function _create_atoms
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _create_atoms(helper, mydata, model, cgol, created):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name, data_type, return_type, begin, end):
Function show_data_xml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def show_data_xml(nh, kc):
rh = nh.get_file()
# get all the keys, we could pull this up in the call stack
keys = rh.get_keys(kc)
opened = False
- 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 clean_gcdas
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def clean_gcdas():
for dirpath, dirnames, filenames in os.walk('.'):
for f in filenames:
if f.endswith('.gcda'):
os.unlink(os.path.join(dirpath, f))
- 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 create_hierarchy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_hierarchy(radius):
root = f.add_node(str(radius), RMF.REPRESENTATION)
for i in frange(0., 8, radius):
for j in frange(0., 8, radius):
for k in frange(0., 8, radius):
- 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 __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, name, attribute_type, function_name=None,
default=None):
if attribute_type in ('String', 'Strings'):
self._check_string_name(name)
if not function_name:
- 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"