Enterprise-CMCS/seatool-compare

View on GitHub

Showing 29 of 64 total issues

Function myHandler has 109 lines of code (exceeds 40 allowed). Consider refactoring.
Open

async function myHandler() {
  const cluster = process.env.cluster;
  const RUNNING = "RUNNING";
  const connectors: {
    name: string;
Severity: Major
Found in src/services/connector/handlers/testConnectors.ts - About 3 hrs to fix

    Function myHandler has 85 lines of code (exceeds 40 allowed). Consider refactoring.
    Open

    async function myHandler(
      event: { value: string; key: string },
      _context: any,
      _callback: Function
    ) {
    Severity: Major
    Found in src/services/connector/handlers/sinkMmdlData.ts - About 2 hrs to fix

      File connect-lib.ts has 278 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import * as ecs from "./ecs-lib.js";
      import {
        ECSClient,
        DescribeTasksCommand,
        ListTasksCommand,
      Severity: Minor
      Found in src/libs/connect-lib.ts - About 2 hrs to fix

        Function handler has 76 lines of code (exceeds 40 allowed). Consider refactoring.
        Open

        exports.handler = async function (
          event: { Payload: any },
          _context: any,
          callback: Function
        ) {
        Severity: Major
        Found in src/services/compare-mmdl/handlers/sendNoMatchAlert.ts - About 2 hrs to fix

          Function myHandler has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          async function myHandler() {
            const cluster = process.env.cluster;
            const RUNNING = "RUNNING";
            const connectors: {
              name: string;
          Severity: Minor
          Found in src/services/connector/handlers/testConnectors.ts - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function handler has 70 lines of code (exceeds 40 allowed). Consider refactoring.
          Open

          exports.handler = async function (
            event: { Payload: any },
            _context: any,
            callback: Function
          ) {
          Severity: Major
          Found in src/services/compare-appian/handlers/sendNoMatchAlert.ts - About 2 hrs to fix

            File run.ts has 255 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import yargs from "yargs";
            import * as dotenv from "dotenv";
            import LabeledProcessRunner from "./runner.js";
            import * as fs from "fs";
            import { ServerlessStageDestroyer } from "@stratiformdigital/serverless-stage-destroyer";
            Severity: Minor
            Found in src/run.ts - About 2 hrs to fix

              Function handler has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.handler = async function (
                event: { Payload: any },
                _context: any,
                callback: Function
              ) {
              Severity: Minor
              Found in src/services/compare-mmdl/handlers/sendNoMatchAlert.ts - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function handler has 56 lines of code (exceeds 40 allowed). Consider refactoring.
              Open

              exports.handler = async function (event: {
                Records: { dynamodb: { Keys: { PK: { S: string }; SK: { S: string } } } }[];
              }) {
                console.log("Received event:", JSON.stringify(event, null, 2));
                const client = new SFNClient({ region: process.env.region });
              Severity: Major
              Found in src/services/compare-appian/handlers/workflowStarter.ts - About 1 hr to fix

                Function getMeanTimeToRecover has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                export const getMeanTimeToRecover = async (branch: string) => {
                  const response = await octokit.paginate(
                    "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
                    {
                      owner: "Enterprise-CMCS",
                Severity: Minor
                Found in docs/_deploy-metrics/lib/getMeanTimeToRecover.ts - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function handler has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                exports.handler = async function (event: {
                  Records: { dynamodb: { Keys: { PK: { S: string }; SK: { S: string } } } }[];
                }) {
                  console.log("Received event:", JSON.stringify(event, null, 2));
                  const client = new SFNClient({ region: process.env.region });
                Severity: Minor
                Found in src/services/compare-appian/handlers/workflowStarter.ts - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function handler has 50 lines of code (exceeds 40 allowed). Consider refactoring.
                Open

                exports.handler = async function (event: {
                  Records: { dynamodb: { Keys: { SK: { S: string }; PK: { S: string } } } }[];
                }) {
                  console.log("Received event:", JSON.stringify(event, null, 2));
                  const client = new SFNClient({ region: process.env.region });
                Severity: Minor
                Found in src/services/compare-mmdl/handlers/workflowStarter.ts - About 1 hr to fix

                  Function handler has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  exports.handler = async function (event: {
                    Records: { dynamodb: { Keys: { SK: { S: string }; PK: { S: string } } } }[];
                  }) {
                    console.log("Received event:", JSON.stringify(event, null, 2));
                    const client = new SFNClient({ region: process.env.region });
                  Severity: Minor
                  Found in src/services/compare-mmdl/handlers/workflowStarter.ts - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function handler has 46 lines of code (exceeds 40 allowed). Consider refactoring.
                  Open

                  exports.handler = async function (event: { recipient: string; days: number }) {
                    console.log("Received event:", JSON.stringify(event, null, 2));
                  
                    const { recipient, days } = event;
                  
                  
                  Severity: Minor
                  Found in src/services/compare-appian/handlers/sendReport.ts - About 1 hr to fix

                    Function myHandler has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    async function myHandler(
                      event: { value: string; key: string },
                      _context: any,
                      _callback: Function
                    ) {
                    Severity: Minor
                    Found in src/services/connector/handlers/sinkMmdlData.ts - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function getMeanTimeToRecover has 42 lines of code (exceeds 40 allowed). Consider refactoring.
                    Open

                    export const getMeanTimeToRecover = async (branch: string) => {
                      const response = await octokit.paginate(
                        "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
                        {
                          owner: "Enterprise-CMCS",
                    Severity: Minor
                    Found in docs/_deploy-metrics/lib/getMeanTimeToRecover.ts - About 1 hr to fix

                      Function findIpForEcsService has 42 lines of code (exceeds 40 allowed). Consider refactoring.
                      Open

                      export async function findIpForEcsService(cluster: string | undefined) {
                        try {
                          const client = new ECSClient({});
                          const listStacksCommandResponse = await client.send(
                            new ListTasksCommand({
                      Severity: Minor
                      Found in src/libs/ecs-lib.ts - About 1 hr to fix

                        Function handler has 41 lines of code (exceeds 40 allowed). Consider refactoring.
                        Open

                        exports.handler = async function (
                          event: CloudFormationCustomResourceEvent,
                          _context: any
                        ) {
                          console.log("Request:", JSON.stringify(event, undefined, 2));
                        Severity: Minor
                        Found in src/services/compare-appian/handlers/stopExecutions.ts - About 1 hr to fix

                          Function handler has 41 lines of code (exceeds 40 allowed). Consider refactoring.
                          Open

                          exports.handler = async function (
                            event: CloudFormationCustomResourceEvent,
                            _context: any
                          ) {
                            console.log("Request:", JSON.stringify(event, undefined, 2));
                          Severity: Minor
                          Found in src/services/compare-mmdl/handlers/stopExecutions.ts - About 1 hr to fix

                            Function handler has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            exports.handler = async function (
                              event: { Payload: any },
                              _context: any,
                              callback: Function
                            ) {
                            Severity: Minor
                            Found in src/services/compare-appian/handlers/sendNoMatchAlert.ts - About 55 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language