knsv/mermaid

View on GitHub
packages/mermaid/src/diagrams/sequence/svgDraw.js

Summary

Maintainability
F
1 wk
Test Coverage

File svgDraw.js has 875 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import common, { calculateMathMLDimensions, hasKatex, renderKatex } from '../common/common.js';
import * as svgDrawCommon from '../common/svgDrawCommon.js';
import { addFunction } from '../../interactionDb.js';
import { ZERO_WIDTH_SPACE, parseFontSize } from '../../utils.js';
import { sanitizeUrl } from '@braintree/sanitize-url';
Severity: Major
Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 2 days to fix

    Function drawText has 121 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const drawText = function (elem, textData) {
      let prevTextHeight = 0;
      let textHeight = 0;
      const lines = textData.text.split(common.lineBreakRegex);
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 4 hrs to fix

      Function drawLoop has 90 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const drawLoop = async function (elem, loopModel, labelText, conf) {
        const {
          boxMargin,
          boxTextMargin,
          labelBoxHeight,
      Severity: Major
      Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 3 hrs to fix

        Function _drawTextCandidateFunc has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const _drawTextCandidateFunc = (function () {
          /**
           * @param {any} content
           * @param {any} g
           * @param {any} x
        Severity: Major
        Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 3 hrs to fix

          Function drawActorTypeActor has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const drawActorTypeActor = async function (elem, actor, conf, isFooter) {
            const actorY = isFooter ? actor.stopy : actor.starty;
            const center = actor.x + actor.width / 2;
            const centerY = actorY + 80;
          
          
          Severity: Major
          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 3 hrs to fix

            Function drawActorTypeParticipant has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const drawActorTypeParticipant = async function (elem, actor, conf, isFooter) {
              const actorY = isFooter ? actor.stopy : actor.starty;
              const center = actor.x + actor.width / 2;
              const centerY = actorY + 5;
            
            
            Severity: Major
            Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 2 hrs to fix

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

              const _drawMenuItemTextCandidateFunc = (function () {
                /**
                 * @param {any} content
                 * @param {any} g
                 * @param {any} x
              Severity: Major
              Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 2 hrs to fix

                Function drawPopup has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const drawPopup = function (elem, actor, minMenuWidth, textAttrs, forceMenus) {
                  if (actor.links === undefined || actor.links === null || Object.keys(actor.links).length === 0) {
                    return { height: 0, width: 0 };
                  }
                
                
                Severity: Major
                Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 2 hrs to fix

                  Function drawKatex has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const drawKatex = async function (elem, textData, msgModel = null) {
                    let textElem = elem.append('foreignObject');
                    const lines = await renderKatex(textData.text, configApi.getConfig());
                  
                    const divElem = textElem
                  Severity: Minor
                  Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

                    Function drawLabel has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const drawLabel = function (elem, txtObject) {
                      /**
                       * @param {any} x
                       * @param {any} y
                       * @param {any} width
                    Severity: Minor
                    Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

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

                        function byFo(content, g, x, y, width, height, textAttrs, conf) {
                      Severity: Major
                      Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

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

                          async function byKatex(content, g, x, y, width, height, textAttrs, conf) {
                        Severity: Major
                        Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

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

                            function byTspan(content, g, x, y, width, height, textAttrs, conf) {
                          Severity: Major
                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

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

                              function byTspan(content, g, x, y, width, height, textAttrs, conf) {
                            Severity: Major
                            Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

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

                                function byFo(content, g, x, y, width, height, textAttrs, conf) {
                              Severity: Major
                              Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 1 hr to fix

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

                                  function byText(content, g, x, y, width, height, textAttrs) {
                                Severity: Major
                                Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 50 mins to fix

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

                                    function byText(content, g, x, y, width, height, textAttrs) {
                                  Severity: Major
                                  Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 50 mins to fix

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

                                    export const drawPopup = function (elem, actor, minMenuWidth, textAttrs, forceMenus) {
                                    Severity: Minor
                                    Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 35 mins to fix

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

                                        function genPoints(x, y, width, height, cut) {
                                      Severity: Minor
                                      Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 35 mins to fix

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

                                        export const drawActivation = function (elem, bounds, verticalPos, conf, actorActivations) {
                                        Severity: Minor
                                        Found in packages/mermaid/src/diagrams/sequence/svgDraw.js - About 35 mins to fix

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

                                            function byFo(content, g, x, y, width, height, textAttrs, conf) {
                                              const s = g.append('switch');
                                              const f = s
                                                .append('foreignObject')
                                                .attr('x', x)
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 2 other locations - About 1 day to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 632..656
                                          packages/mermaid/src/diagrams/sequence/svgDraw.js on lines 911..935

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

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

                                            function byFo(content, g, x, y, width, height, textAttrs, conf) {
                                              const s = g.append('switch');
                                              const f = s
                                                .append('foreignObject')
                                                .attr('x', x)
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 2 other locations - About 1 day to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 632..656
                                          packages/mermaid/src/diagrams/sequence/svgDraw.js on lines 1057..1081

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

                                          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 insertSequenceNumber = function (elem) {
                                            elem
                                              .append('defs')
                                              .append('marker')
                                              .attr('id', 'sequencenumber')
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 1 other location - About 4 hrs to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 504..519

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

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

                                          export const insertArrowHead = function (elem) {
                                            elem
                                              .append('defs')
                                              .append('marker')
                                              .attr('id', 'arrowhead')
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 2 other locations - About 4 hrs to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 450..463
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 465..478

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

                                          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 insertArrowFilledHead = function (elem) {
                                            elem
                                              .append('defs')
                                              .append('marker')
                                              .attr('id', 'filled-head')
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 1 other location - About 3 hrs to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 485..497

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

                                          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

                                            function byText(content, g, x, y, width, height, textAttrs) {
                                              const text = g
                                                .append('text')
                                                .attr('x', x + width / 2)
                                                .attr('y', y + height / 2 + 5)
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 1 other location - About 3 hrs to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 575..583

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

                                          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

                                              elem
                                                .append('line')
                                                .attr('id', 'actor' + actorCnt)
                                                .attr('x1', center)
                                                .attr('y1', centerY)
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 1 other location - About 3 hrs to fix
                                          packages/mermaid/src/diagrams/sequence/svgDraw.js on lines 340..349

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

                                          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

                                              g.append('line')
                                                .attr('id', 'actor' + actorCnt)
                                                .attr('x1', center)
                                                .attr('y1', centerY)
                                                .attr('x2', center)
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 1 other location - About 3 hrs to fix
                                          packages/mermaid/src/diagrams/sequence/svgDraw.js on lines 421..431

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

                                          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

                                          export const insertClockIcon = function (elem) {
                                            elem
                                              .append('defs')
                                              .append('symbol')
                                              .attr('id', 'clock')
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 1 other location - About 2 hrs to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 430..443

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

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

                                          export const insertComputerIcon = function (elem) {
                                            elem
                                              .append('defs')
                                              .append('symbol')
                                              .attr('id', 'computer')
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 3 other locations - About 2 hrs to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 400..413
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 415..428
                                          packages/mermaid/src/diagrams/sequence/svgDraw.js on lines 677..690

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

                                          export const insertDatabaseIcon = function (elem) {
                                            elem
                                              .append('defs')
                                              .append('symbol')
                                              .attr('id', 'database')
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 3 other locations - About 2 hrs to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 400..413
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 415..428
                                          packages/mermaid/src/diagrams/sequence/svgDraw.js on lines 692..705

                                          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

                                            const marker = defs
                                              .append('marker')
                                              .attr('id', 'crosshead')
                                              .attr('markerWidth', 15)
                                              .attr('markerHeight', 8)
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 1 other location - About 1 hr to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 528..535

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

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

                                            marker
                                              .append('path')
                                              .attr('fill', 'none')
                                              .attr('stroke', '#000000')
                                              .style('stroke-dasharray', '0, 0')
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 2 other locations - About 1 hr to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 538..544
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 547..553

                                          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

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

                                            function _setTextAttrs(toText, fromTextAttrsDict) {
                                              for (const key in fromTextAttrsDict) {
                                                if (fromTextAttrsDict.hasOwnProperty(key)) {
                                                  toText.attr(key, fromTextAttrsDict[key]);
                                                }
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 2 other locations - About 1 hr to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 662..668
                                          packages/mermaid/src/diagrams/sequence/svgDraw.js on lines 1087..1093

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

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

                                            function _setTextAttrs(toText, fromTextAttrsDict) {
                                              for (const key in fromTextAttrsDict) {
                                                if (fromTextAttrsDict.hasOwnProperty(key)) {
                                                  toText.attr(key, fromTextAttrsDict[key]);
                                                }
                                          Severity: Major
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 2 other locations - About 1 hr to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 662..668
                                          packages/mermaid/src/diagrams/sequence/svgDraw.js on lines 976..982

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

                                          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 text = g
                                                  .append('text')
                                                  .attr('x', x + width / 2)
                                                  .attr('y', y)
                                                  .style('text-anchor', 'middle')
                                          Severity: Minor
                                          Found in packages/mermaid/src/diagrams/sequence/svgDraw.js and 1 other location - About 40 mins to fix
                                          packages/mermaid/src/diagrams/c4/svgDraw.js on lines 601..606

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

                                          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