knsv/mermaid

View on GitHub

Showing 1,488 of 1,488 total issues

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

export const drawFace = function (element, faceData) {
  const radius = 15;
  const circleElement = element
    .append('circle')
    .attr('cx', faceData.cx)
Severity: Major
Found in packages/mermaid/src/diagrams/timeline/svgDraw.js and 1 other location - About 4 days to fix
packages/mermaid/src/diagrams/user-journey/svgDraw.js on lines 8..95

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

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 drawFace = function (element, faceData) {
  const radius = 15;
  const circleElement = element
    .append('circle')
    .attr('cx', faceData.cx)
Severity: Major
Found in packages/mermaid/src/diagrams/user-journey/svgDraw.js and 1 other location - About 4 days to fix
packages/mermaid/src/diagrams/timeline/svgDraw.js on lines 22..109

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

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

File sequenceDiagram.spec.js has 1740 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { vi } from 'vitest';
import { setSiteConfig } from '../../diagram-api/diagramAPI.js';
import mermaidAPI from '../../mermaidAPI.js';
import { Diagram, getDiagramFromText } from '../../Diagram.js';
import { addDiagrams } from '../../diagram-api/diagram-orchestration.js';
Severity: Major
Found in packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js - About 4 days to fix

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

    const _drawTextCandidateFunc = (function () {
      /**
       * @param {any} content
       * @param {any} g
       * @param {any} x
    Severity: Major
    Found in packages/mermaid/src/diagrams/user-journey/svgDraw.js and 1 other location - About 4 days to fix
    packages/mermaid/src/diagrams/timeline/svgDraw.js on lines 336..452

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

    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 _drawTextCandidateFunc = (function () {
      /**
       * @param {any} content
       * @param {any} g
       * @param {any} x
    Severity: Major
    Found in packages/mermaid/src/diagrams/timeline/svgDraw.js and 1 other location - About 4 days to fix
    packages/mermaid/src/diagrams/user-journey/svgDraw.js on lines 273..389

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

    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

    File classDiagram.spec.ts has 1513 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // @ts-expect-error Jison doesn't export types
    import { parser } from './parser/classDiagram.jison';
    import classDb from './classDb.js';
    import { vi, describe, it, expect } from 'vitest';
    const spyOn = vi.spyOn;
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts - About 4 days 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

      File sequenceRenderer.ts has 1360 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // @ts-nocheck TODO: fix file
      import { select } from 'd3';
      import svgDraw, { drawKatex, ACTOR_TYPE_WIDTH, drawText, fixLifeLineHeights } from './svgDraw.js';
      import { log } from '../../logger.js';
      import common, { calculateMathMLDimensions, hasKatex } from '../common/common.js';
      Severity: Major
      Found in packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts - About 3 days to fix

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

          describe('when method has no parameters', function () {
            it('should parse correctly', function () {
              const str = `getTime()`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 3 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 62..113
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 115..166
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 168..219

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

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

          describe('when method parameter contains two generic', function () {
            it('should parse correctly', function () {
              const str = `getTimes(List~T~, List~OT~)`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 5 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 274..325
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 327..378
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 433..484
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 545..596
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 598..663

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

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

          describe('when method return type is a nested generic', function () {
            it('should parse correctly', function () {
              const str = `getTimetableList() List~List~T~~`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 5 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 274..325
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 327..378
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 380..431
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 433..484
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 545..596

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

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

          describe('when method parameter is generic', function () {
            it('should parse correctly', function () {
              const str = `getTimes(List~T~)`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 5 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 274..325
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 380..431
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 433..484
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 545..596
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 598..663

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

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

          describe('when method has return type', function () {
            it('should parse correctly', function () {
              const str = `getTime() DateTime`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 5 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 327..378
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 380..431
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 433..484
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 545..596
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 598..663

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

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

          describe('when method parameter is a nested generic', function () {
            it('should parse correctly', function () {
              const str = `getTimetableList(List~List~T~~)`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 5 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 274..325
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 327..378
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 380..431
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 545..596
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 598..663

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

        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

          describe('when method has single parameter value', function () {
            it('should parse correctly', function () {
              const str = `getTime(int)`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 3 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 9..60
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 115..166
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 168..219

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

        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

          describe('when method has single parameter type and name (type first)', function () {
            it('should parse correctly', function () {
              const str = `getTime(int count)`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 3 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 9..60
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 62..113
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 168..219

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

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

          describe('when method return type is generic', function () {
            it('should parse correctly', function () {
              const str = `getTimes() List~T~`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 5 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 274..325
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 327..378
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 380..431
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 433..484
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 598..663

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

        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

          describe('when method has single parameter type and name (name first)', function () {
            it('should parse correctly', function () {
              const str = `getTime(count int)`;
        
              const classMember = new ClassMember(str, 'method');
        Severity: Major
        Found in packages/mermaid/src/diagrams/class/classTypes.spec.ts and 3 other locations - About 2 days to fix
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 9..60
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 62..113
        packages/mermaid/src/diagrams/class/classTypes.spec.ts on lines 115..166

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

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

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

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

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

        Refactorings

        Further Reading

        Function draw has 568 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const draw = function (text, id, version, diagObj) {
          const conf = getConfig().gantt;
        
          const securityLevel = getConfig().securityLevel;
          // Handle root and Document for when rendering in sandbox mode
        Severity: Major
        Found in packages/mermaid/src/diagrams/gantt/ganttRenderer.js - About 2 days to fix
          Severity
          Category
          Status
          Source
          Language