Showing 51 of 132 total issues
Function remove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def remove(self, group, target):
"""Remove target value by ID or instance from group"""
target_values = dict((target_value.id, target_value)
for target_value in group)
if isinstance(target, list):
- 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 _detect_auth_method
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _detect_auth_method(username, password, session_id,
Function fetch_resource_owner_password_token
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def fetch_resource_owner_password_token(self, username, password,
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, body):
self.status_code = False
try:
parsed_data = json.loads(body)
except ValueError as e:
- 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 new
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def new(self, collection, report=None, properties=None, version=None, *args, **kwargs):
Function add_metaclass
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_metaclass(metaclass):
"""Class decorator for creating a class with a metaclass."""
def wrapper(cls):
orig_vars = cls.__dict__.copy()
slots = orig_vars.get('__slots__')
- 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 find
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find(self, collection, variable, operator, candidates, **kwargs):
Function _return_class
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _return_class(self, ent_dict,
Function _gen_classes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _gen_classes(self, entities, child, child_id, entity_id, collection):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, session, report=None, properties=None, version=None, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get(self, as_dict=False):
"""Get report data. Returns tuple (headers, csv.Reader).
If as_dict == True, return (headers, csv.DictReader).
"""
- 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 _generate_save_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _generate_save_data(self, data=None):
if data is None:
data = self._properties.copy()
data.pop('organization', None)
data.pop('agency', 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 int_or_none
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def int_or_none(value, null_on_none=False):
if value is not None:
if not isinstance(value, int):
raise TypeError('must supply int')
return 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 save
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def save(self, data=None, url=None):
"""Save object to T1 while accounting for old fields"""
if data is None:
data = self._properties.copy()
- 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 save
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def save(self, data=None, url=None):
"""Extra validation for data pixels
:param data: dict optional data to use instead of self
:return: None. Object is updated or error is raised
- 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 generate_pmpd_tag
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def generate_pmpd_tag(tag_type, placement_slot, publisher_site, publisher):
"""Generate PMP-D tag from already-created values.
:param tag_type: enum{'iframe', 'js', 'js/iframe'} type of tag
:param placement_slot: PlacementSlot instance
- 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 dictify_permission
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def dictify_permission(entity):
"""Turn XML permission into a dictionary"""
if not entity:
return
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 _get_all
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_all(self, collection, **kwargs):
"""Construct iterator to get all entities in a collection.
Pages over 100 entities.
This method should not be called directly: it's called from T1.get.
- 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"