559Labs/django-dtg-store-manager

View on GitHub

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
Severity: Major
Found in src/business/models.py - About 3 days to fix

    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
    Severity: Major
    Found in src/business/views/all.py - About 3 days to fix

      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 *
      Severity: Minor
      Found in src/business/forms.py - About 7 hrs to fix

        File serializers.py has 458 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        from business import models
        
        from rest_framework import serializers
        
        
        
        Severity: Minor
        Found in src/business/serializers.py - About 7 hrs to fix

          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 *
          Severity: Minor
          Found in src/business/urls.py - About 6 hrs to fix

            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 *
            Severity: Minor
            Found in src/business/admin.py - About 5 hrs to fix

              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
              Severity: Minor
              Found in src/business/tables.py - About 3 hrs to fix

                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
                Severity: Minor
                Found in src/business/models.py - About 2 hrs to fix

                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.
                Severity: Minor
                Found in src/business/models.py - About 1 hr to fix

                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
                Severity: Minor
                Found in src/business/models.py - About 1 hr to fix

                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 + "-")
                Severity: Minor
                Found in src/business/models.py - About 55 mins to fix

                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
                Severity: Minor
                Found in src/business/models.py - About 45 mins to fix

                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"
                
                
                Severity: Minor
                Found in src/business/views/app_creative.py - About 25 mins to fix

                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()
                Severity: Minor
                Found in src/business/views/app_product.py - About 25 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language