opensheetmusicdisplay/opensheetmusicdisplay

View on GitHub
src/VexFlowPatch/src/stavenote.js

Summary

Maintainability
F
1 wk
Test Coverage

Function format has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring.
Open

  static format(notes, state) {
    if (!notes || notes.length < 2) return false;

    // FIXME: VexFlow will soon require that a stave be set before formatting.
    // Which, according to the below condition, means that following branch will
Severity: Minor
Found in src/VexFlowPatch/src/stavenote.js - About 2 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File stavenote.js has 876 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
//
// ## Description
// This file implements notes for standard notation. This consists of one or
// more `NoteHeads`, an optional stem, and an optional flag.
Severity: Major
Found in src/VexFlowPatch/src/stavenote.js - About 2 days to fix

    StaveNote has 64 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class StaveNote extends StemmableNote {
      static get CATEGORY() { return 'stavenotes'; }
      static get STEM_UP() { return Stem.UP; }
      static get STEM_DOWN() { return Stem.DOWN; }
      static get DEFAULT_LEDGER_LINE_OFFSET() { return 3; }
    Severity: Major
    Found in src/VexFlowPatch/src/stavenote.js - About 1 day to fix

      Function format has 175 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        static format(notes, state) {
          if (!notes || notes.length < 2) return false;
      
          // FIXME: VexFlow will soon require that a stave be set before formatting.
          // Which, according to the below condition, means that following branch will
      Severity: Major
      Found in src/VexFlowPatch/src/stavenote.js - About 7 hrs to fix

        Function calculateKeyProps has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

          calculateKeyProps() {
            let lastLine = null;
            for (let i = 0; i < this.keys.length; ++i) {
              const key = this.keys[i];
        
        
        Severity: Minor
        Found in src/VexFlowPatch/src/stavenote.js - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function buildNoteHeads has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          buildNoteHeads() {
            this.note_heads = [];
            const stemDirection = this.getStemDirection();
            const keys = this.getKeys();
        
        
        Severity: Major
        Found in src/VexFlowPatch/src/stavenote.js - About 2 hrs to fix

          Function getNoteHeadBounds has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getNoteHeadBounds() {
              // Top and bottom Y values for stem.
              let yTop = null;
              let yBottom = null;
              let nonDisplacedX = null;
          Severity: Minor
          Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

            Function drawLedgerLines has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              drawLedgerLines() {
                const {
                  stave, glyph,
                  render_options: { stroke_px },
                  context: ctx,
            Severity: Minor
            Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

              Function calculateKeyProps has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                calculateKeyProps() {
                  let lastLine = null;
                  for (let i = 0; i < this.keys.length; ++i) {
                    const key = this.keys[i];
              
              
              Severity: Minor
              Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                Function getBoundingBox has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  getBoundingBox() {
                    if (!this.preFormatted) {
                      throw new Vex.RERR('UnformattedNote', "Can't call getBoundingBox on an unformatted note.");
                    }
                
                
                Severity: Minor
                Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                  Function getBoundingBox has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                    getBoundingBox() {
                      if (!this.preFormatted) {
                        throw new Vex.RERR('UnformattedNote', "Can't call getBoundingBox on an unformatted note.");
                      }
                  
                  
                  Severity: Minor
                  Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function formatByY has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    static formatByY(notes, state) {
                      // NOTE: this function does not support more than two voices per stave
                      // use with care.
                      let hasStave = true;
                  
                  
                  Severity: Minor
                  Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                    Function buildNoteHeads has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                      buildNoteHeads() {
                        this.note_heads = [];
                        const stemDirection = this.getStemDirection();
                        const keys = this.getKeys();
                    
                    
                    Severity: Minor
                    Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function constructor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      constructor(noteStruct) {
                        super(noteStruct);
                        this.setAttribute('type', 'StaveNote');
                    
                        this.keys = noteStruct.keys;
                    Severity: Minor
                    Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                      Function getLineNumber has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                        getLineNumber(isTopNote) {
                          if (!this.keyProps.length) {
                            throw new Vex.RERR(
                              'NoKeyProps', "Can't get bottom note line, because note is not initialized properly."
                            );
                      Severity: Minor
                      Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function drawLedgerLines has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                        drawLedgerLines() {
                          const {
                            stave, glyph,
                            render_options: { stroke_px },
                            context: ctx,
                      Severity: Minor
                      Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                        draw() {
                          if (!this.context) {
                            throw new Vex.RERR('NoCanvasContext', "Can't draw without a canvas context.");
                          }
                          if (!this.stave) {
                      Severity: Minor
                      Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                        Function formatByY has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          static formatByY(notes, state) {
                            // NOTE: this function does not support more than two voices per stave
                            // use with care.
                            let hasStave = true;
                        
                        
                        Severity: Minor
                        Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function getModifierStartXY has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          getModifierStartXY(position, index, options) {
                            options = options || {};
                            if (!this.preFormatted) {
                              throw new Vex.RERR('UnformattedNote', "Can't call GetModifierStartXY on an unformatted note");
                            }
                        Severity: Minor
                        Found in src/VexFlowPatch/src/stavenote.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Avoid deeply nested control flow statements.
                        Open

                                  if (noteL.note.duration === "h") {
                                    halfNoteCount++;
                                  } else if (noteL.note.duration === "w") {
                                    wholeNoteCount++;
                                  }
                        Severity: Major
                        Found in src/VexFlowPatch/src/stavenote.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    if (lineDiff === 0 && staggerConditions) {
                                      noteL.note.setXShift(xShift);
                                      if (noteU.note.dots > 0) {
                                        let foundDots = 0;
                                        for (const modifier of noteU.note.modifiers) {
                          Severity: Major
                          Found in src/VexFlowPatch/src/stavenote.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                      if (stagger_same_whole_notes) { // controlled by EngravingRules.StaggerSameWholeNotes. see declaration above
                                        staggerConditions = staggerConditions || wholeNoteCount === 2;
                                        // should be ||=, but appveyor says syntax error, doesn't know the operator.
                                      }
                            Severity: Major
                            Found in src/VexFlowPatch/src/stavenote.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if (noteL.note.hasLedgerLinedRest) {
                                          noteL.note.shiftRestVerticalDisabled = true; // don't shift again on re-render
                                        }
                              Severity: Major
                              Found in src/VexFlowPatch/src/stavenote.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                          if (noteU.note.duration === "h") {
                                            halfNoteCount++;
                                          } else if (noteU.note.duration === "w") {
                                            wholeNoteCount++;
                                          }
                                Severity: Major
                                Found in src/VexFlowPatch/src/stavenote.js - About 45 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if ((!noteU.isrest && !noteM.isrest && noteU.minLine <= noteM.maxLine + 0.5) ||
                                        (!noteM.isrest && !noteL.isrest && noteM.minLine <= noteL.maxLine)) {
                                        xShift = voiceXShift + 3;      // shift middle note right
                                        noteM.note.setXShift(xShift);
                                      }
                                  Severity: Major
                                  Found in src/VexFlowPatch/src/stavenote.js - About 40 mins to fix

                                    Function draw has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      draw() {
                                        if (!this.context) {
                                          throw new Vex.RERR('NoCanvasContext', "Can't draw without a canvas context.");
                                        }
                                        if (!this.stave) {
                                    Severity: Minor
                                    Found in src/VexFlowPatch/src/stavenote.js - About 35 mins to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Avoid too many return statements within this function.
                                    Open

                                        return true;
                                    Severity: Major
                                    Found in src/VexFlowPatch/src/stavenote.js - About 30 mins to fix

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

                                          if (noteM !== null && noteM.minLine < noteL.maxLine + 0.5) {
                                            if (!noteM.isrest) {
                                              stemDelta = Math.abs(noteM.line - (noteL.maxLine + 0.5));
                                              stemDelta = Math.max(stemDelta, noteM.stemMin);
                                              noteM.minLine = noteM.line - stemDelta;
                                      Severity: Major
                                      Found in src/VexFlowPatch/src/stavenote.js and 1 other location - About 3 hrs to fix
                                      src/VexFlowPatch/src/stavenote.js on lines 144..152

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

                                      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

                                            if (noteU.stemDirection === noteL.stemDirection &&
                                              noteU.minLine <= noteL.maxLine) {
                                              if (!noteU.isrest) {
                                                stemDelta = Math.abs(noteU.line - (noteL.maxLine + 0.5));
                                                stemDelta = Math.max(stemDelta, noteU.stemMin);
                                      Severity: Major
                                      Found in src/VexFlowPatch/src/stavenote.js and 1 other location - About 3 hrs to fix
                                      src/VexFlowPatch/src/stavenote.js on lines 248..255

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

                                      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

                                          if (this.stem) {
                                            this.context.openGroup('stem', null, { pointerBBox: true });
                                            this.stem.setContext(this.context).draw();
                                            this.context.closeGroup();
                                          }
                                      Severity: Major
                                      Found in src/VexFlowPatch/src/stavenote.js and 1 other location - About 1 hr to fix
                                      src/VexFlowPatch/src/tabnote.js on lines 502..506

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

                                      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

                                          for (let line = 6; line <= highest_line; ++line) {
                                            const normal = (non_displaced_x !== null) && (line <= highest_non_displaced_line);
                                            const displaced = (displaced_x !== null) && (line <= highest_displaced_line);
                                            drawLedgerLine(stave.getYForNote(line), normal, displaced);
                                          }
                                      Severity: Major
                                      Found in src/VexFlowPatch/src/stavenote.js and 1 other location - About 1 hr to fix
                                      src/VexFlowPatch/src/stavenote.js on lines 1133..1137

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 59.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                          for (let line = 0; line >= lowest_line; --line) {
                                            const normal = (non_displaced_x !== null) && (line >= lowest_non_displaced_line);
                                            const displaced = (displaced_x !== null) && (line >= lowest_displaced_line);
                                            drawLedgerLine(stave.getYForNote(line), normal, displaced);
                                          }
                                      Severity: Major
                                      Found in src/VexFlowPatch/src/stavenote.js and 1 other location - About 1 hr to fix
                                      src/VexFlowPatch/src/stavenote.js on lines 1126..1130

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 59.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                    if (noteU.line > noteL.line) {
                                                      //noteU is above noteL
                                                      if (noteU.stemDirection === 1) {
                                                        noteL.note.renderFlag = false;
                                                      } else {
                                      Severity: Major
                                      Found in src/VexFlowPatch/src/stavenote.js and 1 other location - About 1 hr to fix
                                      src/VexFlowPatch/src/stavenote.js on lines 220..233

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 55.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                    } else if (noteL.line > noteU.line) {
                                                      //note L is above noteU
                                                      if (noteL.stemDirection === 1) {
                                                        noteU.note.renderFlag = false;
                                                      } else {
                                      Severity: Major
                                      Found in src/VexFlowPatch/src/stavenote.js and 1 other location - About 1 hr to fix
                                      src/VexFlowPatch/src/stavenote.js on lines 213..233

                                      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

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

                                          for (let i = 0; i < this.modifiers.length; ++i) {
                                            this.modifierContext.addModifier(this.modifiers[i]);
                                          }
                                      Severity: Minor
                                      Found in src/VexFlowPatch/src/stavenote.js and 1 other location - About 55 mins to fix
                                      src/VexFlowPatch/src/tabnote.js on lines 271..273

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

                                      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

                                          return Math.min(
                                            this.stave.getYForTopText(textLine),
                                            extents.topY - (this.render_options.annotation_spacing * (textLine + 1))
                                          );
                                      Severity: Minor
                                      Found in src/VexFlowPatch/src/stavenote.js and 1 other location - About 40 mins to fix
                                      src/VexFlowPatch/src/stemmablenote.js on lines 180..183

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

                                      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