Showing 10 of 161 total issues
File base_core_profile.py
has 595 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from datetime import datetime
from decimal import Decimal
from pytz import utc
import swapper
File core_profile.py
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import swapper
from django.forms import model_to_dict
from pytz import utc
from datetime import (
datetime,
File __init__.py
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from .base_allocator import BaseAllocator
from .base_application import (
APPLICATION_STATUSES,
BaseApplication,
COMPLETE_APP_STATUS,
File __init__.py
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from simpleuser.models import User
from .allocator import Allocator
from .startup_role import StartupRole
from .user_role import UserRole
User
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class User(AbstractUser):
# Override the parent email field to add uniqueness constraint
email = models.EmailField(blank=True, unique=True)
objects = UserManager()
BaseCoreProfile
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class BaseCoreProfile(AcceleratorModel):
user = models.OneToOneField(settings.AUTH_USER_MODEL,
on_delete=models.CASCADE)
gender_identity = models.ManyToManyField(
swapper.get_model_name(
File base_judging_round.py
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import unicode_literals
import swapper
from django.db.models import (
BooleanField,
Function clean_organization_twitter_handles
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
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)
- 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 has_user_role_base
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def has_user_role_base(
Function _create_user
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _create_user(self, email, password,