fulldecent/cameralife

View on GitHub

Showing 110 of 127 total issues

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

    public function render()
    {
        echo "<h2>Settings for " . $this->moduleName . "</h2>\n";
        if (isset($module->about)) {
            echo "<p class=\"lead\">" . $module->about . "</p>\n";
Severity: Major
Found in sources/Views/AdminPreferencesView.php - About 2 hrs to fix

    File Folder.php has 270 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    namespace CameraLife\Models;
    
    /**
     * Folder class.
    Severity: Minor
    Found in sources/Models/Folder.php - About 2 hrs to fix

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

          public function resize($filename, $newSize, $quality = 91)
          {
              $baseImage = $this->originalImage;
              $baseSize = $this->size;
      
      
      Severity: Minor
      Found in sources/Models/Image.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

      Method render has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render()
          {
              echo "<h2>Site comments review</h2>";
              echo "<p class=\"lead\">";
              if ($this->checkpointId > 0) {
      Severity: Major
      Found in sources/Views/AdminCommentsView.php - About 2 hrs to fix

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

            public function render()
            {
                if ($this->photo->get('status') != 0) {
                    echo '<p class="alert alert-danger lead"><strong>Notice:</strong> This photo is not publicly viewable</p>';
                }
        Severity: Minor
        Found in sources/Views/PhotoView.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

        Method handleGet has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function handleGet($get, $post, $files, $cookies)
            {
                $start = isset($get['start']) ? $get['start'] : 0;
                $section = isset($get['section']) ? $get['section'] : null;
                $this->model->setPage($start);
        Severity: Major
        Found in sources/Controllers/FolderController.php - About 2 hrs to fix

          Method handleGet has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function handleGet($get, $post, $files, $cookies)
              {
                  $this->htmlHeader($cookies);
          
                  /* Set up the page view */
          Severity: Major
          Found in sources/Controllers/MainPageController.php - About 2 hrs to fix

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

                public function render()
                {
                    echo '<div>' . PHP_EOL;
                    foreach ($this->openGraphObjects as $view) {
                        $openGraphObject = $view;
            Severity: Minor
            Found in sources/Views/GridView.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

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

                public function handleGet($get, $post, $files, $cookies)
                {
                    $this->htmlHeader($cookies);
            
                    /* Set up the page view */
            Severity: Major
            Found in sources/Controllers/AllTagCollectionsController.php - About 2 hrs to fix

              Method handleGet has 51 lines of code (exceeds 25 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: Major
              Found in sources/Controllers/AdminLogsController.php - About 2 hrs to fix

                Method resize has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function resize($filename, $newSize, $quality = 91)
                    {
                        $baseImage = $this->originalImage;
                        $baseSize = $this->size;
                
                
                Severity: Minor
                Found in sources/Models/Image.php - About 1 hr to fix

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

                      public function getRelated()
                      {
                          //todo pass in referrer
                          global $_SERVER;
                          $retval = array($this->getFolder());
                  Severity: Minor
                  Found in sources/Models/Photo.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 render has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function render()
                      {
                          $start = $this->start;
                          $total = $this->total;
                          $perPage = $this->perPage;
                  Severity: Minor
                  Found in sources/Views/PageSelectorView.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 checkPrerequesites has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function checkPrerequesites()
                      {
                          global $_SERVER;
                          $prerequesitesAreMet = true;
                  
                  
                  Severity: Minor
                  Found in sources/Controllers/SetupInstallController.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

                  Method handleGet has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function handleGet($get, $post, $files, $cookies)
                      {
                          $photoCount = $this->model->getPhotoCount();
                          $folderCount = $this->model->getFolderCount();
                          $albumCount = $this->model->getTagCount();
                  Severity: Minor
                  Found in sources/Controllers/SearchController.php - About 1 hr to fix

                    Method handleGet has 45 lines of code (exceeds 25 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/AdminThumbnailController.php - About 1 hr to fix

                      Method findChangesOnDisk has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function findChangesOnDisk()
                          {
                              $retval = array();
                      
                              $fileStore = FileStore::fileStoreWithName('photo');
                      Severity: Minor
                      Found in sources/Models/Folder.php - About 1 hr to fix

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

                            public function handleGet($get, $post, $files, $cookies)
                            {
                                $nextInstaller = null;
                                if (!Models\Database::installedSchemaIsCorrectVersion()) {
                                    $driver = Models\Database::driverName();
                        Severity: Minor
                        Found in sources/Controllers/SetupUpgradeController.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 handlePost has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function handlePost($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/AdminFileStoreController.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 handlePost has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function handlePost($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/AdminAppearanceController.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

                        Severity
                        Category
                        Status
                        Source
                        Language