18F/State-TalentMAP-API

View on GitHub
talentmap_api/integrations/models.py

Summary

Maintainability
C
7 hrs
Test Coverage

Showing 3 of 3 total issues

Function synchronize has a Cognitive Complexity of 42 (exceeds 7 allowed). Consider refactoring.
Open

def synchronize(self, soap_function="IPMSDataWebService", test=False):
'''
Runs the SynchronizationJob
 
Args:
Severity: Minor
Found in talentmap_api/integrations/models.py - About 6 hrs to fix

Avoid deeply nested control flow statements.
Open

with client.options(timeout=int(get_delineated_environment_variable('SOAP_TIMEOUT', 180))):
response_xml = ET.tostring(getattr(client.service, soap_function_name)(**soap_arguments), encoding="unicode")
except TimeoutException as e:
Severity: Major
Found in talentmap_api/integrations/models.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

    if attempts > max_attempts:
    logger.error(f"SOAP call for {task} exceeded max attempts.")
    break
    else:
    Severity: Major
    Found in talentmap_api/integrations/models.py - About 45 mins to fix
      Category
      Status