opensheetmusicdisplay/opensheetmusicdisplay

View on GitHub
src/MusicalScore/Graphical/VexFlow/SvgVexFlowBackend.ts

Summary

Maintainability
C
1 day
Test Coverage

Function renderText has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public renderText(fontHeight: number, fontStyle: FontStyles, font: Fonts, text: string,
                      heightInPixel: number, screenPosition: PointF2D,
                      color: string = undefined, fontFamily: string = undefined): Node {
        this.ctx.save();
        const node: Node = this.ctx.openGroup("text");
Severity: Minor
Found in src/MusicalScore/Graphical/VexFlow/SvgVexFlowBackend.ts - About 1 hr to fix

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

            for (const point of points) {
                if (!currentPoint) {
                    this.ctx.moveTo(point.x, point.y);
                    currentPoint = point;
                    continue;
    Severity: Major
    Found in src/MusicalScore/Graphical/VexFlow/SvgVexFlowBackend.ts and 1 other location - About 2 hrs to fix
    src/MusicalScore/Graphical/VexFlow/CanvasVexFlowBackend.ts on lines 184..192

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

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

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

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

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

    Refactorings

    Further Reading

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

            this.ctx.bezierCurveTo(
                points[1].x,
                points[1].y,
                points[2].x,
                points[2].y,
    Severity: Major
    Found in src/MusicalScore/Graphical/VexFlow/SvgVexFlowBackend.ts and 3 other locations - About 1 hr to fix
    src/MusicalScore/Graphical/VexFlow/CanvasVexFlowBackend.ts on lines 157..164
    src/MusicalScore/Graphical/VexFlow/CanvasVexFlowBackend.ts on lines 166..173
    src/MusicalScore/Graphical/VexFlow/SvgVexFlowBackend.ts on lines 205..212

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

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

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

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

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

    Refactorings

    Further Reading

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

            this.ctx.bezierCurveTo(
                points[6].x,
                points[6].y,
                points[5].x,
                points[5].y,
    Severity: Major
    Found in src/MusicalScore/Graphical/VexFlow/SvgVexFlowBackend.ts and 3 other locations - About 1 hr to fix
    src/MusicalScore/Graphical/VexFlow/CanvasVexFlowBackend.ts on lines 157..164
    src/MusicalScore/Graphical/VexFlow/CanvasVexFlowBackend.ts on lines 166..173
    src/MusicalScore/Graphical/VexFlow/SvgVexFlowBackend.ts on lines 196..203

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

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

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

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

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

    Refactorings

    Further Reading

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

        public renderText(fontHeight: number, fontStyle: FontStyles, font: Fonts, text: string,
                          heightInPixel: number, screenPosition: PointF2D,
                          color: string = undefined, fontFamily: string = undefined): Node {
            this.ctx.save();
            const node: Node = this.ctx.openGroup("text");
    Severity: Major
    Found in src/MusicalScore/Graphical/VexFlow/SvgVexFlowBackend.ts and 1 other location - About 1 hr to fix
    src/MusicalScore/Graphical/VexFlow/CanvasVexFlowBackend.ts on lines 110..128

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 55.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status