src/django_keycloak/remote_user.py
KeycloakRemoteUser
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class KeycloakRemoteUser(object):
"""
A class based on django.contrib.auth.models.User.
See https://docs.djangoproject.com/en/2.0/ref/contrib/auth/
#django.contrib.auth.models.User
Function has_perm
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def has_perm(self, perm, obj=None):
"""
Logic from django.contrib.auth.models._user_has_perm
:param perm:
:param obj:
- 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_module_perms
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def has_module_perms(self, module):
"""
Logic from django.contrib.auth.models._user_has_module_perms
:param module:
:return:
- 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"