freakimkaefig/Music-XML-Analyzer

View on GitHub

Showing 168 of 286 total issues

Avoid too many return statements within this method.
Open

            return "16th";
Severity: Major
Found in app/controllers/ResultController.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    case "-3": return "E flat major"; break;
    Severity: Major
    Found in app/controllers/ResultController.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      case "-6": return "E flat minor"; break;
      Severity: Major
      Found in app/controllers/ResultController.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return "32nd";
        Severity: Major
        Found in app/controllers/ScoreController.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return "eighth";
          Severity: Major
          Found in app/controllers/ResultController.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            case "5": return "H major"; break;
            Severity: Major
            Found in app/controllers/ResultController.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return "64th";    // set to lowest possible value
              Severity: Major
              Found in app/controllers/ScoreController.php - About 30 mins to fix

                Function _determineInstruments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function _determineInstruments($xml){
                        $instruments = $xml->xpath("//score-part");
                        $instrumentsArray = array();
                
                        foreach($instruments as $instrument){
                Severity: Minor
                Found in app/controllers/SearchController.php - About 25 mins 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