lib/Ajde/Acl.php

Summary

Maintainability
F
3 days
Test Coverage

Function doValidation has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    public static function doValidation(
        $entity,
        $module,
        $action,
        $extra,
Severity: Minor
Found in lib/Ajde/Acl.php - About 1 day 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 doValidation has 152 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function doValidation(
        $entity,
        $module,
        $action,
        $extra,
Severity: Major
Found in lib/Ajde/Acl.php - About 6 hrs to fix

    File Acl.php has 321 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    class Ajde_Acl extends Ajde_Model
    {
        public static $log = [];
    Severity: Minor
    Found in lib/Ajde/Acl.php - About 3 hrs to fix

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

      class Ajde_Acl extends Ajde_Model
      {
          public static $log = [];
          public static $access = null;
      
      
      Severity: Minor
      Found in lib/Ajde/Acl.php by phpmd

      Method doValidation has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $entity,
              $module,
              $action,
              $extra,
              $ownerCallback = false,
      Severity: Major
      Found in lib/Ajde/Acl.php - About 50 mins to fix

        Method addPermission has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function addPermission($permission, $entity, $usergroup, $module, $action = '*', $extra = '*')
        Severity: Minor
        Found in lib/Ajde/Acl.php - About 45 mins to fix

          Method lookup has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function lookup($usergroup, $entity, $module, $action = '*', $extra = '*', $permission = false)
          Severity: Minor
          Found in lib/Ajde/Acl.php - About 45 mins to fix

            Method removePermission has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $usergroup,
                    $entity,
                    $module,
                    $action = '*',
                    $extra = '*',
            Severity: Minor
            Found in lib/Ajde/Acl.php - About 45 mins to fix

              The method doValidation() has 246 lines of code. Current threshold is set to 100. Avoid really long methods.
              Open

                  public static function doValidation(
                      $entity,
                      $module,
                      $action,
                      $extra,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              The method doValidation() has an NPath complexity of 4212. The configured NPath complexity threshold is 200.
              Open

                  public static function doValidation(
                      $entity,
                      $module,
                      $action,
                      $extra,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              NPathComplexity

              Since: 0.1

              The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

              Example

              class Foo {
                  function bar() {
                      // lots of complicated code
                  }
              }

              Source https://phpmd.org/rules/codesize.html#npathcomplexity

              The method doValidation() has a Cyclomatic Complexity of 25. The configured cyclomatic complexity threshold is 10.
              Open

                  public static function doValidation(
                      $entity,
                      $module,
                      $action,
                      $extra,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CyclomaticComplexity

              Since: 0.1

              Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

              Example

              // Cyclomatic Complexity = 11
              class Foo {
              1   public function example() {
              2       if ($a == $b) {
              3           if ($a1 == $b1) {
                              fiddle();
              4           } elseif ($a2 == $b2) {
                              fiddle();
                          } else {
                              fiddle();
                          }
              5       } elseif ($c == $d) {
              6           while ($c == $d) {
                              fiddle();
                          }
              7        } elseif ($e == $f) {
              8           for ($n = 0; $n < $h; $n++) {
                              fiddle();
                          }
                      } else {
                          switch ($z) {
              9               case 1:
                                  fiddle();
                                  break;
              10              case 2:
                                  fiddle();
                                  break;
              11              case 3:
                                  fiddle();
                                  break;
                              default:
                                  fiddle();
                                  break;
                          }
                      }
                  }
              }

              Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

              Missing class import via use statement (line '145', column '36').
              Open

                      $collection->addFilter(new Ajde_Filter_Where('entity', Ajde_Filter::FILTER_EQUALS, 'model'));
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              Missing class import via use statement (line '148', column '40').
              Open

                          $collection->addFilter(new Ajde_Filter_Where('usergroup', Ajde_Filter::FILTER_EQUALS, $usergroup));
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              Missing class import via use statement (line '150', column '36').
              Open

                      $collection->addFilter(new Ajde_Filter_Where('type', Ajde_Filter::FILTER_EQUALS, $type));
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              The method doValidation has a boolean flag argument $ownerCallback, which is a certain sign of a Single Responsibility Principle violation.
              Open

                      $ownerCallback = false,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              Missing class import via use statement (line '62', column '20').
              Open

                      return new AclModel();
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              Missing class import via use statement (line '155', column '36').
              Open

                      $collection->addFilter(new Ajde_Filter_Where('extra', Ajde_Filter::FILTER_EQUALS, $extra));
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              The method lookup has a boolean flag argument $permission, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public static function lookup($usergroup, $entity, $module, $action = '*', $extra = '*', $permission = false)
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              Missing class import via use statement (line '151', column '36').
              Open

                      $collection->addFilter(new Ajde_Filter_Where('module', Ajde_Filter::FILTER_EQUALS, $model));
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              Missing class import via use statement (line '153', column '40').
              Open

                          $collection->addFilter(new Ajde_Filter_Where('permission', Ajde_Filter::FILTER_EQUALS, $permission));
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              The method doValidation has a boolean flag argument $determineWildcard, which is a certain sign of a Single Responsibility Principle violation.
              Open

                      $determineWildcard = false
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              The method removePermission has a boolean flag argument $permission, which is a certain sign of a Single Responsibility Principle violation.
              Open

                      $permission = false
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              Missing class import via use statement (line '54', column '20').
              Open

                      return new AclCollection();
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              The method getModelActions has a boolean flag argument $permission, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public static function getModelActions($usergroup, $model, $extra = '*', $permission = false)
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              The method doValidation has a boolean flag argument $parentCallback, which is a certain sign of a Single Responsibility Principle violation.
              Open

                      $parentCallback = false,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              The method getModelActionsAsArray has a boolean flag argument $permission, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public static function getModelActionsAsArray($usergroup, $model, $extra = '*', $permission = false)
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              Avoid using static access to class 'Ajde_User' in method 'getUser'.
              Open

                          self::$_user = Ajde_User::getLoggedIn();
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              The method doValidation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                                  } else {
                                      self::$log[] = $key.' match with ACL rule id '.$rule->getPK().' denies access for '.$module.'/'.$action.$extra.' (not logged in)';
                                      $access = false;
                                  }
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method doValidation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                                              } else {
                                                  self::$log[] = $key.' match with ACL rule id '.$rule->getPK().' denies access for '.$module.'/'.$action.$extra.' (owner)';
                                                  // TODO: or inherit?
                                                  $access = false;
                                              }
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method doValidation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              if ($rule->type !== 'public') {
                                  if (self::getUser()) {
                                      switch ($rule->permission) {
                                          case 'deny':
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method doValidation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $rules = self::getAclCollection();
                              $rules->reset();
              
                              //        $moduleActionWhereGroup = new Ajde_Filter_WhereGroup(Ajde_Query::OP_AND);
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method doValidation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                                              } else {
                                                  self::$log[] = $key.' match with ACL rule id '.$rule->getPK().' denies access for '.$module.'/'.$action.$extra.' (parent)';
                                                  // TODO: or inherit?
                                                  $access = false;
                                              }
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method doValidation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
              
                          /*
                           * Allright, this is how things go down here:
                           * We want to check for at least one allowed or owner record in this direction:
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              Avoid unused parameters such as '$uid'.
              Open

                  private static function validateOwner($uid, $gid)
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              Avoid unused parameters such as '$gid'.
              Open

                  private static function validateParent($uid, $gid)
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              Avoid unused private methods such as 'validateParent'.
              Open

                  private static function validateParent($uid, $gid)
                  {
                      return false;
                  }
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              UnusedPrivateMethod

              Since: 0.2

              Unused Private Method detects when a private method is declared but is unused.

              Example

              class Something
              {
                  private function foo() {} // unused
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

              Avoid unused parameters such as '$uid'.
              Open

                  private static function validateParent($uid, $gid)
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              Avoid unused private methods such as 'validateOwner'.
              Open

                  private static function validateOwner($uid, $gid)
                  {
                      return false;
                  }
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              UnusedPrivateMethod

              Since: 0.2

              Unused Private Method detects when a private method is declared but is unused.

              Example

              class Something
              {
                  private function foo() {} // unused
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

              Avoid unused parameters such as '$gid'.
              Open

                  private static function validateOwner($uid, $gid)
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              TODO found
              Open

                                                  // TODO: or inherit?
              Severity: Minor
              Found in lib/Ajde/Acl.php by fixme

              TODO found
              Open

                                                  // TODO: or inherit?
              Severity: Minor
              Found in lib/Ajde/Acl.php by fixme

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                                          case 'own':
                                              if (call_user_func_array($ownerCallback, [$uid, $usergroup])) {
                                                  self::$log[] = $key.' match with ACL rule id '.$rule->getPK().' allows access for '.$module.'/'.$action.$extra.' (owner)';
                                                  $access = true;
                                                  $isWildcard = $rule->extra == '*';
              Severity: Major
              Found in lib/Ajde/Acl.php and 1 other location - About 3 hrs to fix
              lib/Ajde/Acl.php on lines 424..435

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 160.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                                          case 'parent':
                                              if (call_user_func_array($parentCallback, [$uid, $usergroup])) {
                                                  self::$log[] = $key.' match with ACL rule id '.$rule->getPK().' allows access for '.$module.'/'.$action.$extra.' (parent)';
                                                  $access = true;
                                                  $isWildcard = $rule->extra == '*';
              Severity: Major
              Found in lib/Ajde/Acl.php and 1 other location - About 3 hrs to fix
              lib/Ajde/Acl.php on lines 412..423

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 160.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              The property $_aclCollectionCache is not named in camelCase.
              Open

              class Ajde_Acl extends Ajde_Model
              {
                  public static $log = [];
                  public static $access = null;
              
              
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCasePropertyName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name attributes.

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The property $_aclRulesCache is not named in camelCase.
              Open

              class Ajde_Acl extends Ajde_Model
              {
                  public static $log = [];
                  public static $access = null;
              
              
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCasePropertyName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name attributes.

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The class Ajde_Acl is not named in CamelCase.
              Open

              class Ajde_Acl extends Ajde_Model
              {
                  public static $log = [];
                  public static $access = null;
              
              
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCaseClassName

              Since: 0.2

              It is considered best practice to use the CamelCase notation to name classes.

              Example

              class class_name {
              }

              Source

              The property $_user is not named in camelCase.
              Open

              class Ajde_Acl extends Ajde_Model
              {
                  public static $log = [];
                  public static $access = null;
              
              
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCasePropertyName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name attributes.

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The property $_autoloadParents is not named in camelCase.
              Open

              class Ajde_Acl extends Ajde_Model
              {
                  public static $log = [];
                  public static $access = null;
              
              
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCasePropertyName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name attributes.

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The variable $_aclCollectionCache is not named in camelCase.
              Open

                  public static function doValidation(
                      $entity,
                      $module,
                      $action,
                      $extra,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $_aclRulesCache is not named in camelCase.
              Open

                  public static function doValidation(
                      $entity,
                      $module,
                      $action,
                      $extra,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $_aclCollectionCache is not named in camelCase.
              Open

                  public static function doValidation(
                      $entity,
                      $module,
                      $action,
                      $extra,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $_aclRulesCache is not named in camelCase.
              Open

                  public static function doValidation(
                      $entity,
                      $module,
                      $action,
                      $extra,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $_aclCollectionCache is not named in camelCase.
              Open

                  public static function doValidation(
                      $entity,
                      $module,
                      $action,
                      $extra,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $_aclRulesCache is not named in camelCase.
              Open

                  public static function doValidation(
                      $entity,
                      $module,
                      $action,
                      $extra,
              Severity: Minor
              Found in lib/Ajde/Acl.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              There are no issues that match your filters.

              Category
              Status