File process.py
has 946 lines of code (exceeds 250 allowed). Consider refactoring. Open
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
Function transition
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def transition(self, activity, transitions):
if transitions:
definition = self.definition
for transition in transitions:
- 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 getValidOutgoingTransitions
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def getValidOutgoingTransitions(process, activity_definition, exception=False,
checker=None):
"""Return list of valid outgoing transitions from given activity_definition
in given process.
- 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 workItemFinished
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def workItemFinished(self, work_item, results=None):
try:
unused, app, formal, actual = entry = \
self.workitems.pop(work_item.id)
except KeyError:
- 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 evaluateInputs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def evaluateInputs(
process,
formal,
actual,
evaluator,
- 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 _start
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _start(self):
# Return an initial transition
activities = self.activities
- 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 getInitialDataFieldsValues
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def getInitialDataFieldsValues(datafields, evaluator, strict=True):
"""Form dictionary of initial datafields values."""
vals = {}
for _id, datafield in datafields.items():
val = 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 start
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def start(self, transition):
# Start the activity, if we've had enough incoming transitions
definition = self.definition
if definition.andJoinSetting:
- 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 start
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def start(self, *arguments):
if self.isStarted:
raise TypeError("Already started")
definition = self.definition
- 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, from_, to, condition=always_true, id=None,
Avoid deeply nested control flow statements. Open
if a.activity_definition_identifier == transition.to:
# we already have the activity -- use it
next = a
break
Avoid deeply nested control flow statements. Open
if a.process is not activity.process:
continue
if a.activity_definition_identifier == transition.to:
Function outputs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def outputs(self):
outputs = {}
evaluator = interfaces.IPythonExpressionEvaluator(self)
for parameter in self.definition.parameters:
if parameter.output:
- 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 evaluateInputs
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def evaluateInputs(
Function initSubflow
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initSubflow(self, subflow_pd_name, starter_activity_id,
Function digestDeadlineDefinition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def digestDeadlineDefinition(self, process, definition,
deadlineDef):
evaluator = interfaces.IPythonExpressionEvaluator(self.process)
if not deadlineDef.duration:
log.warning(
- 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 computeOutgoing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def computeOutgoing(self):
if self.explicit_outgoing:
transitions = dict([(t.id, t) for t in self.transition_outgoing])
self.outgoing = ()
for tid in self.explicit_outgoing:
- 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"