freakimkaefig/Music-XML-Analyzer

View on GitHub

Showing 168 of 286 total issues

Method _determineClef has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function _determineClef($xml){
        $clefs = $xml->xpath("//clef");

        $clefsArray = array(
            (object)array("label" => "soprano clef", "value" => 0 ),
Severity: Major
Found in app/controllers/SearchController.php - About 2 hrs to fix

    Function _determineClef has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        private function _determineClef($xml){
            $clefs = $xml->xpath("//clef");
    
            $clefsArray = array(
                (object)array("label" => "soprano clef", "value" => 0 ),
    Severity: Minor
    Found in app/controllers/SearchController.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 NotationView.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Method run has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function run()
          {
              DB::table('results')->delete();
              DB::table('uploads')->delete();
              DB::table('users')->delete();
      Severity: Major
      Found in app/database/seeds/DatabaseSeeder.php - About 2 hrs to fix

        Function getDurationType has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getDurationType($durationFloat) {
                if ($durationFloat == 1){
                    return "whole";
                } elseif ($durationFloat == 0.75) {
                    return "whole";
        Severity: Minor
        Found in app/controllers/ScoreController.php - About 1 hr 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 getDurationType has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getDurationType($durationFloat) {
                if ($durationFloat == 1){
                    return "whole";
                } elseif ($durationFloat == 0.75) {
                    return "whole";
        Severity: Minor
        Found in app/controllers/ResultController.php - About 1 hr 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 DashboardController has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        MusicXMLAnalyzer.DashboardController = function() {
        
            var that = {},
            model = null,
            view = null,
        Severity: Minor
        Found in public/js/controllers/DashboardController.js - About 1 hr to fix

          Function ResultModel has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          MusicXMLAnalyzer.ResultModel = function() {
          
              var that = {},
          
              URL_POST_RESULT_EXTRACT = '/result/extract',
          Severity: Minor
          Found in public/js/models/ResultModel.js - About 1 hr to fix

            Function UploadView has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            MusicXMLAnalyzer.UploadView = function(){
            
                var that = {},
            
                $logMessages = null,
            Severity: Minor
            Found in public/js/views/UploadView.js - About 1 hr 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 _countNoteTypes has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function _countNoteTypes($xml){
                    $notes = $xml->xpath("//note");
            
                    $noteTypesArray = array(
                        (object)array("label" => "whole", "value" => 0 ),
            Severity: Minor
            Found in app/controllers/SearchController.php - About 1 hr to fix

              Method _getKey has 42 lines of code (exceeds 25 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 1 hr to fix

                Function init has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    init = function() {
                        patternView = MusicXMLAnalyzer.PatternView();
                        patternView.init();
                
                        notationView = MusicXMLAnalyzer.NotationView();
                Severity: Minor
                Found in public/js/controllers/PatternController.js - About 1 hr to fix

                  Function DashboardView has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  MusicXMLAnalyzer.DashboardView = function(){
                  
                      var that = {},
                  
                      $logMessages = null,
                  Severity: Minor
                  Found in public/js/views/DashboardView.js - About 1 hr 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 playTune has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          var playTune = function() {
                  
                              if(i < notesToBePlayed.length){
                                  var note = notesToBePlayed[i].note;
                                  // how hard the note gets hit
                  Severity: Minor
                  Found in public/js/controllers/ScoreController.js - About 1 hr to fix

                    Function playTune has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            var playTune = function() {
                    
                                if(i < notesToBePlayed.length){
                                    var note = notesToBePlayed[i].note;
                                    // how hard the note gets hit
                    Severity: Minor
                    Found in public/js/controllers/PatternController.js - About 1 hr 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

                        Function _countNoteTypes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function _countNoteTypes($xml){
                                $notes = $xml->xpath("//note");
                        
                                $noteTypesArray = array(
                                    (object)array("label" => "whole", "value" => 0 ),
                        Severity: Minor
                        Found in app/controllers/SearchController.php - About 1 hr 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 initMeterDistribution has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            initMeterDistribution = function(data) {
                                var data2;
                                if(typeof(data) == 'string'){
                                    data2 = [{label: data, value: 1}];
                                }else{
                        Severity: Minor
                        Found in public/js/views/DashboardView.js - About 1 hr to fix

                          Method postUpload has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function postUpload() {
                                  $user = User::find(Cookie::get('user_id'));
                                  $file = Input::file('file');
                                  if($file) {
                                      $destinationPath = public_path() . '/uploads/' . $user->id . '/';
                          Severity: Minor
                          Found in app/controllers/UploadController.php - About 1 hr to fix

                            Method getDurationType has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function getDurationType($durationFloat) {
                                    if ($durationFloat == 1){
                                        return "whole";
                                    } elseif ($durationFloat == 0.75) {
                                        return "whole";
                            Severity: Minor
                            Found in app/controllers/ScoreController.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language