Shoobx/shoobx.wfmc

View on GitHub
src/shoobx/wfmc/process.py

Summary

Maintainability
F
4 days
Test Coverage

File process.py has 946 lines of code (exceeds 250 allowed). Consider refactoring.
Open

##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
Severity: Major
Found in src/shoobx/wfmc/process.py - About 2 days to fix

    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:
    Severity: Minor
    Found in src/shoobx/wfmc/process.py - About 3 hrs to fix

    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.
    
    
    Severity: Minor
    Found in src/shoobx/wfmc/process.py - About 2 hrs to fix

    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:
    Severity: Minor
    Found in src/shoobx/wfmc/process.py - About 1 hr to fix

    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,
    Severity: Minor
    Found in src/shoobx/wfmc/process.py - About 1 hr to fix

    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
    
    
    Severity: Minor
    Found in src/shoobx/wfmc/process.py - About 1 hr to fix

    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
    Severity: Minor
    Found in src/shoobx/wfmc/process.py - About 1 hr to fix

    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:
    Severity: Minor
    Found in src/shoobx/wfmc/process.py - About 55 mins to fix

    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
    Severity: Minor
    Found in src/shoobx/wfmc/process.py - About 55 mins to fix

    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,
    Severity: Minor
    Found in src/shoobx/wfmc/process.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if a.activity_definition_identifier == transition.to:
                                  # we already have the activity -- use it
                                  next = a
                                  break
      
      
      Severity: Major
      Found in src/shoobx/wfmc/process.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if a.process is not activity.process:
                                    continue
                                if a.activity_definition_identifier == transition.to:
        Severity: Major
        Found in src/shoobx/wfmc/process.py - About 45 mins to fix

          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:
          Severity: Minor
          Found in src/shoobx/wfmc/process.py - About 45 mins to fix

          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(
          Severity: Minor
          Found in src/shoobx/wfmc/process.py - About 35 mins to fix

            Function initSubflow has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def initSubflow(self, subflow_pd_name, starter_activity_id,
            Severity: Minor
            Found in src/shoobx/wfmc/process.py - About 35 mins to fix

              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(
              Severity: Minor
              Found in src/shoobx/wfmc/process.py - About 35 mins to fix

              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:
              Severity: Minor
              Found in src/shoobx/wfmc/process.py - About 35 mins to fix

              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

              There are no issues that match your filters.

              Category
              Status