knsv/mermaid

View on GitHub
packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts

Summary

Maintainability
F
2 wks
Test Coverage

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

// @ts-expect-error No types available for JISON
import { parser as mindmap } from './parser/mindmap.jison';
import mindmapDB from './mindmapDb.js';
// Todo fix utils functions for tests
import { setLogLevel } from '../../diagram-api/diagramAPI.js';
Severity: Minor
Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts - About 3 hrs to fix

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

        it('MMP-19 should be possible to have a child after a class assignment', function () {
          const str = `mindmap
      root(Root)
        Child(Child)
        :::hot
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 3 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 271..289
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 290..309
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 311..328

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

    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

      it('MMP-20 should be possible to have meaningless empty rows in a mindmap abc124', function () {
        const str = `mindmap
      root(Root)
        Child(Child)
          a(a)
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 3 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 251..269
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 290..309
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 311..328

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

    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

      it('MMP-22 should be possible to have comments at the end of a line', function () {
        const str = `mindmap
      root(Root)
        Child(Child)
          a(a) %% This is a comment
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 3 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 251..269
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 271..289
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 290..309

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

    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

      it('MMP-21 should be possible to have comments in a mindmap', function () {
        const str = `mindmap
      root(Root)
        Child(Child)
          a(a)
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 3 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 251..269
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 271..289
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 311..328

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

    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

        it('MMP-8 should handle an id and type for a node definition', function () {
          const str = `mindmap
        root
          theId(child1)`;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 7 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 106..119

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

    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

        it('MMP-9 should handle an id and type for a node definition', function () {
          const str = `mindmap
    root
          theId(child1)`;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 7 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 92..105

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

    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

        it('MMP-16 should be possible to set both classes and icon for the node', function () {
          const str = `mindmap
        root[The root]
        ::icon(bomb)
        :::m-4 p-8
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 6 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 196..211

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

    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

        it('MMP-15 should be possible to set both classes and icon for the node', function () {
          const str = `mindmap
        root[The root]
        :::m-4 p-8
        ::icon(bomb)
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 6 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 212..227

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

    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

      it('MMP-24 Handle rows above the mindmap declarations', function () {
        const str = '\n \nmindmap\nroot\n A\n \n\n B';
        mindmap.parse(str);
        const mm = mindmap.yy.getMindmap();
        expect(mm.nodeId).toEqual('root');
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 2 other locations - About 6 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 329..340
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 353..364

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

    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

      it('MMP-25 Handle rows above the mindmap declarations, no space', function () {
        const str = '\n\n\nmindmap\nroot\n A\n \n\n B';
        mindmap.parse(str);
        const mm = mindmap.yy.getMindmap();
        expect(mm.nodeId).toEqual('root');
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 2 other locations - About 6 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 329..340
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 341..352

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

    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

      it('MMP-23 Rows with only spaces should not interfere', function () {
        const str = 'mindmap\nroot\n A\n \n\n B';
        mindmap.parse(str);
        const mm = mindmap.yy.getMindmap();
        expect(mm.nodeId).toEqual('root');
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 2 other locations - About 6 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 341..352
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 353..364

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

    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

        it('MMP-13 should be possible to set an icon for the node', function () {
          const str = `mindmap
        root[The root]
        ::icon(bomb)
        `;
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 182..195

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

    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

        it('MMP-14 should be possible to set classes for the node', function () {
          const str = `mindmap
        root[The root]
        :::m-4 p-8
        `;
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 168..181

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

    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

        it('MMP-11 multiple types (cloud)', function () {
          const str = `mindmap
     root)the root(
    `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 2 other locations - About 4 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 120..130
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 143..153

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

    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

        it('MMP-12 multiple types (bang)', function () {
          const str = `mindmap
     root))the root((
    `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 2 other locations - About 4 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 120..130
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 132..142

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

    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

        it('MMP-10 multiple types (circle)', function () {
          const str = `mindmap
     root((the root))
     `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 2 other locations - About 4 hrs to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 132..142
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 143..153

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

    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

        it('3 should handle a simple root definition with a shape and without an id abc123', function () {
          const str = `mindmap
        (root)`;
    
          mindmap.parse(str);
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 1 hr to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 14..21

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

    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

        it('MMP-1 should handle a simple root definition abc122', function () {
          const str = `mindmap
        root`;
    
          mindmap.parse(str);
    Severity: Major
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 1 hr to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 37..44

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

    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

        it('MMP-6 real root in wrong place', function () {
          const str = `mindmap
              root
            fakeRoot
        realRootWrongPlace`;
    Severity: Minor
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 50 mins to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 61..69

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

    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

        it('5 Multiple roots are illegal', function () {
          const str = `mindmap
        root
        fakeRoot`;
    
    
    Severity: Minor
    Found in packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts and 1 other location - About 50 mins to fix
    packages/mermaid/src/diagrams/mindmap/mindmap.spec.ts on lines 70..78

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

    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