swimlane/swimlane-python

View on GitHub

Showing 54 of 441 total issues

Function patch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def patch(self):
        """Patch record on Swimlane server

        Raises
            ValueError: If record.is_new, or if comments or attachments are attempted to be patched
Severity: Minor
Found in swimlane/core/resources/record.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 _validate_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _validate_list(self, target):
        """Validate a list against field validation rules"""
        # Check list length restrictions
        min_items = self._field.field_definition.get('minItems')
        max_items = self._field.field_definition.get('maxItems')
Severity: Minor
Found in swimlane/core/fields/list.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 updateRefFieldNew has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def updateRefFieldNew(fieldsJSON, targetIds):
    if targetIds != None:
        targetApp = list(targetIds.keys())[0]
        for eachField in fieldsJSON:
            if ((eachField['fieldType'] == 8) or (eachField['fieldType'] == "reference")):
Severity: Minor
Found in functional_tests/conftest.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 _evaluate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _evaluate(self):
        """Lazily retrieve and build User instances from returned data"""
        if self._elements:
            for element in self._elements:
                yield element
Severity: Minor
Found in swimlane/core/resources/usergroup.py - About 25 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 add_restriction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def add_restriction(self, *usergroups):
        """Add UserGroup(s) to list of accounts with access to record

        .. versionadded:: 2.16.1

Severity: Minor
Found in swimlane/core/resources/record.py - About 25 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 validate_value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_value(self, value):
        super(NumberField, self).validate_value(value)

        if value is not None:
            if self.min is not None and value < self.min:
Severity: Minor
Found in swimlane/core/fields/number.py - About 25 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 set_python has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def set_python(self, value):
        """Set field internal value from the python representation of field value"""

        # json field handling
        if self.input_type == "json":
Severity: Minor
Found in swimlane/core/fields/text.py - About 25 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 waitOnJobByID has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def waitOnJobByID(self, jobId):
        sleepTime = 0
        while True:
            loggingStuff = self.swimlane_instance.helpers.check_bulk_job_status(
                jobId)
Severity: Minor
Found in functional_tests/conftest.py - About 25 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 request has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def request(self, method, api_endpoint, **kwargs):
        """Wrapper for underlying :class:`requests.Session`

        Handles generating full API URL, session reuse and auth, request defaults, and invalid response status codes

Severity: Minor
Found in swimlane/core/client.py - About 25 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 _evaluate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _evaluate(self):
        """Scan for orphaned records and retrieve any records that have not already been grabbed"""
        retrieved_records = SortedDict()
        for record_id, record in six.iteritems(self._elements):
            if record is self._field._unset:
Severity: Minor
Found in swimlane/core/fields/reference.py - About 25 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 set_python has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def set_python(self, value):
        """Expect list of record instances, convert to a SortedDict for internal representation"""
        if not self.multiselect:
            if value and not isinstance(value, list):
                value = [value]
Severity: Minor
Found in swimlane/core/fields/reference.py - About 25 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 get_swimlane has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_swimlane(self):
        """Handle multi-select and single-select modes"""
        if self.multiselect:
            value = self._get()
            children = []
Severity: Minor
Found in swimlane/core/fields/base/multiselect.py - About 25 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 updateRefField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def updateRefField(fieldsJSON, targetIds):
    if targetIds != None:
        targetApp = list(targetIds.keys())[0]
        for eachField in fieldsJSON:
            if (eachField['FieldType'] == 8):
Severity: Minor
Found in functional_tests/conftest.py - About 25 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 bulk_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def bulk_delete(self, *filters_or_records):
        """Shortcut to bulk delete records
        
        .. versionadded:: 2.17.0
        
Severity: Minor
Found in swimlane/core/adapters/record.py - About 25 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

Severity
Category
Status
Source
Language