Showing 10 of 79 total issues
Function createLineGraph
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
LineGraph.prototype.createLineGraph = function() {
var self = this;
var brandPrimary = self._option.color.primary;
var brandSecondary = self._option.color.secondary;
Function response_change
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def response_change(self, req: HttpRequest, obj):
if "_generate_receipt" in req.POST or \
"_mark_items_verified" in req.POST or \
"_mark_items_unverified" in req.POST:
obj.save()
- 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 ItemLocationController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function ItemLocationController(elementId, keyName, valueName, startDate, endDate, graphOption) {
Function ItemStatusController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function ItemStatusController(elementId, keyName, valueName, startDate, endDate, graphOption) {
Function poll_state
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def poll_state(request: HttpRequest):
"""A view to report the progress to the user"""
task_id = request.POST.get("task_id", None)
if task_id is None:
return _error(
- 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_receipt_policy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def generate_receipt_policy(self, req, qs):
err = None
if not req.user.has_perm('app.generate_tax_receipt'):
err = PERMISSION_DENIED
elif not all([d.is_items_received() for d in qs]):
- 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 too many return
statements within this function. Open
return queryset.filter(donate_date=None)
Avoid too many return
statements within this function. Open
return super().response_change(req, obj)
Avoid too many return
statements within this function. Open
return queryset
Function __call__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self):
update_percent(0)
# Note: SMTP may fail due to Gmail security policy. Check credentials
# and settings
if self.shouldSendCopy:
- 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"