W1ndst0rm/Treillage

View on GitHub
treillage/endpoints/org_management.py

Summary

Maintainability
A
0 mins
Test Coverage

Function "update_contact" has 28 parameters, which is greater than the 7 authorized.
Open

async def update_contact(connection: ConnectionManager,
                         contact_id: str,
                         person_types: List[str],
                         person_id: dict = None,
                         first_name: str = None,

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

Function "get_contact_list" has 9 parameters, which is greater than the 7 authorized.
Open

async def get_contact_list(connection: ConnectionManager,
                           fields: List[str] = None,
                           first_name: str = None,
                           last_name: str = None,
                           full_name: str = None,

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

Refactor this function to reduce its Cognitive Complexity from 57 to the 15 allowed.
Open

async def update_contact(connection: ConnectionManager,

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

There are no issues that match your filters.

Category
Status