The method _load has a boolean flag argument $populate, which is a certain sign of a Single Responsibility Principle violation. Open
protected function _load($sql, $values, $populate = true)
- Read upRead up
- Exclude checks
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 validateAccess has a boolean flag argument $determineWildcard, which is a certain sign of a Single Responsibility Principle violation. Open
public function validateAccess($action, $autoRedirect = true, $determineWildcard = false)
- Read upRead up
- Exclude checks
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 insert has a boolean flag argument $skipBeforeInsert, which is a certain sign of a Single Responsibility Principle violation. Open
public function insert($pkValue = null, $skipBeforeInsert = false)
- Read upRead up
- Exclude checks
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 validateAccess has a boolean flag argument $autoRedirect, which is a certain sign of a Single Responsibility Principle violation. Open
public function validateAccess($action, $autoRedirect = true, $determineWildcard = false)
- Read upRead up
- Exclude checks
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_Acl' in method 'validateAccess'. Open
$access = Ajde_Acl::doValidation('model', $module, $action, $extra, [$this, 'validateOwner'],
[$this, 'validateParent'], $determineWildcard);
- Read upRead up
- Exclude checks
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
Avoid using static access to class 'Ajde_Log' in method 'validationErrorRedirect'. Open
Ajde_Log::_('ACL firewall hit', Ajde_Log::CHANNEL_SECURITY, Ajde_Log::LEVEL_INFORMATIONAL,
implode(PHP_EOL, Ajde_Acl::$log));
- Read upRead up
- Exclude checks
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
Avoid unused parameters such as '$skipBeforeInsert'. Open
public function insert($pkValue = null, $skipBeforeInsert = false)
- Read upRead up
- Exclude checks
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
The class Ajde_Acl_Proxy_Model is not named in CamelCase. Open
abstract class Ajde_Acl_Proxy_Model extends Ajde_Model
{
public $ignoreAccessControl = false;
public $autoRedirect = true;
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
The method _load is not named in camelCase. Open
protected function _load($sql, $values, $populate = true)
{
$return = parent::_load($sql, $values, $populate);
if ($return) {
$this->validateAccess('read');
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}