freakimkaefig/Music-XML-Analyzer

View on GitHub

Showing 168 of 286 total issues

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

    public function search($pattern) {

        $p = $pattern[0]->notes;
        self::$patternArray = array();
        self::$results = array();
Severity: Major
Found in app/controllers/MelodyController.php - About 7 hrs to fix

    Method generateResultExtract has 188 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function generateResultExtract($upload_id, $part_id, $voice, $startMeasure, $start, $endMeasure, $end) {
            set_time_limit(300);
            $upload = Upload::find($upload_id);
    
            $doc = new DOMDocument();
    Severity: Major
    Found in app/controllers/ResultController.php - About 7 hrs to fix

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

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

        Function _countIntervals has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
        Open

            private function _countIntervals($xml){
                $tonika = array("C" => 0,
                                "D" => 2,
                                "E" => 4,
                                "F" => 5,
        Severity: Minor
        Found in app/controllers/SearchController.php - About 7 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 PatternModel.js has 472 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /** @constructor */
        MusicXMLAnalyzer.PatternModel = function(){
        
            var that = {},
            noteElements = [],
        Severity: Minor
        Found in public/js/models/PatternModel.js - About 7 hrs to fix

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

              _mergeResults = function(resultsArr) {
                  mergedArr = {
                      artist: [],
                      clef: null,
                      count_measures: 0.0,
          Severity: Major
          Found in public/js/models/DashboardModel.js - About 7 hrs to fix

            Method _countIntervals has 173 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function _countIntervals($xml){
                    $tonika = array("C" => 0,
                                    "D" => 2,
                                    "E" => 4,
                                    "F" => 5,
            Severity: Major
            Found in app/controllers/SearchController.php - About 6 hrs 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 ResultController has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                Open

                MusicXMLAnalyzer.ResultController = function(){
                
                    var that = {},
                
                    model = null,
                Severity: Minor
                Found in public/js/controllers/ResultController.js - About 6 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 ResultController has 163 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                MusicXMLAnalyzer.ResultController = function(){
                
                    var that = {},
                
                    model = null,
                Severity: Major
                Found in public/js/controllers/ResultController.js - About 6 hrs to fix

                  Method generateScore has 163 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function generateScore($uploadId, $partId) {
                          $upload = Upload::find($uploadId);
                          if ($upload) {
                              $doc = new DOMDocument();
                              $doc->loadXML($upload->content);
                  Severity: Major
                  Found in app/controllers/ScoreController.php - About 6 hrs to fix

                    Function _determineKey has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function _determineKey($xml){
                            $keys = $xml->xpath("//key");
                            $keysArray = array(
                                (object)array("label" => "C major", "value" => 0 ),
                                (object)array("label" => "G major", "value" => 0 ),
                    Severity: Minor
                    Found in app/controllers/SearchController.php - About 5 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 _determineKey has 140 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function _determineKey($xml){
                            $keys = $xml->xpath("//key");
                            $keysArray = array(
                                (object)array("label" => "C major", "value" => 0 ),
                                (object)array("label" => "G major", "value" => 0 ),
                    Severity: Major
                    Found in app/controllers/SearchController.php - About 5 hrs to fix

                      File DashboardView.js has 389 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

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

                        Function _getKey has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function _getKey($id){
                                $xml = simplexml_load_string(Upload::find($id)->content);
                                $keys = $xml->xpath("//key");
                                $key = $keys[0];
                        
                        
                        Severity: Minor
                        Found in app/controllers/ResultController.php - About 5 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 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

                            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

                              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

                                Severity
                                Category
                                Status
                                Source
                                Language