Enterprise-CMCS/macpro-appian-connector

View on GitHub

Showing 20 of 20 total issues

File run.ts has 267 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.
    Confirmed

                    <CheckboxFilterPopover
                      label="Type"
                      filtersApplied={typeFilter.options.length}
                      options={getTypeOptions(
                        stackFilter.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 65..72

    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

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

                    <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

    Function createTopics has 65 lines of code (exceeds 40 allowed). Consider refactoring.
    Open

    export async function createTopics(brokerString, topicsConfig) {
      const topics = topicsConfig;
      const brokers = brokerString.split(",");
    
      const kafka = new Kafka({
    Severity: Major
    Found in src/libs/topics-lib.js - About 2 hrs to fix

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

      async function myHandler(event, context, callback) {
        const cluster = process.env.cluster;
        const service = process.env.service;
        const RUNNING = "RUNNING";
      
      
      Severity: Major
      Found in src/services/connector/handlers/testConnectors.js - About 1 hr to fix

        Function create has 54 lines of code (exceeds 40 allowed). Consider refactoring.
        Open

          const create = async () => {
            await admin.connect();
        
            //fetch topics from MSK and filter out __ internal management topic
            const existingTopicList = _.filter(await admin.listTopics(), function (n) {
        Severity: Major
        Found in src/libs/topics-lib.js - 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 11 (exceeds 5 allowed). Consider refactoring.
          Open

          exports.handler = async function (event, context) {
            console.log("Request:", JSON.stringify(event, undefined, 2));
            const responseData = {};
            let responseStatus = SUCCESS;
            try {
          Severity: Minor
          Found in src/services/connector/handlers/createTopics.js - 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

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

            const data = await octokit.paginate(
              "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
              {
                owner: "Enterprise-CMCS",
                repo: getRepoName,
          Severity: Major
          Found in docs/_deploy-metrics/lib/getSuccessfulDeploys.ts and 1 other location - About 1 hr to fix
          docs/_deploy-metrics/lib/getMeanTimeToRecover.ts on lines 6..16

          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 60.

          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

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

            const response = await octokit.paginate(
              "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
              {
                owner: "Enterprise-CMCS",
                repo: getRepoName,
          Severity: Major
          Found in docs/_deploy-metrics/lib/getMeanTimeToRecover.ts and 1 other location - About 1 hr to fix
          docs/_deploy-metrics/lib/getSuccessfulDeploys.ts on lines 5..15

          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 60.

          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

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

              const configOptions = _.map(topicsMetadata, function (topic) {
                return {
                  name: _.get(topic, "name"),
                  type: _.get(ResourceTypes, "TOPIC"),
                };
          Severity: Major
          Found in src/libs/topics-lib.js and 1 other location - About 1 hr to fix
          src/libs/topics-lib.js on lines 53..58

          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 58.

          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

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

              const paritionConfig = _.map(topicsToUpdate, function (topic) {
                return {
                  topic: _.get(topic, "topic"),
                  count: _.get(topic, "numPartitions"),
                };
          Severity: Major
          Found in src/libs/topics-lib.js and 1 other location - About 1 hr to fix
          src/libs/topics-lib.js on lines 61..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 58.

          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 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

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

                    <Select
                      flex={1}
                      maxW={"md"}
                      value={selectedBranch}
                      onChange={(newValue) =>
            Severity: Major
            Found in docs/_deploy-metrics/pages/dora/index.tsx and 1 other location - About 1 hr to fix
            docs/_deploy-metrics/pages/aws/index.tsx on lines 61..73

            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 55.

            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

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

                      <UI.Select
                        w="max-content"
                        value={selectedBranch}
                        onChange={(newValue) => {
                          setSelectedBranch(newValue.currentTarget.value);
            Severity: Major
            Found in docs/_deploy-metrics/pages/aws/index.tsx and 1 other location - About 1 hr to fix
            docs/_deploy-metrics/pages/dora/index.tsx on lines 64..77

            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 55.

            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 formattedPrefix has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              private formattedPrefix(prefix: string): string {
                let color: string;
            
                if (prefix! in this.prefixColors) {
                  color = this.prefixColors[prefix];
            Severity: Minor
            Found in src/runner.ts - About 45 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

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

              return {
                props: {
                  branchData,
                  branches: octokitBranchesToUse,
                  repoName: process.env?.REPO_NAME ?? packageJson.name.toUpperCase(),
            Severity: Minor
            Found in docs/_deploy-metrics/pages/dora/index.tsx and 1 other location - About 40 mins to fix
            docs/_deploy-metrics/pages/aws/index.tsx on lines 24..30

            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 48.

            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

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

              return {
                props: {
                  branchData,
                  branches: octokitBranchesToUse,
                  repoName: process.env?.REPO_NAME ?? packageJson.name.toUpperCase(),
            Severity: Minor
            Found in docs/_deploy-metrics/pages/aws/index.tsx and 1 other location - About 40 mins to fix
            docs/_deploy-metrics/pages/dora/index.tsx on lines 41..47

            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 48.

            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 run_command_and_output has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              async run_command_and_output(
                prefix: string,
                cmd: string[],
                cwd: string | null,
                catchAll = false,
            Severity: Minor
            Found in src/runner.ts - About 35 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

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

            async function install_deps(runner: LabeledProcessRunner, dir: string) {
              if (process.env.CI == "true") {
                if (!fs.existsSync(`${dir}/node_modules`)) {
                  await frozenInstall(runner, dir);
                }
            Severity: Minor
            Found in src/run.ts - About 35 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