fulldecent/cameralife

View on GitHub

Showing 110 of 127 total issues

Avoid too many return statements within this method.
Open

            return 'hits';
Severity: Major
Found in sources/Models/Search.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return 'albums.hits';
    Severity: Major
    Found in sources/Models/Search.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return 'hits';
      Severity: Major
      Found in sources/Models/Folder.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return 'hits, photos.id';
        Severity: Major
        Found in sources/Models/Search.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return 'random()';
          Severity: Major
          Found in sources/Models/Search.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return 'albums.id desc';
            Severity: Major
            Found in sources/Models/Search.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return 'photos.id desc';
              Severity: Major
              Found in sources/Models/Search.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return array();
                Severity: Major
                Found in sources/Models/FileStore.php - About 30 mins to fix

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

                      public function handleGet($get, $post, $files, $cookies)
                      {
                          if (Models\User::currentUser($cookies)->authorizationLevel < 5) {
                              throw new \Exception('You are not authorized to view this page');
                          }
                  Severity: Minor
                  Found in sources/Controllers/AdminLogsController.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

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

                      public function render()
                      {
                          ?>
                          <h2>Tag collections</h2>
                          <table class="table">
                  Severity: Minor
                  Found in sources/Views/AllTagCollectionsView.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