freakimkaefig/Music-XML-Analyzer

View on GitHub

Showing 168 of 286 total issues

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

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

        Function playResult has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            playResult = function(){
                var notesToBePlayed = [];
        
                //get notes of current extract:
                var currentResultNotes = JSON.parse($('#extract-carousel').find('div.carousel-inner').find('div.item.active').find('.resultExtract').val());
        Severity: Major
        Found in public/js/controllers/ResultController.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 checkHorizontalArea has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  checkHorizontalArea = function(y) {
              
                      if (y > spaceBetweenLines * 1.25 && y <= spaceBetweenLines * 1.75) {
                          hoveredNote = "b";
                          hoveredOctave = "6";
              Severity: Major
              Found in public/js/views/NotationView.js - About 3 hrs to fix

                Function PatternView has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                Open

                MusicXMLAnalyzer.PatternView = function(){
                
                    var that = {},
                    $modeButtonClass = $(".btn-mode"),
                
                
                Severity: Minor
                Found in public/js/views/PatternView.js - About 3 hrs to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function playPattern has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    playPattern = function() {
                        var notesToBePlayed = [];
                
                        //get notes of current extract:
                        var currentPatternNotes = patternModel.getAllNoteElements();
                Severity: Major
                Found in public/js/controllers/PatternController.js - About 2 hrs to fix

                  Function playScore has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      playScore = function() {
                          var notesToBePlayed = [];
                  
                          //get notes of current score part:
                          // var currentPatternNotes = patternModel.getAllNoteElements();
                  Severity: Major
                  Found in public/js/controllers/ScoreController.js - About 2 hrs to fix

                    Function _generateCSV has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function _generateCSV($user) {
                    
                            // csv variables
                            $seperator = ';';
                            $stringClosing = '"';
                    Severity: Minor
                    Found in app/controllers/DownloadController.php - About 2 hrs to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function initIntervalDistribution has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        initIntervalDistribution = function(data) {
                            $('#bar_intervalDistribution').empty();
                            var containerWidth = $('#bar_intervalDistribution').width() - 30;
                            var margin ={ top:20, right:30, bottom:130, left: 40 },
                                width = containerWidth - margin.left - margin.right,
                    Severity: Major
                    Found in public/js/views/DashboardView.js - About 2 hrs to fix

                      Function initNoteDistribution has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          initNoteDistribution = function(data) {
                              $('#bar_noteDistribution').empty();
                              var containerWidth = $('#bar_noteDistribution').width() - 30;
                              var margin ={ top:20, right:30, bottom:50, left: 40 },
                                  width = containerWidth - margin.left - margin.right,
                      Severity: Major
                      Found in public/js/views/DashboardView.js - About 2 hrs to fix

                        Method _generateCSV has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function _generateCSV($user) {
                        
                                // csv variables
                                $seperator = ';';
                                $stringClosing = '"';
                        Severity: Major
                        Found in app/controllers/DownloadController.php - About 2 hrs to fix

                          Function renderVexFlowNotePreview has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              renderVexFlowNotePreview = function() {
                                  // delete canvas
                                  context.clearRect(0, 0, canvas.width, canvas.height);
                                  stave.setContext(context).draw();
                          
                          
                          Severity: Major
                          Found in public/js/views/NotationView.js - About 2 hrs to fix

                            Function search has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function search($pattern) {
                            
                                    $p = $pattern[0]->notes;
                                    self::$patternArray = array();
                                    self::$results = array();
                            Severity: Minor
                            Found in app/controllers/MelodyController.php - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function search has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function search($pattern) {
                            
                                    $p = $pattern[0]->notes;
                                    self::$patternArray = array();
                                    self::$results = array();
                            Severity: Minor
                            Found in app/controllers/RhythmController.php - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            File DashboardModel.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /** @constructor */
                            MusicXMLAnalyzer.DashboardModel = function(){
                            
                                var that = {},
                            
                            
                            Severity: Minor
                            Found in public/js/models/DashboardModel.js - About 2 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 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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language