Shoobx/shoobx.wfmc

View on GitHub

Showing 39 of 39 total issues

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

    XPDLHandler has 42 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class XPDLHandler(xml.sax.handler.ContentHandler):
    
        start_handlers = {}
        end_handlers = {}
        text = ''
    Severity: Minor
    Found in src/shoobx/wfmc/xpdl.py - About 5 hrs to fix

      File xpdl.py has 392 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      ##############################################################################
      #
      # Copyright (c) 2004 Zope Corporation and Contributors.
      # All Rights Reserved.
      #
      Severity: Minor
      Found in src/shoobx/wfmc/xpdl.py - About 5 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            def Lane(self, attrs):
                id = attrs[(None, 'Id')]
                name = attrs.get((None, 'Name'))
                lane = self.LaneDefinitionFactory(name)
                self.stack[-1].defineLanes(**{str(id): lane})
        Severity: Major
        Found in src/shoobx/wfmc/xpdl.py and 1 other location - About 4 hrs to fix
        src/shoobx/wfmc/xpdl.py on lines 252..257

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            def Participant(self, attrs):
                id = attrs[(None, 'Id')]
                name = attrs.get((None, 'Name'))
                participant = self.ParticipantFactory(name)
                self.stack[-1].defineParticipants(**{str(id): participant})
        Severity: Major
        Found in src/shoobx/wfmc/xpdl.py and 1 other location - About 4 hrs to fix
        src/shoobx/wfmc/xpdl.py on lines 243..248

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        File interfaces.py has 331 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        ##############################################################################
        #
        # Copyright (c) 2004 Zope Corporation and Contributors.
        # All Rights Reserved.
        #
        Severity: Minor
        Found in src/shoobx/wfmc/interfaces.py - About 3 hrs to fix

          File tests.py has 327 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ##############################################################################
          #
          # Copyright (c) 2004 Zope Corporation and Contributors.
          # All Rights Reserved.
          #
          Severity: Minor
          Found in src/shoobx/wfmc/tests.py - About 3 hrs 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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            def createParticipant(activity, process, performer):
                participant = component.queryAdapter(
                    activity, interfaces.IParticipant,
                    process.definition.id + '.' + performer)
            
            
            Severity: Major
            Found in src/shoobx/wfmc/adapter/integration.py and 1 other location - About 3 hrs to fix
            src/shoobx/wfmc/adapter/integration.py on lines 34..43

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 66.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            def createWorkItem(participant, process, activity, application):
            
                workitem = component.queryAdapter(
                    participant, interfaces.IWorkItem,
                    process.definition.id + '.' + application)
            Severity: Major
            Found in src/shoobx/wfmc/adapter/integration.py and 1 other location - About 3 hrs to fix
            src/shoobx/wfmc/adapter/integration.py on lines 22..31

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 66.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def Join(self, attrs):
                    Type = attrs.get((None, 'Type'))
                    if Type in ('AND', 'Parallel'):
                        self.stack[-1].andJoin(True)
            Severity: Major
            Found in src/shoobx/wfmc/xpdl.py and 1 other location - About 2 hrs to fix
            src/shoobx/wfmc/xpdl.py on lines 401..404

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 51.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def Split(self, attrs):
                    Type = attrs.get((None, 'Type'))
                    if Type in ('AND', 'Parallel'):
                        self.stack[-1].andSplit(True)
            Severity: Major
            Found in src/shoobx/wfmc/xpdl.py and 1 other location - About 2 hrs to fix
            src/shoobx/wfmc/xpdl.py on lines 394..397

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 51.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def StartEvent(self, attrs):
                    ad = self.stack[-1]
                    assert isinstance(ad, shoobx.wfmc.process.ActivityDefinition)
                    ad.event = interfaces.START_EVENT
            Severity: Major
            Found in src/shoobx/wfmc/xpdl.py and 1 other location - About 1 hr to fix
            src/shoobx/wfmc/xpdl.py on lines 356..359

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 43.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                def EndEvent(self, attrs):
                    ad = self.stack[-1]
                    assert isinstance(ad, shoobx.wfmc.process.ActivityDefinition)
                    ad.event = interfaces.END_EVENT
            Severity: Major
            Found in src/shoobx/wfmc/xpdl.py and 1 other location - About 1 hr to fix
            src/shoobx/wfmc/xpdl.py on lines 349..352

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 43.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            class IParameterDefinition(interface.Interface):
                """Parameter definition
                """
            
                name = interface.Attribute("Parameter name")
            Severity: Major
            Found in src/shoobx/wfmc/interfaces.py and 3 other locations - About 1 hr to fix
            src/shoobx/wfmc/interfaces.py on lines 361..369
            src/shoobx/wfmc/interfaces.py on lines 384..393
            src/shoobx/wfmc/interfaces.py on lines 396..404

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 42.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            class IPoolDefinition(interface.Interface):
                """Pool definition
                """
            
                name = interface.Attribute("Pool name")
            Severity: Major
            Found in src/shoobx/wfmc/interfaces.py and 3 other locations - About 1 hr to fix
            src/shoobx/wfmc/interfaces.py on lines 361..369
            src/shoobx/wfmc/interfaces.py on lines 373..381
            src/shoobx/wfmc/interfaces.py on lines 396..404

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 42.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            class ILaneDefinition(interface.Interface):
                """Lane definition
                """
            
                id = interface.Attribute("Lane id")
            Severity: Major
            Found in src/shoobx/wfmc/interfaces.py and 3 other locations - About 1 hr to fix
            src/shoobx/wfmc/interfaces.py on lines 361..369
            src/shoobx/wfmc/interfaces.py on lines 373..381
            src/shoobx/wfmc/interfaces.py on lines 384..393

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 42.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language