teamdigitale/digital-citizenship-functions

View on GitHub
lib/profile_events_queue_handler.ts

Summary

Maintainability
A
3 hrs
Test Coverage

Showing 3 of 3 total issues

Function index has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export async function index(
context: ContextWithBindings,
event: IProfileCreatedEvent | IProfileUpdatedEvent
): Promise<void> {
const logLevel = isProduction ? "info" : "debug";
Severity: Major
Found in lib/profile_events_queue_handler.ts - About 2 hrs to fix

    Function index has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export async function index(
    context: ContextWithBindings,
    event: IProfileCreatedEvent | IProfileUpdatedEvent
    ): Promise<void> {
    const logLevel = isProduction ? "info" : "debug";
    Severity: Minor
    Found in lib/profile_events_queue_handler.ts - About 45 mins to fix

    Function sendWelcomeMessages has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    apiUrl: string,
    apiKey: string,
    messages: WelcomeMessages,
    fiscalCode: FiscalCode,
    profile: ExtendedProfile
    Severity: Minor
    Found in lib/profile_events_queue_handler.ts - About 35 mins to fix
      Category
      Status