freakimkaefig/Music-XML-Analyzer

View on GitHub
public/js/views/ScoreView.js

Summary

Maintainability
F
2 wks
Test Coverage

Function ScoreView has a Cognitive Complexity of 190 (exceeds 5 allowed). Consider refactoring.
Open

MusicXMLAnalyzer.ScoreView = function(){

    var that = {},

    $scoreValue = null,
Severity: Minor
Found in public/js/views/ScoreView.js - About 3 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

Function ScoreView has 310 lines of code (exceeds 25 allowed). Consider refactoring.
Open

MusicXMLAnalyzer.ScoreView = function(){

    var that = {},

    $scoreValue = null,
Severity: Major
Found in public/js/views/ScoreView.js - About 1 day to fix

    Function generateVexflowNotes has 90 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        generateVexflowNotes = function(score, result) {
            var measures = [];
    
            for (var i = 0; i < score.measures.length; i++) {
                for (var j = 0; j < score.measures[i].notes.length; j++) {
    Severity: Major
    Found in public/js/views/ScoreView.js - About 3 hrs to fix

      File ScoreView.js has 312 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /** @constructor */
      MusicXMLAnalyzer.ScoreView = function(){
      
          var that = {},
      
      
      Severity: Minor
      Found in public/js/views/ScoreView.js - About 3 hrs to fix

        Function renderNotes has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            renderNotes = function(measures, canvas, renderer, context, stave, score) {
        
                // clear canvas
                context.clearRect(0, 0, canvas.width, canvas.height);
        
        
        Severity: Major
        Found in public/js/views/ScoreView.js - About 3 hrs to fix

          Function getVexflowDuration has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              getVexflowDuration = function(duration, type) {
                  switch (duration) {
                      case "whole":
                          switch (type) {
                              case 0: return "w"; break;        // 0 is normal note
          Severity: Major
          Found in public/js/views/ScoreView.js - About 2 hrs to fix

            Function renderNotes has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                renderNotes = function(measures, canvas, renderer, context, stave, score) {
            Severity: Minor
            Found in public/js/views/ScoreView.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (measures[i].ties[j].indexOf("start") > -1) {
                                          tieStart = measures[i].notes[j];
                                      }
              Severity: Major
              Found in public/js/views/ScoreView.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (!score.measures[i].notes[j].pitch.chord) {
                                            // determine note variables
                                            var step = score.measures[i].notes[j].pitch.step;
                                            var octave = score.measures[i].notes[j].pitch.octave;
                                            var alter = score.measures[i].notes[j].pitch.alter;
                Severity: Major
                Found in public/js/views/ScoreView.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      } else if (score.measures[i].notes[j].type === "rest") {
                                          var durationType = 1; // rests type is 1
                                          var noteDuration = getVexflowDuration(score.measures[i].notes[j].duration, durationType);
                  
                                          note = new Vex.Flow.StaveNote({ keys: ["b/4"], duration: noteDuration });
                  Severity: Major
                  Found in public/js/views/ScoreView.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (measures[i].ties[j].indexOf("stop") > -1) {
                                                tieStop = measures[i].notes[j];
                                                if (tieStart !== null) {
                                                    var tie = new Vex.Flow.StaveTie({ first_note: tieStart, last_note: tieStop, first_indices: [0], last_indices: [0] });
                                                    ties.push(tie);
                    Severity: Major
                    Found in public/js/views/ScoreView.js - About 45 mins to fix

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

                          getVexflowDuration = function(duration, type) {
                              switch (duration) {
                                  case "whole":
                                      switch (type) {
                                          case 0: return "w"; break;        // 0 is normal note
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 1 other location - About 1 day to fix
                      public/js/views/ResultView.js on lines 702..761

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

                      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 (var j = 0; j < measures[i].notes.length; j++) {
                      
                                      // ties
                                      if (measures[i].ties) {
                                          if (measures[i].ties[j] !== false && measures[i].ties[j] !== undefined) {
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 1 other location - About 1 day to fix
                      public/js/views/ResultView.js on lines 341..360

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

                      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 (var j = 0; j < measures[i].notes.length; j++) {
                                      if (measures[i].tuplets && measures[i].tuplets[j]) {
                                          if (measures[i].tuplets[j].toString() !== 'false' && measures[i].tuplets[j].toString() !== 'undefined') {
                                              var tupletNotes = measures[i].notes.slice(j, (j + parseInt(measures[i].tuplets[j])));
                                              var tupletLocation = tupletNotes[0].stem.stem_direction;
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 1 other location - About 1 day to fix
                      public/js/views/ResultView.js on lines 364..375

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

                      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 (var j = 0; j < score.measures[i].notes.length; j++) {
                                      if (score.measures[i].notes[j].pitch && score.measures[i].notes[j].pitch.beam) {
                                          score.measures[i].notes[j].pitch.tuplet = "3";
                                      } else if(score.measures[i].notes[j].pitch) {
                                          score.measures[i].notes[j].pitch.tuplet = false;
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 1 other location - About 7 hrs to fix
                      public/js/views/ResultView.js on lines 410..416

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

                      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

                                                  switch (alter) {
                                                      case -2: note.addAccidental(0, new Vex.Flow.Accidental("bb")); break;
                                                      case -1: note.addAccidental(0, new Vex.Flow.Accidental("b")); break;
                                                      case 1: note.addAccidental(0, new Vex.Flow.Accidental("#")); break;
                                                      case 2: note.addAccidental(0, new Vex.Flow.Accidental("#")); break;
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 1 other location - About 4 hrs to fix
                      public/js/views/ResultView.js on lines 552..557

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

                      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

                          getVexflowKey = function(step, octave, alter) {
                              key = step.toLowerCase();
                              switch (alter) {
                                  case -2:
                                      key += "bb"; break;
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 1 other location - About 3 hrs to fix
                      public/js/views/ResultView.js on lines 774..791

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

                      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

                          getDurationIn64th = function(duration) {
                              switch (duration) {
                                  case "whole":
                                      return 64; break;
                                  case "half":
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 1 other location - About 2 hrs to fix
                      public/js/views/ResultView.js on lines 671..690

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

                      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 (i%2 === 0) {
                                      x = padding;
                                      y = i * (height / 2);
                                  } else {
                                      x = padding + width;
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 1 other location - About 1 hr to fix
                      public/js/views/ResultView.js on lines 306..312

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

                      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

                                                  if (score.measures[i].notes[j].pitch.ties) {
                                                      noteTies = score.measures[i].notes[j].pitch.ties;
                                                  }
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 5 other locations - About 1 hr to fix
                      public/js/views/ResultView.js on lines 533..535
                      public/js/views/ResultView.js on lines 538..540
                      public/js/views/ResultView.js on lines 589..591
                      public/js/views/ScoreView.js on lines 224..226
                      public/js/views/ScoreView.js on lines 272..274

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

                      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

                                              if (score.measures[i].notes[j].pitch.ties) {
                                                  noteTies = score.measures[i].notes[j].pitch.ties;
                                              }
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 5 other locations - About 1 hr to fix
                      public/js/views/ResultView.js on lines 533..535
                      public/js/views/ResultView.js on lines 538..540
                      public/js/views/ResultView.js on lines 589..591
                      public/js/views/ScoreView.js on lines 219..221
                      public/js/views/ScoreView.js on lines 224..226

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

                      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

                                                  if (score.measures[i].notes[j].pitch.tuplet) {
                                                      tuplet = score.measures[i].notes[j].pitch.tuplet;
                                                  }
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 5 other locations - About 1 hr to fix
                      public/js/views/ResultView.js on lines 533..535
                      public/js/views/ResultView.js on lines 538..540
                      public/js/views/ResultView.js on lines 589..591
                      public/js/views/ScoreView.js on lines 219..221
                      public/js/views/ScoreView.js on lines 272..274

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

                      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 (i > 0 && i < measures.length-1) {
                                      staveBar.setBegBarType(Vex.Flow.Barline.type.SINGLE);    // set measure bar line
                                  }
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 1 other location - About 1 hr to fix
                      public/js/views/ResultView.js on lines 333..335

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

                      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

                                  for (var t = 0; t < tuplets.length; t++) {
                                      tuplets[t].setContext(context).draw();
                                  }
                      Severity: Major
                      Found in public/js/views/ScoreView.js and 3 other locations - About 50 mins to fix
                      public/js/views/NotationView.js on lines 132..134
                      public/js/views/NotationView.js on lines 235..237
                      public/js/views/ResultView.js on lines 388..390

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

                      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 (i === measures.length-1) {
                                      staveBar.setEndBarType(Vex.Flow.Barline.type.END);    // set double measure bar line at last measure
                                  }
                      Severity: Minor
                      Found in public/js/views/ScoreView.js and 1 other location - About 45 mins to fix
                      public/js/views/ResultView.js on lines 336..338

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

                      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 (var t2 = 0; t2 < ties.length; t2++) {
                                  ties[t2].setContext(context).draw();
                              }
                      Severity: Minor
                      Found in public/js/views/ScoreView.js and 1 other location - About 40 mins to fix
                      public/js/views/ResultView.js on lines 393..395

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

                      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

                              var voice = new Vex.Flow.Voice({
                                  num_beats: 4,
                                  beat_value: 4,
                                  resolution: Vex.Flow.RESOLUTION
                              });
                      Severity: Minor
                      Found in public/js/views/ScoreView.js and 1 other location - About 30 mins to fix
                      public/js/views/ResultView.js on lines 288..292

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

                      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