knsv/mermaid

View on GitHub
packages/mermaid/src/diagrams/class/classDiagram.spec.ts

Summary

Maintainability
F
1 mo
Test Coverage

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

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

        it('should parse classes with different text labels', () => {
          parser.parse(`classDiagram
    class C1["OneWord"]
    class C2["With, Comma"]
    class C3["With (Brackets)"]
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 2 days to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1760..1789

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

    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

        it('should parse classes with different text labels', () => {
          parser.parse(`classDiagram
    class C1["OneWord"]
    class C2["With, Comma"]
    class C3["With (Brackets)"]
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 2 days to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 230..259

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

    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('should add bracket members in right order', () => {
          const str =
            'classDiagram\n' +
            'class Class1 {\n' +
            'int testMember\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 day to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1319..1337

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

    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('should add bracket members in right order', function () {
          const str =
            'classDiagram\n' +
            'class Class1 {\n' +
            'int : test\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 day to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 492..510

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

    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('should handle generics', function () {
          const str = 'classDiagram\n' + 'Class1~T~ <|-- Class02';
    
          parser.parse(str);
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 day to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1249..1262

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

    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('should handle generic class with relation definitions', function () {
          const str = 'classDiagram\n' + 'Class01~T~ <|-- Class02';
    
          parser.parse(str);
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 day to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1094..1107

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

    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('should handle relation definitions AGGREGATION and dotted line', function () {
          const str = 'classDiagram\n' + 'Class1 o.. Class02';
    
          parser.parse(str);
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 day to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1120..1132

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

    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('should handle relation definitions EXTENSION', function () {
          const str = 'classDiagram\n' + 'Class1 <|-- Class02';
    
          parser.parse(str);
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 day to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1167..1179

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

    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('should handle abstract methods', function () {
          const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()*';
          parser.parse(str);
    
          const testClass = parser.yy.getClass('Class1');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 3 other locations - About 7 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 899..910
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 912..923
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1352..1363

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

    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('should handle static methods', function () {
          const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()$';
          parser.parse(str);
    
          const testClass = parser.yy.getClass('Class1');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 3 other locations - About 7 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 899..910
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 912..923
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1339..1350

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

    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('should handle abstract methods', function () {
          const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()*';
          parser.parse(str);
    
          const actual = parser.yy.getClass('Class1');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 3 other locations - About 7 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 912..923
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1339..1350
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1352..1363

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

    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('should handle static methods', function () {
          const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()$';
          parser.parse(str);
    
          const actual = parser.yy.getClass('Class1');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 3 other locations - About 7 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 899..910
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1339..1350
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1352..1363

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

    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('should parse two classes with text labels and css class shorthands', () => {
          parser.parse(`classDiagram
    class C1["Class 1 with text label"]:::styleClass1 {
      +member1
    }
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 7 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1700..1719

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

    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('should parse two classes with text labels and css classes', () => {
          parser.parse(`classDiagram
    class C1["Class 1 with text label"] {
      +member1
    }
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 7 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1721..1739

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

    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('should handle class annotations in brackets with members and methods', function () {
          const str =
            'classDiagram\n' +
            'class Class1 {\n' +
            '<<interface>>\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 6 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1302..1317

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

    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('should handle class annotations in brackets with members and methods', function () {
          const str =
            'classDiagram\n' +
            'class Class1 {\n' +
            '<<interface>>\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 6 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 785..800

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

    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('should handle class annotations with members and methods', function () {
          const str =
            'classDiagram\n' +
            'class Class1\n' +
            'Class1 : int test\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 6 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1275..1289

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

    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('should handle class annotations with members and methods', function () {
          const str =
            'classDiagram\n' +
            'class Class1\n' +
            'Class1 : int test\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 6 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 758..772

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

    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('should handle class annotations in brackets', function () {
          const str = 'classDiagram\n' + 'class Class1 {\n' + '<<interface>>\n' + '}';
          parser.parse(str);
    
          const actual = parser.yy.getClass('Class1');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1291..1300

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

    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('should handle class annotations in brackets', function () {
          const str = 'classDiagram\n' + 'class Class1 {\n' + '<<interface>>\n' + '}';
          parser.parse(str);
    
          const testClass = parser.yy.getClass('Class1');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 774..783

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

    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('should parse a class with text label and css class', () => {
          parser.parse(`classDiagram
    class C1["Class 1 with text label"] {
      +member1
    }
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1667..1681

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

    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('should handle class annotations', function () {
          const str = 'classDiagram\n' + 'class Class1\n' + '<<interface>> Class1';
          parser.parse(str);
    
          const actual = parser.yy.getClass('Class1');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1264..1273

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

    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('should parse a class with text label and css class shorthand', () => {
          parser.parse(`classDiagram
    class C1["Class 1 with text label"]:::styleClass {
      +member1
    }
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1683..1698

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

    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('should handle class annotations', function () {
          const str = 'classDiagram\n' + 'class Class1\n' + '<<interface>> Class1';
          parser.parse(str);
    
          const testClass = parser.yy.getClass('Class1');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 747..756

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

    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('should associate click and href link with tooltip', function () {
          const str =
            'classDiagram\n' +
            'class Class1\n' +
            'Class1 : someMethod()\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1393..1406

    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('should associate link with tooltip', function () {
          const str =
            'classDiagram\n' +
            'class Class1\n' +
            'Class1 : someMethod()\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 5 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1408..1421

    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('should parse multiple classes with same text labels', () => {
          parser.parse(`classDiagram
    class C1["Class with text label"]
    class C2["Class with text label"]
    class C3["Class with text label"]`);
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 4 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1741..1758

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

    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('should parse multiple classes with same text labels', () => {
          parser.parse(`classDiagram
    class C1["Class with text label"]
    class C2["Class with text label"]
    class C3["Class with text label"]
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 4 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 214..228

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

    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('should associate click and href link and css appropriately', function () {
          const str =
            'classDiagram\n' +
            'class Class1\n' +
            'Class1 : someMethod()\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 4 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1365..1377

    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('should associate link and css appropriately', function () {
          const str =
            'classDiagram\n' +
            'class Class1\n' +
            'Class1 : someMethod()\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 4 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1379..1391

    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('should associate link appropriately', function () {
          spyOn(classDb, 'setLink');
          spyOn(classDb, 'setTooltip');
          const str =
            'classDiagram\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 2 other locations - About 3 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 722..738
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1423..1435

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

    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('should handle function call with an arbitrary number of args and tooltip', function () {
          spyOn(classDb, 'setClickEvent');
          spyOn(classDb, 'setTooltip');
          const str =
            'classDiagram\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 2 other locations - About 3 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1423..1435
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1461..1473

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

    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('should associate click and href link with tooltip and target appropriately', function () {
          spyOn(classDb, 'setLink');
          spyOn(classDb, 'setTooltip');
          const str =
            'classDiagram\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 2 other locations - About 3 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 722..738
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1461..1473

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

    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('should parse a class with a text label', () => {
          parser.parse(`classDiagram
      class C1["Class 1 with text label"]
      C1 -->  C2
          `);
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 3 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1619..1629

    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

        it('should parse two classes with text labels', () => {
          parser.parse(`classDiagram
      class C1["Class 1 with text label"]
      class C2["Class 2 with chars @?"]
      C1 -->  C2
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 3 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1608..1617

    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

        it('should handle direct member declaration', function () {
          parser.parse('classDiagram\n' + 'Car : wheels');
          const car = classDb.getClass('Car');
          expect(car.members.length).toBe(1);
          expect(car.members[0].id).toBe('wheels');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 2 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 824..829

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

    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('should handle direct member declaration with type', function () {
          parser.parse('classDiagram\n' + 'Car : int wheels');
          const car = classDb.getClass('Car');
          expect(car.members.length).toBe(1);
          expect(car.members[0].id).toBe('int wheels');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 2 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 817..822

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

    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.each(keywords)('should handle a "note for" with a %s in it', function (keyword: string) {
          const str = `classDiagram
                       class Something {
                         int id
                         string name
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 3 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 324..330
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 332..341
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 356..370

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

    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.each(keywords)(
          'should handle note with %s at beginning of string',
          function (keyword: string) {
            const str = `classDiagram
                          note "${keyword}"`;
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 3 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 324..330
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 343..354
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 356..370

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

    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.each(keywords)(
          'should handle a "note for" with a %s at beginning of string',
          function (keyword: string) {
            const str = `classDiagram
                        class Something {
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 3 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 324..330
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 332..341
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 343..354

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

    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.each(keywords)('should handle a note with %s in it', function (keyword: string) {
          const str = `classDiagram
                         note "This is a keyword: ${keyword}. It truly is."
                      `;
          parser.parse(str);
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 3 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 332..341
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 343..354
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 356..370

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

    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('should handle accTitle and multiline accDescr', function () {
          const str = `classDiagram
                accTitle: My Title
                accDescr {
                  This is my multi
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 2 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 16..24

    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

        it('should handle accTitle and accDescr', function () {
          const str = `classDiagram
                accTitle: My Title
                accDescr: My Description`;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 2 hrs to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 26..37

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

        it('should associate click and href link with target appropriately', function () {
          spyOn(classDb, 'setLink');
          const str =
            'classDiagram\n' +
            'class Class1\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 2 other locations - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 706..720
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1499..1513

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

    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('should associate callback appropriately with an arbitrary number of args', function () {
          spyOn(classDb, 'setClickEvent');
          const str =
            'classDiagram\n' +
            'class Class1\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 2 other locations - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 706..720
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1449..1459

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

    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('should handle function call with an arbitrary number of args', function () {
          spyOn(classDb, 'setClickEvent');
          const str =
            'classDiagram\n' +
            'class Class1\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 2 other locations - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1449..1459
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1499..1513

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

    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('should associate callback appropriately', function () {
          spyOn(classDb, 'setClickEvent');
          const str =
            'classDiagram\n' +
            'class Class1\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 2 other locations - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1437..1447
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1487..1497

    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

        it('should associate click and call callback appropriately', function () {
          spyOn(classDb, 'setClickEvent');
          const str =
            'classDiagram\n' +
            'class Class1\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 2 other locations - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1437..1447
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1475..1485

    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

        it('should associate click and href link appropriately', function () {
          spyOn(classDb, 'setLink');
          const str =
            'classDiagram\n' +
            'class Class1\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 2 other locations - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1475..1485
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1487..1497

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

        it('should handle generic class with brackets', function () {
          const str =
            'classDiagram\n' +
            'class Dummy_Class~T~ {\n' +
            'String data\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1001..1015

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

    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('should handle generic class with brackets and a literal name', function () {
          const str =
            'classDiagram\n' +
            'class `Dummy_Class`~T~ {\n' +
            'String data\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 985..999

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

    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('should handle class names with dash', function () {
          const str = 'classDiagram\n' + 'class Ca-r';
    
          parser.parse(str);
          const actual = classDb.getClass('Ca-r');
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 103..110

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

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

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

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

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

    Refactorings

    Further Reading

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

        it('should parse a class with a text label', () => {
          const str = 'classDiagram\n' + 'class C1["Class 1 with text label"]';
    
          parser.parse(str);
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 1 other location - About 1 hr to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 56..62

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

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

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

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

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

    Refactorings

    Further Reading

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

        it('should handle all basic relationships', function () {
          const str =
            'classDiagram\n' +
            'Class1 <|-- Class02\n' +
            'Class03 *-- Class04\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 50 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 936..946
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1082..1092
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1134..1144
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1156..1165

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

        it('should handle dashed relation definition of different types and directions', function () {
          const str =
            'classDiagram\n' +
            'Class11 <|.. Class12\n' +
            'Class13 <.. Class14\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 50 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 936..946
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1070..1080
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1082..1092
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1134..1144

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

        it('should handle relation definition of different types and directions', function () {
          const str =
            'classDiagram\n' +
            'Class11 <|.. Class12\n' +
            'Class13 --> Class14\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 50 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 936..946
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1070..1080
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1082..1092
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1156..1165

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

        it('should handle backquoted class name', function () {
          const str =
            'classDiagram\n' +
            '`Class1` <|-- Class02\n' +
            'Class03 *-- Class04\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 50 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 936..946
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1070..1080
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1134..1144
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1156..1165

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

        it('should handle generic types in members in class with brackets', function () {
          const str =
            'classDiagram\n' +
            'class Car {\n' +
            'List~Wheel~ wheels\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 50 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1070..1080
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1082..1092
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1134..1144
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1156..1165

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

        it('should handle a mix of members defined in and outside of brackets', function () {
          const str =
            'classDiagram\n' + 'class Car{\n' + '+int wheels\n' + '}\n' + 'Car : +ArrayList size()\n';
    
          parser.parse(str);
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 35 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 888..897
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 963..972
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 974..983
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1109..1118

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

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

        it('should handle generic class with relationships', function () {
          const str =
            'classDiagram\n' +
            'class Car~T~\n' +
            'Driver -- Car : drives >\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 35 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 466..471
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 888..897
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 974..983
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1109..1118

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

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

        it('should handle visibility', function () {
          const str =
            'classDiagram\n' +
            'class actual\n' +
            'actual : -privateMethod()\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 35 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 466..471
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 963..972
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 974..983
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1109..1118

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

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

        it('should handle generic class with a literal name', function () {
          const str =
            'classDiagram\n' +
            'class `Car`~T~\n' +
            'Driver -- `Car` : drives >\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 35 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 466..471
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 888..897
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 963..972
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 1109..1118

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

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

        it('should handle relationships with labels', function () {
          const str =
            'classDiagram\n' +
            'class Car\n' +
            'Driver -- Car : drives >\n' +
    Severity: Major
    Found in packages/mermaid/src/diagrams/class/classDiagram.spec.ts and 4 other locations - About 35 mins to fix
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 466..471
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 888..897
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 963..972
    packages/mermaid/src/diagrams/class/classDiagram.spec.ts on lines 974..983

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

    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