Showing 227 of 702 total issues
File settings.py
has 983 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Django settings for concrexit.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
- Create a ticketCreate a ticket
Function handle
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
Open
def handle(self, *args, **options):
username = options[self.UserModel.USERNAME_FIELD]
database = options["database"]
user_data = {}
verbose_field_name = self.username_field.verbose_name
- Read upRead up
- Create a ticketCreate a ticket
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
File admin.py
has 643 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Registers admin interfaces for the payments module."""
import csv
from collections import OrderedDict
from django.contrib import admin, messages
- Create a ticketCreate a ticket
File test_admin_views.py
has 621 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from unittest import mock
from unittest.mock import MagicMock, Mock, PropertyMock, patch
from django.apps import apps
from django.contrib.admin.utils import model_ngettext
- Create a ticketCreate a ticket
File test_views.py
has 615 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from unittest import mock
from unittest.mock import ANY, MagicMock, Mock, PropertyMock, patch
from django.apps import apps
from django.contrib.auth import get_user_model
- Create a ticketCreate a ticket
File test_admin.py
has 572 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from django.contrib.admin import AdminSite
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.test import Client, RequestFactory, TestCase
from django.urls import reverse
- Create a ticketCreate a ticket
File test_views.py
has 527 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import datetime
from django.conf import settings
from django.contrib.auth.models import Permission
from django.core import mail
- Create a ticketCreate a ticket
File test_services.py
has 523 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from django.core import mail
from django.test import TestCase, override_settings
from django.utils import timezone
from freezegun import freeze_time
- Create a ticketCreate a ticket
Function clean
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
Open
def clean(self):
super().clean()
errors = {}
if self.start is None:
errors.update({"start": _("Start cannot have an empty date or time field")})
- Read upRead up
- Create a ticketCreate a ticket
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
File test_api.py
has 476 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import datetime
from django.test import TestCase, override_settings
from django.urls import reverse
from django.utils import timezone
- Create a ticketCreate a ticket
File test_services.py
has 476 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from random import randint
from unittest import mock
from django.test import TestCase, override_settings
from django.utils import timezone
- Create a ticketCreate a ticket
File test_models.py
has 476 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import datetime
from decimal import Decimal
from unittest.mock import PropertyMock, patch
from django.core.exceptions import ValidationError
- Create a ticketCreate a ticket
File services.py
has 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
from django.conf import settings
from django.contrib.admin.utils import model_ngettext
from django.contrib.contenttypes.models import ContentType
- Create a ticketCreate a ticket
File models.py
has 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""The models defined by the registrations package."""
import string
import unicodedata
import uuid
- Create a ticketCreate a ticket
File services.py
has 447 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from collections import OrderedDict
from datetime import date, timedelta
from django.db.models import Q
from django.utils import timezone
- Create a ticketCreate a ticket
File test_services.py
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from datetime import datetime, timedelta
from unittest import mock
from django.contrib.auth.models import AnonymousUser, Permission
from django.http import HttpRequest
- Create a ticketCreate a ticket
File test_models.py
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.test import TestCase, override_settings
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
- Create a ticketCreate a ticket
File test_models.py
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from unittest.mock import MagicMock
from django.core.exceptions import ValidationError
from django.test import TestCase
from django.utils import timezone
- Create a ticketCreate a ticket
File gsuite.py
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""GSuite syncing helpers defined by the mailinglists package."""
import logging
from random import random
from time import sleep
- Create a ticketCreate a ticket
File test_gsuite.py
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Test for the GSuite sync in the mailinglists package."""
from unittest import mock
from unittest.mock import MagicMock
from django.conf import settings
- Create a ticketCreate a ticket