fulldecent/cameralife

View on GitHub

Showing 127 of 127 total issues

Function handleGet has a Cognitive Complexity of 12 (exceeds 5 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: Minor
Found in sources/Controllers/FolderController.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 render has 35 lines of code (exceeds 25 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 1 hr to fix

    Method loginWithAccessCode has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function loginWithAccessCode($code)
        {
            // todo: breaks mvc
            global $_SERVER;
            $cookie = bin2hex(random_bytes(16));
    Severity: Minor
    Found in sources/Models/User.php - About 1 hr to fix

      Method handleGet has 34 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/AdminCommentsController.php - About 1 hr to fix

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

            public function getMediaURL($scale = 'thumbnail')
            {
                $bucket = 'other';
                $path = '';
                if ($scale == 'photo') {
        Severity: Minor
        Found in sources/Models/Photo.php - About 1 hr to fix

          Method update has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function update()
              {
                  //TODO: NEED TEST CASES FOR THIS AND ACTUAL TESTING!!!!!!!
                  // move files / delete files / readd files (undelete) / UTF filenames
                  $retval = array();
          Severity: Minor
          Found in sources/Models/Folder.php - About 1 hr to fix

            Method handleGet has 33 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/AdminController.php - About 1 hr to fix

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

                  public function handleGet($get, $post, $files, $cookies)
                  {
                      $photo = Models\Photo::getPhotoWithID($get['id']);
                      $scale = isset($get['scale']) ? $get['scale'] : null;
                      $extension = $photo->extension;
              Severity: Minor
              Found in sources/Controllers/MediaController.php - About 1 hr to fix

                Method getFileForPhotoWithScale has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static function getFileForPhotoWithScale(Models\Photo $photo, $scale)
                    {
                        $extension = $photo->extension;
                        $bucket = 'other';
                        $path = '';
                Severity: Minor
                Found in sources/Controllers/MediaController.php - About 1 hr to fix

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

                      public function render()
                      {
                          $message = $this->exception->getMessage();
                  
                          echo '<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">';
                  Severity: Minor
                  Found in sources/Views/ExceptionView.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 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function render()
                      {
                          if (!count($this->openGraphsForTop)) {
                          ?>
                              </div>
                  Severity: Minor
                  Found in sources/Views/MainPageView.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 handleGet has a Cognitive Complexity of 11 (exceeds 5 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

                  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 handleGet has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function handleGet($get, $post, $files, $cookies)
                      {
                          $photo = Models\Photo::getPhotoWithID($get['id']);
                          $scale = isset($get['scale']) ? $get['scale'] : null;
                          $extension = $photo->extension;
                  Severity: Minor
                  Found in sources/Controllers/MediaController.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 getFileForPhotoWithScale has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static function getFileForPhotoWithScale(Models\Photo $photo, $scale)
                      {
                          $extension = $photo->extension;
                          $bucket = 'other';
                          $path = '';
                  Severity: Minor
                  Found in sources/Controllers/MediaController.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 getContext has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getContext()
                      {
                          if (!$this->context) {
                              $this->getRelated();
                          }
                  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 handleRequest has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function handleRequest($get, $post, $files, $cookies, $server)
                      {
                          try {
                              $page = isset($get['page']) ? $get['page'] : 'mainPage';
                              $dbIsCurrent = Models\Database::installedSchemaIsCorrectVersion();
                  Severity: Minor
                  Found in sources/Controllers/Controller.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 getDefaultForRecordTypeAndValueField has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static function getDefaultForRecordTypeAndValueField($recordType, $valueField)
                      {
                          switch ($recordType . '_' . $valueField) {
                              case 'photo_description':
                                  $oldvalue = 'unnamed';
                  Severity: Minor
                  Found in sources/Models/AuditTrail.php - About 1 hr to fix

                    Method getFunFacts has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getFunFacts()
                        {
                            if (empty($this->counts)) {
                                $this->getCounts();
                            }
                    Severity: Minor
                    Found in sources/Models/Statistics.php - About 1 hr to fix

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

                          public function render()
                          {
                              ?>
                              <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
                              <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
                      Severity: Minor
                      Found in sources/Views/FooterView.php - About 1 hr to fix

                        Function setupTables has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function setupTables()
                            {
                                empty(self::$pdoConnection) && self::connect();
                                $prefix = self::$prefix;
                        
                        
                        Severity: Minor
                        Found in sources/Models/Database.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