18F/State-TalentMAP-API

View on GitHub
talentmap_api/common/serializers.py

Summary

Maintainability
B
5 hrs
Test Coverage

Showing 3 of 3 total issues

Function prefetch_model has a Cognitive Complexity of 19 (exceeds 7 allowed). Consider refactoring.
Open

def prefetch_model(cls, model, queryset, prefix="", parent_method=None, visited=None):
'''
This method sets up prefetch and selected related statements when applicable
for foreign key relationships.
 
 
Severity: Minor
Found in talentmap_api/common/serializers.py - About 2 hrs to fix

Function __init__ has a Cognitive Complexity of 18 (exceeds 7 allowed). Consider refactoring.
Open

def __init__(self, *args, **kwargs):
override_fields = kwargs.pop("override_fields", [])
override_exclude = kwargs.pop("override_exclude", [])
 
# Initializer our parent serializer
Severity: Minor
Found in talentmap_api/common/serializers.py - About 2 hrs to fix

Function parse_child_overrides has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring.
Open

def parse_child_overrides(cls, override_fields, override_exclude, name, nested, child_kwargs):
'''
This method populates a dictionary object with appropriate cascaded child serializers
 
Args:
Severity: Minor
Found in talentmap_api/common/serializers.py - About 1 hr to fix

There are no issues that match your filters.

Category
Status