cnap-cobre/synapse

View on GitHub
backend/apps/user/api/views.py

Summary

Maintainability
A
55 mins
Test Coverage

Showing 4 of 4 total issues

Cyclomatic complexity is too high in method get_serializer_class. (6)
Open

def get_serializer_class(self):
"""
- Limit signup fields for anonymous
- Expose all fields to privileged users
- Limit signup fields for non-privileged users
Severity: Minor
Found in backend/apps/user/api/views.py by radon

Cyclomatic complexity is too high in method get_permissions. (6)
Open

def get_permissions(self):
"""
- Anyone can create a user and view available methods
- Updates require permission or ownership
- Retrieval requires authentication
Severity: Minor
Found in backend/apps/user/api/views.py by radon

Avoid too many return statements within this function.
Open

return basic.UserSerializer
Severity: Major
Found in backend/apps/user/api/views.py - About 30 mins to fix

    Function get_serializer_class has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_serializer_class(self):
    """
    - Limit signup fields for anonymous
    - Expose all fields to privileged users
    - Limit signup fields for non-privileged users
    Severity: Minor
    Found in backend/apps/user/api/views.py - About 25 mins to fix

    There are no issues that match your filters.

    Category
    Status