Enterprise-CMCS/seatool-compare

View on GitHub

Showing 64 of 64 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

exports.handler = async function (
  event: CloudFormationCustomResourceEvent,
  _context: any
) {
  console.log("Request:", JSON.stringify(event, undefined, 2));
Severity: Major
Found in src/services/compare-mmdl/handlers/stopExecutions.ts and 1 other location - About 2 days to fix
src/services/compare-appian/handlers/stopExecutions.ts on lines 15..62

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 400.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

exports.handler = async function (
  event: CloudFormationCustomResourceEvent,
  _context: any
) {
  console.log("Request:", JSON.stringify(event, undefined, 2));
Severity: Major
Found in src/services/compare-appian/handlers/stopExecutions.ts and 1 other location - About 2 days to fix
src/services/compare-mmdl/handlers/stopExecutions.ts on lines 15..62

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 400.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

exports.handler = async function (
  event: { Payload: any },
  _context: any,
  callback: Function
) {
Severity: Major
Found in src/services/compare-appian/handlers/getStartAtTimeStamp.ts and 1 other location - About 1 day to fix
src/services/compare-mmdl/handlers/getStartAtTimeStamp.ts on lines 24..49

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 208.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

exports.handler = async function (
  event: { Payload: any },
  _context: any,
  callback: Function
) {
Severity: Major
Found in src/services/compare-mmdl/handlers/getStartAtTimeStamp.ts and 1 other location - About 1 day to fix
src/services/compare-appian/handlers/getStartAtTimeStamp.ts on lines 24..49

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 208.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    try {
      /* Sending the command to the Step Function service. */
      const result = await client.send(command);
      console.log(
        "Result from starting step function command",
Severity: Major
Found in src/services/compare-appian/handlers/workflowStarter.ts and 1 other location - About 4 hrs to fix
src/services/compare-mmdl/handlers/workflowStarter.ts on lines 47..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 129.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    try {
      /* Sending the command to the Step Function service. */
      const result = await client.send(command);
      console.log(
        "Result from starting step function command",
Severity: Major
Found in src/services/compare-mmdl/handlers/workflowStarter.ts and 1 other location - About 4 hrs to fix
src/services/compare-appian/handlers/workflowStarter.ts on lines 56..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 129.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        const convertMsToDate = (milliseconds?: number) => {
          if (!milliseconds) return "N/A";
          let date = new Date(milliseconds);
          let dateStr =
            date.getMonth() + 1 + "/" + date.getDate() + "/" + date.getFullYear();
        Severity: Major
        Found in src/services/compare-appian/handlers/sendReport.ts and 1 other location - About 2 hrs to fix
        src/services/compare-mmdl/handlers/sendReport.ts on lines 6..13

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        const convertMsToDate = (milliseconds?: number) => {
          if (!milliseconds) return "N/A";
          let date = new Date(milliseconds);
          let dateStr =
            date.getMonth() + 1 + "/" + date.getDate() + "/" + date.getFullYear();
        Severity: Major
        Found in src/services/compare-mmdl/handlers/sendReport.ts and 1 other location - About 2 hrs to fix
        src/services/compare-appian/handlers/sendReport.ts on lines 6..13

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

          const connectors: {
            name: string;
            config: {
              "tasks.max": number;
              "connector.class": string;
        Severity: Major
        Found in src/services/connector/handlers/testConnectors.ts and 1 other location - About 2 hrs to fix
        src/libs/connect-lib.ts on lines 176..189

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 86.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

          connectors: {
            name: string;
            config: {
              "tasks.max": number;
              "connector.class": string;
        Severity: Major
        Found in src/libs/connect-lib.ts and 1 other location - About 2 hrs to fix
        src/services/connector/handlers/testConnectors.ts on lines 13..26

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 86.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        const getTimeToStart = () => {
          const date = new Date();
        
          // Set the UTC Hours to 12 (8AM EST)
          date.setUTCHours(12, 0, 0, 0);
        Severity: Major
        Found in src/services/compare-appian/handlers/getStartAtTimeStamp.ts and 1 other location - About 2 hrs to fix
        src/services/compare-mmdl/handlers/getStartAtTimeStamp.ts on lines 11..22

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 85.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        const getTimeToStart = () => {
          const date = new Date();
        
          // Set the UTC Hours to 12 (8AM EST)
          date.setUTCHours(12, 0, 0, 0);
        Severity: Major
        Found in src/services/compare-mmdl/handlers/getStartAtTimeStamp.ts and 1 other location - About 2 hrs to fix
        src/services/compare-appian/handlers/getStartAtTimeStamp.ts on lines 11..22

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 85.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                              <CheckboxFilterPopover
                                label="Stack"
                                filtersApplied={stackFilter.options.length}
                                options={getStackOptions(
                                  typeFilter.options.length > 0 ? filteredData : data
              Severity: Major
              Found in docs/_deploy-metrics/components/Resources.tsx and 1 other location - About 2 hrs to fix
              docs/_deploy-metrics/components/Resources.tsx on lines 57..64

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 77.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language