freakimkaefig/Music-XML-Analyzer

View on GitHub

Showing 286 of 286 total issues

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

        svg.selectAll(".bar")
           .data(data)
           .enter()
           .append("rect")
           .attr("class", "bar")
Severity: Major
Found in public/js/views/DashboardView.js and 1 other location - About 5 hrs to fix
public/js/views/DashboardView.js on lines 394..402

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

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

Function ScoreController has 131 lines of code (exceeds 25 allowed). Consider refactoring.
Open

MusicXMLAnalyzer.ScoreController = function(){

    var that = {},

    view = null,
Severity: Major
Found in public/js/controllers/ScoreController.js - About 5 hrs to fix

    Function UploadView has 124 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    MusicXMLAnalyzer.UploadView = function(){
    
        var that = {},
    
        $logMessages = null,
    Severity: Major
    Found in public/js/views/UploadView.js - About 4 hrs to fix

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

                 svg.selectAll("text.bar")
                  .data(data)
                  .enter()
                  .append("text")
                  .attr("class", "bar-value")
      Severity: Major
      Found in public/js/views/DashboardView.js and 1 other location - About 4 hrs to fix
      public/js/views/DashboardView.js on lines 310..319

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

      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

                 svg.selectAll("text.bar")
                  .data(data)
                  .enter()
                  .append("text")
                  .attr("class", "bar-value")
      Severity: Major
      Found in public/js/views/DashboardView.js and 1 other location - About 4 hrs to fix
      public/js/views/DashboardView.js on lines 404..413

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

      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

      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

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

          private function getDurationType($durationFloat) {
              if ($durationFloat == 1){
                  return "whole";
              } elseif ($durationFloat == 0.75) {
                  return "whole";
      Severity: Major
      Found in app/controllers/ScoreController.php and 1 other location - About 4 hrs to fix
      app/controllers/ResultController.php on lines 365..398

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

      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

          private function getDurationType($durationFloat) {
              if ($durationFloat == 1){
                  return "whole";
              } elseif ($durationFloat == 0.75) {
                  return "whole";
      Severity: Major
      Found in app/controllers/ResultController.php and 1 other location - About 4 hrs to fix
      app/controllers/ScoreController.php on lines 256..289

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

      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

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

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

      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

      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/PatternView.js and 2 other locations - About 4 hrs to fix
      public/js/views/DashboardView.js on lines 112..125
      public/js/views/ResultView.js on lines 863..876

      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

      File ResultController.php has 345 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * Controller to handle result requests
       * Generating result extracts for search results
      Severity: Minor
      Found in app/controllers/ResultController.php - About 4 hrs to fix

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

                var svg = d3.select("#bar_noteDistribution")
                              .append("svg")  //append svg element inside #bar_noteDistribution
                              .attr("width", width+(2*margin.left)+margin.right)    //set width
                              .attr("height", height+margin.top+margin.bottom)  //set height
                              .append("g")
        Severity: Major
        Found in public/js/views/DashboardView.js and 1 other location - About 4 hrs to fix
        public/js/views/DashboardView.js on lines 354..359

        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

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

        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

                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

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

                var svg = d3.select("#bar_intervalDistribution")
                              .append("svg")  //append svg element inside #bar_intervalDistribution
                              .attr("width", width+(2*margin.left)+margin.right)    //set width
                              .attr("height", height+margin.top+margin.bottom)  //set height
                              .append("g")
        Severity: Major
        Found in public/js/views/DashboardView.js and 1 other location - About 4 hrs to fix
        public/js/views/DashboardView.js on lines 263..268

        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

        Method search has 105 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function search($pattern) {
        
                $p = $pattern[0]->notes;
        
                self::$patternIntervalArray = array();
        Severity: Major
        Found in app/controllers/SoundSequenzController.php - About 4 hrs to fix

          Function _countNoteValues has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _countNoteValues($xml){
                  $notes = $xml->xpath("//note");
          
                  $notesArray = array(
                      (object)array("label" => "B", "value" => 0 ),
          Severity: Minor
          Found in app/controllers/SearchController.php - About 4 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Method _countNoteValues has 98 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function _countNoteValues($xml){
                  $notes = $xml->xpath("//note");
          
                  $notesArray = array(
                      (object)array("label" => "B", "value" => 0 ),
          Severity: Major
          Found in app/controllers/SearchController.php - About 3 hrs to fix
            Severity
            Category
            Status
            Source
            Language