knsv/mermaid

View on GitHub
packages/mermaid/src/diagrams/c4/c4Db.js

Summary

Maintainability
F
3 wks
Test Coverage

File c4Db.js has 733 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { getConfig } from '../../diagram-api/diagramAPI.js';
import { sanitizeText } from '../common/common.js';
import {
  setAccTitle,
  getAccTitle,
Severity: Major
Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 day to fix

    Function updateElStyle has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const updateElStyle = function (
      typeC4Shape,
      elementName,
      bgColor,
      fontColor,
    Severity: Major
    Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 3 hrs to fix

      Function addRel has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const addRel = function (type, from, to, label, techn, descr, sprite, tags, link) {
        // Don't allow label nulling
        if (
          type === undefined ||
          type === null ||
      Severity: Major
      Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 2 hrs to fix

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

        export const addContainer = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
          // Don't allow label nulling
          if (alias === null || label === null) {
            return;
          }
        Severity: Major
        Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 2 hrs to fix

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

          export const addComponent = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
            // Don't allow label nulling
            if (alias === null || label === null) {
              return;
            }
          Severity: Major
          Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 2 hrs to fix

            Function addDeploymentNode has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const addDeploymentNode = function (
              nodeType,
              alias,
              label,
              type,
            Severity: Major
            Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 2 hrs to fix

              Function addPersonOrSystem has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const addPersonOrSystem = function (typeC4Shape, alias, label, descr, sprite, tags, link) {
                // Don't allow label nulling
                if (alias === null || label === null) {
                  return;
                }
              Severity: Minor
              Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                Function addPersonOrSystemBoundary has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const addPersonOrSystemBoundary = function (alias, label, type, tags, link) {
                  // if (parentBoundary === null) return;
                
                  // Don't allow label nulling
                  if (alias === null || label === null) {
                Severity: Minor
                Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                  Function addContainerBoundary has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const addContainerBoundary = function (alias, label, type, tags, link) {
                    // if (parentBoundary === null) return;
                  
                    // Don't allow label nulling
                    if (alias === null || label === null) {
                  Severity: Minor
                  Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

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

                    export const updateRelStyle = function (
                      typeC4Shape,
                      from,
                      to,
                      textColor,
                    Severity: Minor
                    Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                      Function updateElStyle has 11 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        typeC4Shape,
                        elementName,
                        bgColor,
                        fontColor,
                        borderColor,
                      Severity: Major
                      Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                        Function addRel has 9 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        export const addRel = function (type, from, to, label, techn, descr, sprite, tags, link) {
                        Severity: Major
                        Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                          Function addComponent has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          export const addComponent = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
                          Severity: Major
                          Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                            Function addContainer has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            export const addContainer = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
                            Severity: Major
                            Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                              Function addDeploymentNode has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                nodeType,
                                alias,
                                label,
                                type,
                                descr,
                              Severity: Major
                              Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 1 hr to fix

                                Function addPersonOrSystem has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                export const addPersonOrSystem = function (typeC4Shape, alias, label, descr, sprite, tags, link) {
                                Severity: Major
                                Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 50 mins to fix

                                  Function updateRelStyle has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                    typeC4Shape,
                                    from,
                                    to,
                                    textColor,
                                    lineColor,
                                  Severity: Major
                                  Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 50 mins to fix

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

                                    export const addContainerBoundary = function (alias, label, type, tags, link) {
                                    Severity: Minor
                                    Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 35 mins to fix

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

                                      export const addPersonOrSystemBoundary = function (alias, label, type, tags, link) {
                                      Severity: Minor
                                      Found in packages/mermaid/src/diagrams/c4/c4Db.js - About 35 mins to fix

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

                                        export const addComponent = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
                                          // Don't allow label nulling
                                          if (alias === null || label === null) {
                                            return;
                                          }
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 3 days to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 170..235

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

                                        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

                                        export const addContainer = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
                                          // Don't allow label nulling
                                          if (alias === null || label === null) {
                                            return;
                                          }
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 3 days to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 238..303

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

                                        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

                                        export const addContainerBoundary = function (alias, label, type, tags, link) {
                                          // if (parentBoundary === null) return;
                                        
                                          // Don't allow label nulling
                                          if (alias === null || label === null) {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 2 days to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 306..359

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

                                        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

                                        export const addPersonOrSystemBoundary = function (alias, label, type, tags, link) {
                                          // if (parentBoundary === null) return;
                                        
                                          // Don't allow label nulling
                                          if (alias === null || label === null) {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 2 days to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 362..415

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

                                        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

                                          if (offsetY !== undefined && offsetY !== null) {
                                            if (typeof offsetY === 'object') {
                                              let [key, value] = Object.entries(offsetY)[0];
                                              old[key] = parseInt(value);
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 626..633

                                        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

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

                                          if (offsetX !== undefined && offsetX !== null) {
                                            if (typeof offsetX === 'object') {
                                              let [key, value] = Object.entries(offsetX)[0];
                                              old[key] = parseInt(value);
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 634..641

                                        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

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

                                          if (borderColor !== undefined && borderColor !== null) {
                                            if (typeof borderColor === 'object') {
                                              let [key, value] = Object.entries(borderColor)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (shape !== undefined && shape !== null) {
                                            if (typeof shape === 'object') {
                                              let [key, value] = Object.entries(shape)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (legendText !== undefined && legendText !== null) {
                                            if (typeof legendText === 'object') {
                                              let [key, value] = Object.entries(legendText)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (sprite !== undefined && sprite !== null) {
                                            if (typeof sprite === 'object') {
                                              let [key, value] = Object.entries(sprite)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (shadowing !== undefined && shadowing !== null) {
                                            if (typeof shadowing === 'object') {
                                              let [key, value] = Object.entries(shadowing)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (legendSprite !== undefined && legendSprite !== null) {
                                            if (typeof legendSprite === 'object') {
                                              let [key, value] = Object.entries(legendSprite)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (lineColor !== undefined && lineColor !== null) {
                                            if (typeof lineColor === 'object') {
                                              let [key, value] = Object.entries(lineColor)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (bgColor !== undefined && bgColor !== null) {
                                            if (typeof bgColor === 'object') {
                                              let [key, value] = Object.entries(bgColor)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (techn !== undefined && techn !== null) {
                                            if (typeof techn === 'object') {
                                              let [key, value] = Object.entries(techn)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (textColor !== undefined && textColor !== null) {
                                            if (typeof textColor === 'object') {
                                              let [key, value] = Object.entries(textColor)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 530..537
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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 11 locations. Consider refactoring.
                                        Open

                                          if (fontColor !== undefined && fontColor !== null) {
                                            if (typeof fontColor === 'object') {
                                              let [key, value] = Object.entries(fontColor)[0];
                                              old[key] = value;
                                            } else {
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 10 other locations - About 2 hrs to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 522..529
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 538..545
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 546..553
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 554..561
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 562..569
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 570..577
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 578..585
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 586..593
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 610..617
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 618..625

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

                                        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

                                          if (typeof c4ShapeInRowParam === 'object') {
                                            const value = Object.values(c4ShapeInRowParam)[0];
                                            c4ShapeInRowValue = parseInt(value);
                                          } else {
                                            c4ShapeInRowValue = parseInt(c4ShapeInRowParam);
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 1 hr to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 655..660

                                        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

                                          if (typeof c4BoundaryInRowParam === 'object') {
                                            const value = Object.values(c4BoundaryInRowParam)[0];
                                            c4BoundaryInRowValue = parseInt(value);
                                          } else {
                                            c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);
                                        Severity: Major
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 1 hr to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 649..654

                                        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

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

                                          boundaries = [
                                            {
                                              alias: 'global',
                                              label: { text: 'global' },
                                              type: { text: 'global' },
                                        Severity: Minor
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 35 mins to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 14..23

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

                                        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

                                        let boundaries = [
                                          {
                                            alias: 'global',
                                            label: { text: 'global' },
                                            type: { text: 'global' },
                                        Severity: Minor
                                        Found in packages/mermaid/src/diagrams/c4/c4Db.js and 1 other location - About 35 mins to fix
                                        packages/mermaid/src/diagrams/c4/c4Db.js on lines 731..740

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

                                        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

                                        There are no issues that match your filters.

                                        Category
                                        Status