knsv/mermaid

View on GitHub

Showing 1,488 of 1,488 total issues

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

  node.classData.methods.forEach((member) => {
    const parsedInfo = member.getDisplayDetails();
    let displayText = parsedInfo.displayText;
    if (getConfig().flowchart.htmlLabels) {
      displayText = displayText.replace(/</g, '&lt;').replace(/>/g, '&gt;');
Severity: Major
Found in packages/mermaid/src/dagre-wrapper/nodes.js and 1 other location - About 1 day to fix
packages/mermaid/src/dagre-wrapper/nodes.js on lines 952..981

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

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

  node.classData.members.forEach((member) => {
    const parsedInfo = member.getDisplayDetails();
    let parsedText = parsedInfo.displayText;
    if (getConfig().flowchart.htmlLabels) {
      parsedText = parsedText.replace(/</g, '&lt;').replace(/>/g, '&gt;');
Severity: Major
Found in packages/mermaid/src/dagre-wrapper/nodes.js and 1 other location - About 1 day to fix
packages/mermaid/src/dagre-wrapper/nodes.js on lines 986..1016

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

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

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

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

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

Refactorings

Further Reading

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

export const draw = async function (_text: string, id: string, _version: string, diagObj: Diagram) {
  const { securityLevel, sequence } = getConfig();
  conf = sequence;
  // Handle root and Document for when rendering in sandbox mode
  let sandboxElement;
Severity: Major
Found in packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts - About 1 day to fix

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

      it('should handle a gitGraph commit with custom commit tag only', function () {
        const str = `gitGraph:
        commit tag:"test"
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 7 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 62..78
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 80..96
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 98..114
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 116..132
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 134..150
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 170..186
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 188..204

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

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

      it('should handle a gitGraph commit with custom commit type HIGHLIGHT only', function () {
        const str = `gitGraph:
        commit type: HIGHLIGHT
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 7 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 44..60
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 80..96
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 98..114
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 116..132
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 134..150
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 170..186
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 188..204

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

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

      it('should handle a gitGraph commit with custom commit type NORMAL only', function () {
        const str = `gitGraph:
        commit type: NORMAL
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 7 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 44..60
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 62..78
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 80..96
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 116..132
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 134..150
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 170..186
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 188..204

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

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

      it('should handle a gitGraph commit with custom commit tag and type only', function () {
        const str = `gitGraph:
        commit tag: "test tag" type:HIGHLIGHT
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 7 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 44..60
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 62..78
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 80..96
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 98..114
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 116..132
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 134..150
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 170..186

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

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

      it('should handle a gitGraph commit with custom commit "msg:" key only', function () {
        const str = `gitGraph:
        commit msg: "test commit"
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 7 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 44..60
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 62..78
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 80..96
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 98..114
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 116..132
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 170..186
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 188..204

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

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

      it('should handle a gitGraph commit with custom commit type, tag  only', function () {
        const str = `gitGraph:
        commit type:HIGHLIGHT tag: "test tag"
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 7 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 44..60
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 62..78
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 80..96
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 98..114
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 116..132
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 134..150
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 188..204

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

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

      it('should handle a gitGraph commit with custom commit type REVERSE only', function () {
        const str = `gitGraph:
        commit type: REVERSE
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 7 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 44..60
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 62..78
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 98..114
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 116..132
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 134..150
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 170..186
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 188..204

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

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

      it('should handle a gitGraph commit with custom commit msg only', function () {
        const str = `gitGraph:
        commit "test commit"
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 7 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 44..60
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 62..78
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 80..96
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 98..114
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 134..150
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 170..186
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 188..204

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

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

      it('should handle a gitGraph commit with custom msg, commit id, type,tag', function () {
        const str = `gitGraph:
        commit msg:"test msg" id:"1111" type:REVERSE tag: "test tag"
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 6 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 27..42
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 152..168
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 206..222
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 224..240
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 242..259
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 261..277

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

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

      it('should handle a gitGraph commit with custom commit id, type and tag only', function () {
        const str = `gitGraph:
        commit id:"1111" type:REVERSE tag: "test tag"
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 6 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 27..42
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 152..168
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 224..240
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 242..259
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 261..277
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 279..295

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

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

      it('should handle a gitGraph commit with custom commit id, type,  tag and msg', function () {
        const str = `gitGraph:
        commit id:"1111" type:REVERSE tag: "test tag" msg:"test msg"
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 6 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 27..42
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 152..168
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 206..222
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 242..259
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 261..277
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 279..295

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

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

      it('should handle a gitGraph commit with custom  tag, msg, commit id, type,', function () {
        const str = `gitGraph:
        commit  tag: "test tag" msg:"test msg" id:"1111" type:REVERSE
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 6 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 27..42
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 152..168
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 206..222
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 224..240
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 242..259
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 279..295

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

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

      it('should handle a gitGraph commit with custom commit id, tag  only', function () {
        const str = `gitGraph:
        commit id:"1111" tag: "test tag"
        `;
    
    
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 6 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 27..42
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 206..222
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 224..240
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 242..259
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 261..277
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 279..295

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

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

      it('should handle a gitGraph commit with custom  type,tag, msg, commit id,', function () {
        const str = `gitGraph:
        commit type:REVERSE tag: "test tag" msg: "test msg" id: "1111"
    
        `;
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 6 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 27..42
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 152..168
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 206..222
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 224..240
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 261..277
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 279..295

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

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

      it('should handle a gitGraph commit with custom commit id only', function () {
        const str = `gitGraph:
        commit id:"1111"
        `;
        parser.parse(str);
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 6 other locations - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 152..168
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 206..222
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 224..240
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 242..259
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 261..277
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 279..295

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

    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

    Severity
    Category
    Status
    Source
    Language