knsv/mermaid

View on GitHub
cypress/integration/rendering/sequencediagram.spec.js

Summary

Maintainability
F
4 days
Test Coverage

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

/// <reference types="Cypress" />

import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';

context('Sequence diagram', () => {
Severity: Major
Found in cypress/integration/rendering/sequencediagram.spec.js - About 2 days to fix

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

        it('should render a sequence diagram when useMaxWidth is false', () => {
          renderGraph(
            `
          sequenceDiagram
            participant Alice
    Severity: Major
    Found in cypress/integration/rendering/sequencediagram.spec.js and 2 other locations - About 5 hrs to fix
    cypress/integration/rendering/flowchart-elk.spec.js on lines 115..134
    cypress/integration/rendering/flowchart.spec.js on lines 757..776

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

    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

          cy.get('#actor0_popup').should((popupMenu) => {
            const style = popupMenu.attr('style');
            expect(style).to.match(/^display: block;$/);
          });
    Severity: Major
    Found in cypress/integration/rendering/sequencediagram.spec.js and 1 other location - About 1 hr to fix
    cypress/integration/rendering/sequencediagram.spec.js on lines 838..841

    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

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

          cy.get('#actor0_popup').should((popupMenu) => {
            const style = popupMenu.attr('style');
            expect(style).to.match(/^display: none;$/);
          });
    Severity: Major
    Found in cypress/integration/rendering/sequencediagram.spec.js and 1 other location - About 1 hr to fix
    cypress/integration/rendering/sequencediagram.spec.js on lines 833..836

    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

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

        it('should support actor links and properties when not mirrored EXPERIMENTAL: USE WITH CAUTION', () => {
          //Be aware that the syntax for "properties" is likely to be changed.
          imgSnapshotTest(
            `
            %%{init: { "config": { "mirrorActors": false, "forceMenus": true, "wrap": true }}}%%
    Severity: Major
    Found in cypress/integration/rendering/sequencediagram.spec.js and 2 other locations - About 1 hr to fix
    cypress/integration/rendering/sequencediagram.spec.js on lines 843..863
    cypress/integration/rendering/sequencediagram.spec.js on lines 887..900

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

    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("shouldn't display unused participants", () => {
          //Be aware that the syntax for "properties" is likely to be changed.
          imgSnapshotTest(
            `
            %%{init: { "config": { "sequence": {"hideUnusedParticipants": true }}}}%%
    Severity: Major
    Found in cypress/integration/rendering/sequencediagram.spec.js and 2 other locations - About 1 hr to fix
    cypress/integration/rendering/sequencediagram.spec.js on lines 843..863
    cypress/integration/rendering/sequencediagram.spec.js on lines 864..886

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

    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 support actor links and properties EXPERIMENTAL: USE WITH CAUTION', () => {
          //Be aware that the syntax for "properties" is likely to be changed.
          imgSnapshotTest(
            `
            %%{init: { "config": { "mirrorActors": true, "forceMenus": true }}}%%
    Severity: Major
    Found in cypress/integration/rendering/sequencediagram.spec.js and 2 other locations - About 1 hr to fix
    cypress/integration/rendering/sequencediagram.spec.js on lines 864..886
    cypress/integration/rendering/sequencediagram.spec.js on lines 887..900

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

    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 override config with directive settings 2', () => {
          imgSnapshotTest(
            `
            %%{init: { "config": { "mirrorActors": false, "wrap": true }}}%%
            sequenceDiagram
    Severity: Minor
    Found in cypress/integration/rendering/sequencediagram.spec.js and 1 other location - About 55 mins to fix
    cypress/integration/rendering/sequencediagram.spec.js on lines 786..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 53.

    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 override config with directive settings', () => {
          imgSnapshotTest(
            `
            %%{init: { "config": { "mirrorActors": true }}}%%
            sequenceDiagram
    Severity: Minor
    Found in cypress/integration/rendering/sequencediagram.spec.js and 1 other location - About 55 mins to fix
    cypress/integration/rendering/sequencediagram.spec.js on lines 801..812

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

    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