Showing 14 of 302 total issues
File models.py
has 1462 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.conf import settings
from fractions import Fraction
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
File all.py
has 1307 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render
File forms.py
has 487 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import unicode_literals
from django import forms
from crispy_forms.helper import *
from crispy_forms.layout import *
from crispy_forms.bootstrap import *
File serializers.py
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
from business import models
from rest_framework import serializers
File urls.py
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.conf.urls import url, include
from rest_framework import routers
from business import api
from business.views import *
from business.wizards.bzProductCreate import *
File admin.py
has 414 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django import forms
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from .models import *
from .forms import *
File tables.py
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
import django_tables2 as tables
from .models import *
from django_tables2.utils import A
from django.utils.translation import ugettext_lazy as _
from django.contrib.humanize.templatetags.humanize import naturaltime
Function api_pull
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def api_pull(store=None, key=None):
"""
Update the product objects from the Printful API.
:param store: Optional bzStore object. If not provided, method will
- 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 api_pull
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def api_pull(store=None):
"""
Update the file list from your Printful store.
:param store: pfStore object.
- 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 asHTML
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def asHTML(self):
"""
Returns an HTML div, formatted in a 'standard' way:
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
Function __str__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self):
rv = []
if self.bzcreativecollection:
if self.bzcreativecollection.code:
rv.append(self.bzcreativecollection.code + "-")
- 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 api_pull
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def api_pull(store=None, key=None):
"""
Update the Country and State objects from the Printful API.
:param store: Optional bzStore object. If not provided, method will
- 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_context_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_context_data(self, **kwargs):
context = super(appCreativeHome, self).get_context_data(**kwargs)
context['active_app'] = "creative"
context['active_apptitle'] = "Creative Management"
- 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_context_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_context_data(self, **kwargs):
context = super(appProductHome, self).get_context_data(**kwargs)
context['active_app'] = "product"
context['active_apptitle'] = "Product Catalog"
context['products'] = bzProduct.objects.all()
- 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"