AJenbo/agcms

View on GitHub
application/inc/Models/Page.php

Summary

Maintainability
C
1 day
Test Coverage
C
77%

Page has 43 functions (exceeds 20 allowed). Consider refactoring.
Open

class Page extends AbstractRenderable implements InterfaceRichText
{
    use HasIcon;

    /** Table name in database. */
Severity: Minor
Found in application/inc/Models/Page.php - About 5 hrs to fix

    File Page.php has 326 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace App\Models;
    
    use App\Exceptions\Exception;
    Severity: Minor
    Found in application/inc/Models/Page.php - About 3 hrs to fix

      The class Page has an overall complexity of 60 which is very high. The configured complexity threshold is 50.
      Open

      class Page extends AbstractRenderable implements InterfaceRichText
      {
          use HasIcon;
      
          /** Table name in database. */
      Severity: Minor
      Found in application/inc/Models/Page.php by phpmd

      Avoid variables with short names like $db. Configured minimum length is 3.
      Open

              $db = app(DbService::class);
      Severity: Minor
      Found in application/inc/Models/Page.php by phpmd

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Avoid variables with short names like $db. Configured minimum length is 3.
      Open

              $db = app(DbService::class);
      Severity: Minor
      Found in application/inc/Models/Page.php by phpmd

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Avoid variables with short names like $db. Configured minimum length is 3.
      Open

              $db = app(DbService::class);
      Severity: Minor
      Found in application/inc/Models/Page.php by phpmd

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Line exceeds 120 characters; contains 131 characters
      Open

              app(DbService::class)->query('DELETE FROM `bind` WHERE `side` = ' . $this->getId() . ' AND `kat` = ' . $category->getId());

      There are no issues that match your filters.

      Category
      Status