knsv/mermaid

View on GitHub
packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js

Summary

Maintainability
F
1 mo
Test Coverage

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

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

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

      it('should draw two actors notes to the left with text wrapped and the init directive sets the theme to dark', async () => {
        const str = `
    %%{init:{'theme':'dark'}}%%
    sequenceDiagram
    %%{wrap}%%
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1881..1903

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

    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 draw two actors notes to the left with text wrapped (directive)', async () => {
        const str = `
    %%{init: { 'theme': 'dark' } }%%
    sequenceDiagram
    %%{wrap}%%
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1904..1926

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

    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 a sequenceDiagram definition with a title:', async () => {
        const str = `
    sequenceDiagram
    title: Diagram Title
    Alice->Bob:Hello Bob, how are you?
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 251..272

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

    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 a sequenceDiagram definition with a title without a :', async () => {
        const str = `
    sequenceDiagram
    title Diagram Title
    Alice->Bob:Hello Bob, how are you?
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 228..249

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

    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 alias participants', async () => {
        const str = `
    sequenceDiagram
    participant A as Alice
    participant B as Bob
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 411..430

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

    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 alias actors apa13', async () => {
        const str = `
    sequenceDiagram
    actor A as Alice
    actor B as Bob
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 362..382

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

    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 two actors', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?`;
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1811..1825

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

    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 draw two actors and two messages', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    Bob->Alice: Fine!`;
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1723..1736

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

    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 draw background rect', async () => {
        const str = `
          sequenceDiagram
            Alice->Bob: Hello Bob, are you alright?
            rect rgb(0, 0, 0)
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1952..1968

    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 draw two loops', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    loop Cheers
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1969..1985

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

      it('should handle semicolons', async () => {
        const str = `
    sequenceDiagram;Alice->Bob: Hello Bob, how are you?;Note right of Bob: Bob thinks;Bob-->Alice: I am good thanks!;`;
    
        await mermaidAPI.parse(str);
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 306..322
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 617..635
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 636..656
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 672..691
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 692..711
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 712..736
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 882..904
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 956..978
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 979..1004

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

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

      it('should handle alt statements', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 306..322
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 617..635
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 636..656
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 657..671
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 672..691
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 692..711
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 712..736
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 882..904
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 956..978

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

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

      it('should handle several leading spaces in lines in a sequenceDiagram', async () => {
        const str = `
    sequenceDiagram
    participant Alice
    participant Bob
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 306..322
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 617..635
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 636..656
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 657..671
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 672..691
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 692..711
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 882..904
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 956..978
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 979..1004

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

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

      it('should handle comments in a sequenceDiagram', async () => {
        const str = `
          sequenceDiagram
          Alice->Bob: Hello Bob, how are you?
          %% Comment
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 306..322
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 636..656
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 657..671
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 672..691
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 692..711
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 712..736
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 882..904
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 956..978
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 979..1004

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

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

      it('should handle new lines in a sequenceDiagram', async () => {
        const str = `
          sequenceDiagram
          Alice->Bob: Hello Bob, how are you?
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 306..322
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 617..635
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 657..671
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 672..691
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 692..711
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 712..736
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 882..904
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 956..978
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 979..1004

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

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

      it('should handle opt statements', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 306..322
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 617..635
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 636..656
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 657..671
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 672..691
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 692..711
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 712..736
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 882..904
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 979..1004

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

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

      it('should handle one leading space in lines in a sequenceDiagram', async () => {
        const str = `
    sequenceDiagram
     Alice->Bob: Hello Bob, how are you?
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 306..322
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 617..635
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 636..656
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 657..671
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 692..711
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 712..736
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 882..904
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 956..978
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 979..1004

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

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

      it('should space in actor names', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob:Hello Bob, how are - you?
    Bob-->Alice: I am good thanks!`;
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 617..635
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 636..656
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 657..671
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 672..691
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 692..711
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 712..736
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 882..904
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 956..978
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 979..1004

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

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

      it('should handle several leading spaces in lines in a sequenceDiagram', async () => {
        const str = `
    sequenceDiagram
       Alice->Bob: Hello Bob, how are you?
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 306..322
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 617..635
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 636..656
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 657..671
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 672..691
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 712..736
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 882..904
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 956..978
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 979..1004

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

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

      it('should handle loop statements', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 306..322
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 617..635
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 636..656
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 657..671
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 672..691
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 692..711
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 712..736
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 956..978
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 979..1004

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

    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 in async messages', async () => {
        const str = `
    sequenceDiagram
    Alice-xBob:Hello Bob, how are you?`;
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 446..460
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 461..475
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 476..490
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 491..505

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

    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 in arrow messages', async () => {
        const str = `
    sequenceDiagram
    Alice->>Bob:Hello Bob, how are you?`;
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 431..445
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 446..460
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 461..475
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 476..490

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

    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 in sync messages', async () => {
        const str = `
    sequenceDiagram
    Alice-)Bob:Hello Bob, how are you?`;
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 431..445
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 446..460
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 476..490
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 491..505

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

    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 in async dotted messages', async () => {
        const str = `
    sequenceDiagram
    Alice--xBob:Hello Bob, how are you?`;
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 431..445
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 461..475
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 476..490
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 491..505

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

    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 in sync dotted messages', async () => {
        const str = `
    sequenceDiagram
    Alice--)Bob:Hello Bob, how are you?`;
    
    
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 431..445
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 446..460
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 461..475
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 491..505

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

    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 notes over multiple actors', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    Note over Alice,Bob: confusion
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1261..1277
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1278..1294

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

    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 no-label par', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    par;Bob-->Alice: I am good thanks!
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 866..881
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1261..1277

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

    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 no-label alt', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    alt;Bob-->Alice: I am good thanks!
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 866..881
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1278..1294

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

    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 box without color', async () => {
        const str = `
      sequenceDiagram
      box Group 1
      participant a as Alice
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1343..1364

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

    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 box', async () => {
        const str = `
    sequenceDiagram
    box green Group 1
    participant a as Alice
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1366..1387

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

    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 special characters in par', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    par -:<>,;# comment
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 853..865
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1201..1216
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1233..1246
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1247..1260

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

    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 notes over a single actor', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    Note over Bob: Bob thinks
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1201..1216
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1217..1232
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1233..1246
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1247..1260

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

    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 special characters in alt', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    alt -:<>,;# comment
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 853..865
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1217..1232
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1233..1246
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1247..1260

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

    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 no-label opt', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    opt # comment
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 853..865
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1201..1216
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1217..1232
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1233..1246

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

    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 no-label loop', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    loop
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 853..865
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1201..1216
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1217..1232
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1247..1260

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

    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 show sequence numbers when autonumber is enabled', async () => {
        const str = `
    sequenceDiagram
    autonumber
    Alice->Bob:Hello Bob, how are you?
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 204..214

    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 not show sequence numbers per default', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob:Hello Bob, how are you?
    Note right of Bob: Bob thinks
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 215..226

    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 handle special characters in loop', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    loop -:<>,;# comment
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1164..1174
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1188..1200

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

    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 special characters in opt', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    opt -:<>,;# comment
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1164..1174
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1175..1187

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

    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 special characters in notes', async () => {
        const str = `
    sequenceDiagram
    Alice->Bob: Hello Bob, how are you?
    Note right of Bob: -:<>,;# comment`;
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1175..1187
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1188..1200

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

    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

        conf = {
          diagramMarginX: 50,
          diagramMarginY: 10,
          actorMargin: 50,
          width: 150,
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1599..1612

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

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

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

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

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

    Refactorings

    Further Reading

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

        let conf = {
          diagramMarginX: 50,
          diagramMarginY: 10,
          actorMargin: 50,
          width: 150,
    packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js on lines 1620..1633

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

    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