knsv/mermaid

View on GitHub
packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js

Summary

Maintainability
F
1 mo
Test Coverage

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

import gitGraphAst from './gitGraphAst.js';
import { parser } from './parser/gitGraph.jison';

describe('when parsing a gitGraph', function () {
  beforeEach(function () {
Severity: Major
Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js - About 2 days to fix

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

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

      it('should handle new branch checkout with and without order', function () {
        const str = `gitGraph:
        commit
        branch test1 order: 1
        branch test2
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 1 other location - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 425..444

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

    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 new branch checkout with order', function () {
        const str = `gitGraph:
        commit
        branch test1 order: 3
        branch test2 order: 2
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 1 other location - About 1 day to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 445..464

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

    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 3 straight commits', function () {
        const str = `gitGraph:
        commit
        commit
        commit
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 4 other locations - About 6 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 312..324
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 351..363
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 365..378
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 411..424

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

    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 new branch creation', function () {
        const str = `gitGraph:
        commit
        branch testBranch
        `;
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 4 other locations - About 6 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 297..310
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 351..363
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 365..378
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 411..424

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

    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 allow _-./ characters in branch names', function () {
        const str = `gitGraph:
        commit
        branch azAZ_-./test
        `;
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 4 other locations - About 6 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 297..310
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 312..324
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 365..378
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 411..424

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

    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 allow branch names starting with numbers', function () {
        const str = `gitGraph:
        commit
        %% branch names starting with numbers are not recommended, but are supported by git
        branch 1.0.1
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 4 other locations - About 6 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 297..310
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 312..324
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 351..363
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 411..424

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

    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 new branch checkout', function () {
        const str = `gitGraph:
        commit
        branch testBranch
        checkout testBranch
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 4 other locations - About 6 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 297..310
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 312..324
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 351..363
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 365..378

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

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

      it('should support cherry-picking commits', function () {
        const str = `gitGraph
        commit id: "ZERO"
        branch develop
        commit id:"A"
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 5 other locations - About 4 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 644..658
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 660..674
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 676..695
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 697..716
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 718..739

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

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

      it('should support cherry-picking of merge commits', function () {
        const str = `gitGraph
        commit id: "ZERO"
        branch feature
        branch release
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 5 other locations - About 4 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 628..642
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 644..658
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 660..674
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 697..716
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 718..739

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

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

      it('should support cherry-picking commits with custom tag', function () {
        const str = `gitGraph
        commit id: "ZERO"
        branch develop
        commit id:"A"
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 5 other locations - About 4 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 628..642
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 660..674
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 676..695
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 697..716
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 718..739

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

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

      it('should support cherry-picking of merge commits with additional commit', function () {
        const str = `gitGraph
        commit id: "ZERO"
        branch feature
        branch release
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 5 other locations - About 4 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 628..642
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 644..658
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 660..674
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 676..695
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 697..716

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

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

      it('should support cherry-picking of merge commits with tag', function () {
        const str = `gitGraph
        commit id: "ZERO"
        branch feature
        branch release
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 5 other locations - About 4 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 628..642
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 644..658
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 660..674
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 676..695
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 718..739

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

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

      it('should support cherry-picking commits with no tag', function () {
        const str = `gitGraph
        commit id: "ZERO"
        branch develop
        commit id:"A"
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 5 other locations - About 4 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 628..642
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 644..658
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 676..695
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 697..716
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 718..739

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

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

      it('should throw error when trying to merge branch to itself', function () {
        const str = `gitGraph
        commit
        branch testBranch
        merge testBranch
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 8 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 815..835
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 836..856
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 857..877
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 878..897
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 898..920
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 937..956
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 957..972
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 973..991

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

      it('should throw error when trying to merge branches having same heads', function () {
        const str = `gitGraph
        commit
        branch testBranch
        checkout main
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 8 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 815..835
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 836..856
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 857..877
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 878..897
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 898..920
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 921..935
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 937..956
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 973..991

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

      it('should throw error when trying to merge branch which has no commits', function () {
        const str = `gitGraph
        branch test1
    
        checkout main
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 8 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 815..835
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 836..856
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 857..877
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 878..897
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 898..920
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 921..935
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 937..956
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 957..972

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

      it('should throw error when trying to merge unknown branch', function () {
        const str = `gitGraph
        commit
        merge testBranch
        commit
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 8 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 815..835
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 836..856
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 857..877
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 878..897
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 921..935
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 937..956
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 957..972
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 973..991

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

      it('should throw error when trying to merge, when current branch has no commits', function () {
        const str = `gitGraph
        merge testBranch
        commit
        checkout testBranch
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 8 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 815..835
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 836..856
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 857..877
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 898..920
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 921..935
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 937..956
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 957..972
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 973..991

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

      it('should throw error when using existing id as merge ID', function () {
        const str = `gitGraph
        commit id: "1-111"
        branch testBranch
        commit id: "2-222"
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 8 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 815..835
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 836..856
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 857..877
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 878..897
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 898..920
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 921..935
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 957..972
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 973..991

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

      it('should throw error when try to branch existing branch: testBranch', function () {
        const str = `gitGraph
        commit
        branch testBranch
        commit
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 8 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 815..835
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 857..877
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 878..897
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 898..920
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 921..935
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 937..956
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 957..972
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 973..991

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

      it('should throw error when try to checkout unknown branch: testBranch', function () {
        const str = `gitGraph
        commit
        checkout testBranch
        commit
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 8 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 815..835
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 836..856
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 878..897
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 898..920
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 921..935
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 937..956
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 957..972
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 973..991

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

      it('should throw error when try to branch existing branch: main', function () {
        const str = `gitGraph
        commit
        branch testBranch
        commit
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 8 other locations - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 836..856
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 857..877
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 878..897
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 898..920
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 921..935
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 937..956
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 957..972
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 973..991

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 88.

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

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

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

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

    Refactorings

    Further Reading

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

        it('should handle a title and a description (accDescr)', () => {
          const str = `gitGraph:
          accTitle: This is a title
          accDescr: This is a description
        commit
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 1 other location - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 1003..1015

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 88.

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

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

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

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

    Refactorings

    Further Reading

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

        it('should handle a title and a multiline description (accDescr)', () => {
          const str = `gitGraph:
          accTitle: This is a title
          accDescr {
            This is a description
    Severity: Major
    Found in packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js and 1 other location - About 2 hrs to fix
    packages/mermaid/src/diagrams/git/gitGraphParserV2.spec.js on lines 993..1002

    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

    There are no issues that match your filters.

    Category
    Status