18F/State-TalentMAP-API

View on GitHub
talentmap_api/organization/models.py

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 2 of 2 total issues

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

def update_relationships(self):
'''
Update the organization relationships, using the codes stored in the _parent fields.
'''
if self._parent_bureau_code:
Severity: Minor
Found in talentmap_api/organization/models.py - About 2 hrs to fix

Function update_relationships has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
Open

def update_relationships(self):
# Search for country based on location prefix
country = Country.objects.filter(location_prefix=self.code[:2])
if country.count() != 1:
# Try matching by name
Severity: Minor
Found in talentmap_api/organization/models.py - About 25 mins to fix
Category
Status