ap2020/ap2020bot

View on GitHub
aws/src/lib/slack/verify.ts

Summary

Maintainability
A
3 hrs
Test Coverage

Showing 4 of 4 total issues

Function verify has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const verify = async (req: APIGatewayProxyEventV2): Promise<boolean> => {
const version = 'v0';
const headers = CaseInsensitiveMap.fromObject(req.headers);
 
const actual = headers.get('X-Slack-Signature');
Severity: Minor
Found in aws/src/lib/slack/verify.ts - About 1 hr to fix

    Function verify has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    export const verify = async (req: APIGatewayProxyEventV2): Promise<boolean> => {
    const version = 'v0';
    const headers = CaseInsensitiveMap.fromObject(req.headers);
     
    const actual = headers.get('X-Slack-Signature');
    Severity: Minor
    Found in aws/src/lib/slack/verify.ts - About 35 mins to fix

    Avoid too many return statements within this function.
    Open

    return false;
    Severity: Major
    Found in aws/src/lib/slack/verify.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

      return ok;
      Severity: Major
      Found in aws/src/lib/slack/verify.ts - About 30 mins to fix
        Category
        Status