Showing 49 of 74 total issues
Function make_edge_token
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_edge_token(_class1,ref1,attr1,_class2,ref2,attr2,action):
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name='', reactants=dict(), helpers=dict(), actions=[], factories=dict(),rate_prefix='', parameters = []):
Function duplicate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def duplicate(self,varmap={},include=None):
if include is None:
include = self.keys()
newnodes = dict()
- 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 collect_dependencies
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def collect_dependencies(self,deps):
if not isinstance(deps,list):
deps = [deps]
while len(deps)>0:
x = deps.pop(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
Avoid deeply nested control flow statements. Open
if getattr(term,'data','')=='multiply':
insert_this.append(Tree(data='divide',children=[]))
elif getattr(term,'data','')=='divide':
insert_this.append(Tree(data='multiply',children=[]))
else:
Avoid deeply nested control flow statements. Open
if getattr(term,'data','')=='add':
insert_this.append(Tree(data='subtract',children=[]))
elif getattr(term,'data','')=='subtract':
insert_this.append(Tree(data='add',children=[]))
else:
Function attach_actions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def attach_actions(self):
self.attach_removenode_method()
for attr,value in self.__class__.Meta.local_attributes.items():
if attr == 'id':
continue
- 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 function_call
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def function_call(self,args):
d,s = dict(args), ''
if 'function_name' in d and 'args' not in d:
d['args'] = ''
keys = sorted(d.keys())
- 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 pprint
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def pprint(self,nodes=None,channels=None):
s = []
if nodes is None:
nodes = self.get_nodes()
if channels is 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 add_node_variable
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_node_variable(self,name,default_value=None,executable=None,parameters={},caches={},subtype=None):
Function check_numeric_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_numeric_value(value,attr,_class,_min=None,_max=None):
Function add_node_pattern
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_node_pattern(self,pattern,cache=None,subtype='default',executables=[],caches={}):
Function visualize_node
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def visualize_node(node,idx,label,size=20,font={'size':20,'face':'arial'}):
Function add_channel_transform
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_channel_transform(self,source,target,datamap,actionmap,filter_data=lambda data: True):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,keywords,builtins,fn,code,deps):
Function cyclic_form
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cyclic_form(self,simple=False):
values, orbits = list(self.sources), []
while values:
orb = [values.pop(0)]
while values:
- 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 visualize_graph_container
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def visualize_graph_container(g,asdict=False):
nodes,edges = [],[]
for idx,node in g.iter_nodes():
classname = node.__class__.__name__
size = 20
- 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 orbits
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def orbits(self):
orbindex = index_dict(self.generators[0].sources)
for g in self.generators:
for cyc in g.cyclic_form():
if len(cyc) > 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
Function partition_until_edge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def partition_until_edge(labeling,group,examined=set(),partitions=[]):
# input: canonically labeled graph
# repeatedly partition with partition_canonical_form until you obtain single-edge graphs
# output: examined set of labels (hashed versions), successive partitions of the graph
CL1, CL2 = partition_canonical_form(labeling,group)
- 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 iter_edges
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def iter_edges(self):
visited = set()
for idx,node in self.iter_nodes():
for attr,node2 in node.iter_edges():
edge = Edge.create(idx,attr,node2.id,node.get_related_name(attr))
- 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"