Showing 52 of 52 total issues
Avoid deeply nested control flow statements. Open
if instance.company in update_companies:
kwargs.update(
{ self.model._meta.default_id: instance.id })
#self.client = instance.client
#if not self.client:
Avoid deeply nested control flow statements. Open
if not isinstance(instance, Instance):
raise TypeError(
'The list must contain Key objects')
self.client = instance.client
Avoid deeply nested control flow statements. Open
if inst == obj:
obj_keys = obj.get_instances()
inst_keys = inst.get_instances()
obj_keys.extend(inst_keys)
found = True
Function _check_kwargs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _check_kwargs(self, method, **kwargs):
page = self.model._meta.page
params = self.model.client.get_service_params(method, page)
# Because elements are suds.sax.text.Text, convert them to str
- 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
Avoid deeply nested control flow statements. Open
if not super(NavQuerySet, self).delete(**tmp_dict):
success = False
if success:
Avoid deeply nested control flow statements. Open
if not super(NavQuerySet, self).delete(**kwargs):
success = False
except WebFault:
Function update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update(self, obj=None, **kwargs):
if obj:
if self.queryset:
for inst in self.queryset:
kwargs.update({self.model._meta.default_id:
- 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
Avoid deeply nested control flow statements. Open
for company in existing_companies:
if company in add_companies:
update_companies.append(company)
add_companies.pop(add_companies.index(company))
else:
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name=None, max_length=None, min_length=None,
Function __eq__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __eq__(self, other):
"""
Exam if two objects are equal
"""
for field in self._meta.get_field_names():
- 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_endpoints
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _set_endpoints(self, endpoints):
for endpoint in endpoints.keys():
if endpoints.get(endpoint):
setattr(self, endpoint, endpoints[endpoint]['method'])
- 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 filter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def filter(self, **kwargs):
index = 0
params = {}
filters = []
- 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"