freakimkaefig/Music-XML-Analyzer

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

Summary

Maintainability
F
3 wks
Test Coverage

Function ResultView has a Cognitive Complexity of 305 (exceeds 5 allowed). Consider refactoring.
Open

MusicXMLAnalyzer.ResultView = function(){

    var that = {},

    $patternValue = null,
Severity: Minor
Found in public/js/views/ResultView.js - About 6 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 ResultView has 581 lines of code (exceeds 25 allowed). Consider refactoring.
Open

MusicXMLAnalyzer.ResultView = function(){

    var that = {},

    $patternValue = null,
Severity: Major
Found in public/js/views/ResultView.js - About 2 days to fix

    File ResultView.js has 583 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /** @constructor */
    MusicXMLAnalyzer.ResultView = function(){
    
        var that = {},
    
    
    Severity: Major
    Found in public/js/views/ResultView.js - About 1 day to fix

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

          generateVexflowNotes = function(pattern, result) {
              // prepare pattern if no result from ResultController.php
              if (!result) {
                  for (var i = 0; i < pattern.measures.length; i++) {
                      for (var j = 0; j < pattern.measures[i].notes.length; j++) {
      Severity: Major
      Found in public/js/views/ResultView.js - About 6 hrs to fix

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

            renderNotes = function(measures, canvas, renderer, context, stave, pattern) {
        
                // clear canvas
                context.clearRect(0, 0, canvas.width, canvas.height);
        
        
        Severity: Major
        Found in public/js/views/ResultView.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/ResultView.js - About 2 hrs to fix

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

                generateExportPdf = function() {
                    var doc = new jsPDF();
            
                    // add title page
                    doc.setFontSize(36);
            Severity: Minor
            Found in public/js/views/ResultView.js - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                                          if (pattern.measures[i].notes[j].pitch.dot) {
                                              note.addDotToAll();
                                          }
              Severity: Major
              Found in public/js/views/ResultView.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if (pattern.measures[i].notes[j].pitch.beam) {
                                                var beam = pattern.measures[i].notes[j].pitch.beam;
                                                if (beam === "begin" || beam === "continue" || beam === "end") {
                                                    tuplet = "3";
                                                }
                Severity: Major
                Found in public/js/views/ResultView.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/ResultView.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

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

                      Avoid deeply nested control flow statements.
                      Open

                                                  if (pattern.measures[i].notes[j].type === "note") {
                                                      if (!pattern.measures[i].notes[j].pitch.chord) {
                                                          // determine note variables
                                                          var step = pattern.measures[i].notes[j].pitch.step;
                                                          var octave = pattern.measures[i].notes[j].pitch.octave;
                      Severity: Major
                      Found in public/js/views/ResultView.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/ResultView.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if (pattern.measures[i].notes[j].pitch.dot) {
                                                          durationType = 2;
                                                      }
                          Severity: Major
                          Found in public/js/views/ResultView.js - About 45 mins to fix

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

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

                              Avoid deeply nested control flow statements.
                              Open

                                                          if (type === "whole" || type === "half") {
                                                              var keys = ["b/4/d0"];
                                                          } else {
                                                              var keys = ["b/4/d2"];
                                                          }
                              Severity: Major
                              Found in public/js/views/ResultView.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/ResultView.js and 1 other location - About 1 day to fix
                                public/js/views/ScoreView.js on lines 341..400

                                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/ResultView.js and 1 other location - About 1 day to fix
                                public/js/views/ScoreView.js on lines 123..142

                                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/ResultView.js and 1 other location - About 1 day to fix
                                public/js/views/ScoreView.js on lines 146..157

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

                                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/ResultView.js and 1 other location - About 4 hrs to fix
                                public/js/views/ScoreView.js on lines 236..241

                                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

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

                                    addLogMessage = function(msg) {
                                        $('#log' + (resultMessageCounter - 3)).animate({
                                            "marginTop": "-30px"
                                        }, 200);
                                        $logMessages.append('<div id="log' + resultMessageCounter + '"></div>');
                                Severity: Major
                                Found in public/js/views/ResultView.js and 2 other locations - About 4 hrs to fix
                                public/js/views/DashboardView.js on lines 112..125
                                public/js/views/PatternView.js on lines 450..463

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

                                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

                                        window.setTimeout(function() {
                                            addLogMessage("We're working.");
                                            window.setTimeout(function() {
                                                addLogMessage("Please be patient.");
                                                window.setTimeout(function() {
                                Severity: Major
                                Found in public/js/views/ResultView.js and 1 other location - About 4 hrs to fix
                                public/js/views/PatternView.js on lines 395..409

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

                                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/ResultView.js and 1 other location - About 3 hrs to fix
                                public/js/views/ScoreView.js on lines 413..430

                                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/ResultView.js and 1 other location - About 2 hrs to fix
                                public/js/views/ScoreView.js on lines 310..329

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

                                    disposeLogMessages = function() {
                                        window.setTimeout(function() {
                                            $logMessages.animate({
                                                height: 0
                                            },
                                Severity: Major
                                Found in public/js/views/ResultView.js and 3 other locations - About 1 hr to fix
                                public/js/views/DashboardView.js on lines 92..103
                                public/js/views/PatternView.js on lines 430..441
                                public/js/views/UploadView.js on lines 185..196

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

                                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/ResultView.js and 1 other location - About 1 hr to fix
                                public/js/views/ScoreView.js on lines 92..98

                                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 (pattern.measures[i].notes[j].pitch.tuplet) {
                                                                        tuplet = pattern.measures[i].notes[j].pitch.tuplet;
                                                                    }
                                Severity: Major
                                Found in public/js/views/ResultView.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 589..591
                                public/js/views/ScoreView.js on lines 219..221
                                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 (pattern.measures[i].notes[j].pitch.ties) {
                                                                    noteTies = pattern.measures[i].notes[j].pitch.ties;
                                                                }
                                Severity: Major
                                Found in public/js/views/ResultView.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/ScoreView.js on lines 219..221
                                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 (pattern.measures[i].notes[j].pitch.ties) {
                                                                        noteTies = pattern.measures[i].notes[j].pitch.ties;
                                                                    }
                                Severity: Major
                                Found in public/js/views/ResultView.js and 5 other locations - About 1 hr to fix
                                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
                                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/ResultView.js and 1 other location - About 1 hr to fix
                                public/js/views/ScoreView.js on lines 115..117

                                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/ResultView.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/ScoreView.js on lines 170..172

                                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/ResultView.js and 1 other location - About 45 mins to fix
                                public/js/views/ScoreView.js on lines 118..120

                                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/ResultView.js and 1 other location - About 40 mins to fix
                                public/js/views/ScoreView.js on lines 175..177

                                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

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

                                    initLogMessages = function() {
                                        resultMessageCounter = 0;
                                        $logMessages.show();
                                        $logMessages.animate({
                                            height: 100
                                Severity: Minor
                                Found in public/js/views/ResultView.js and 2 other locations - About 35 mins to fix
                                public/js/views/PatternView.js on lines 417..423
                                public/js/views/UploadView.js on lines 171..177

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

                                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/ResultView.js and 1 other location - About 30 mins to fix
                                public/js/views/ScoreView.js on lines 74..78

                                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