Terralego/django-terra-accounts

View on GitHub

Showing 6 of 7 total issues

Cyclomatic complexity is too high in method get_ordering. (10)
Open

def get_ordering(self, request, queryset, view):
ordering = super().get_ordering(request, queryset, view)
 
if not ordering:
ordering = []
Severity: Minor
Found in terra_accounts/filters.py by radon

Cyclomatic complexity is too high in class JSONFieldOrderingFilter. (10)
Open

class JSONFieldOrderingFilter(OrderingFilter):
def get_ordering(self, request, queryset, view):
ordering = super().get_ordering(request, queryset, view)
 
if not ordering:
Severity: Minor
Found in terra_accounts/filters.py by radon

Function get_ordering has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def get_ordering(self, request, queryset, view):
ordering = super().get_ordering(request, queryset, view)
 
if not ordering:
ordering = []
Severity: Minor
Found in terra_accounts/filters.py - About 1 hr to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def create_user(self, email, password, **extra_fields):
extra_fields.setdefault('is_staff', False)
extra_fields.setdefault('is_superuser', False)
return self._create_user(email, password, **extra_fields)
Severity: Major
Found in terra_accounts/managers.py and 1 other location - About 1 hr to fix
terra_accounts/managers.py on lines 21..25

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def create_superuser(self, email, password, **extra_fields):
extra_fields.setdefault('is_staff', True)
extra_fields.setdefault('is_superuser', True)
 
return self._create_user(email, password, **extra_fields)
Severity: Major
Found in terra_accounts/managers.py and 1 other location - About 1 hr to fix
terra_accounts/managers.py on lines 16..19

Use of RawSQL potential SQL attack vector.
Open

OrderBy(RawSQL('lower({})'.format(tpl), json_nested),
Severity: Minor
Found in terra_accounts/filters.py by bandit
Severity
Category
Status
Source
Language