masschallenge/django-accelerator

View on GitHub

Showing 10 of 161 total issues

File base_core_profile.py has 595 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from datetime import datetime
from decimal import Decimal
from pytz import utc

import swapper
Severity: Major
Found in accelerator_abstract/models/base_core_profile.py - About 1 day to fix

    File core_profile.py has 397 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import swapper
    from django.forms import model_to_dict
    from pytz import utc
    from datetime import (
        datetime,
    Severity: Minor
    Found in accelerator/models/core_profile.py - About 5 hrs to fix

      File __init__.py has 339 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      from .base_allocator import BaseAllocator
      from .base_application import (
          APPLICATION_STATUSES,
          BaseApplication,
          COMPLETE_APP_STATUS,
      Severity: Minor
      Found in accelerator_abstract/models/__init__.py - About 4 hrs to fix

        File __init__.py has 324 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        from simpleuser.models import User
        
        from .allocator import Allocator
        from .startup_role import StartupRole
        from .user_role import UserRole
        Severity: Minor
        Found in accelerator/models/__init__.py - About 3 hrs to fix

          User has 28 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class User(AbstractUser):
              # Override the parent email field to add uniqueness constraint
              email = models.EmailField(blank=True, unique=True)
          
              objects = UserManager()
          Severity: Minor
          Found in simpleuser/models.py - About 3 hrs to fix

            BaseCoreProfile has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class BaseCoreProfile(AcceleratorModel):
                user = models.OneToOneField(settings.AUTH_USER_MODEL,
                                            on_delete=models.CASCADE)
                gender_identity = models.ManyToManyField(
                    swapper.get_model_name(
            Severity: Minor
            Found in accelerator_abstract/models/base_core_profile.py - About 2 hrs to fix

              File base_judging_round.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              from __future__ import unicode_literals
              
              import swapper
              from django.db.models import (
                  BooleanField,
              Severity: Minor
              Found in accelerator_abstract/models/base_judging_round.py - About 2 hrs to fix

                Function clean_organization_twitter_handles has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                def clean_organization_twitter_handles(Organization):
                    remove_twitter_url_prefix_from_handles(Organization)
                    remove_not_available_abbreviation_from_twitter_handles(Organization)
                    remove_hashbang_from_twitter_handles(Organization)
                    remove_leading_hashtag_on_valid_twitter_handles(Organization)
                Severity: Minor
                Found in accelerator/twitter_handle_cleanup/organization_cleanup.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 has_user_role_base has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def has_user_role_base(
                Severity: Minor
                Found in accelerator_abstract/models/base_user_role.py - About 35 mins to fix

                  Function _create_user has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def _create_user(self, email, password,
                  Severity: Minor
                  Found in simpleuser/models.py - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language