Showing 54 of 441 total issues
File test_user_group_fields.py
has 838 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytest
from swimlane import exceptions
@pytest.fixture(autouse=True, scope='module')
File test_records_bulk_adaptor.py
has 837 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytest
import pendulum
from swimlane import exceptions
from swimlane.core.bulk import Clear, Append, Remove
# bulk_create
File test_reporting_filters.py
has 673 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytest
import pendulum
@pytest.fixture(autouse=True, scope='module')
File test_text_fields.py
has 571 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytest
from swimlane import exceptions
# Not testing the followig field sub-types, because of no format limitations:
# - Telephone
Function _validate_item
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def _validate_item(self, item):
"""Validate char/word count"""
if not isinstance(item, six.string_types):
raise ValidationError(
self._record,
- 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
File record.py
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
from functools import total_ordering
import time
import pendulum
import six
File conftest.py
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytest
import json
import random
import string
import time
File test_helpers_adaptor.py
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytest
from swimlane import exceptions
# add_comment
# add_record_references
File client.py
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Core Swimlane client class"""
import logging
import jwt
Function __init__
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, swimlane, raw):
super(App, self).__init__(swimlane, raw)
self.acronym = self._raw['acronym']
self.name = self._raw['name']
- 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
File test_record_restriction_adaptor.py
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytest
from swimlane import exceptions
@pytest.fixture(autouse=True, scope='module')
File record.py
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
import six
from swimlane.core.bulk import Replace, _BulkModificationOperation
from swimlane.core.cache import check_cache
from swimlane.core.resolver import AppResolver
Record
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Record(APIResource):
"""A single Swimlane Record instance
Attributes:
id (str): Full Record ID
Function bulk_modify
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def bulk_modify(self, *filters_or_records, **kwargs):
"""Shortcut to bulk modify records
.. versionadded:: 2.17.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
File test_date_time_fields.py
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytest
import pendulum
from swimlane import exceptions
Function _evaluate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _evaluate(self):
"""Lazily retrieve and paginate report results and build Record instances from returned data"""
if self._elements:
for element in self._elements:
yield element
- 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 one_of_keyword_only
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def one_of_keyword_only(*valid_keywords):
"""Decorator to help make one-and-only-one keyword-only argument functions more reusable
Notes:
Decorated function should take 2 arguments, the first for the key, the second the value
- 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 _set
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _set(self, value):
# Force to appropriate Pendulum instance for consistency
if value is not None:
if self.input_type != self._type_interval:
if self.input_type == self._type_date:
- 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 findCreateApp
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def findCreateApp(self, defaultApp):
appId = ""
app = ""
refFieldData = None
try:
- 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 createRole
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def createRole(self, name=None, groups=None, users=None, sections=None):
if sections is None:
sections = ['Application', 'Report', 'Workspace',
'Dashboard', 'Applet', 'Settings']
globalPerms = self.swimlane_instance.request('get', 'global').json()
- 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"