ImpressCMS/impresscms

View on GitHub
htdocs/modules/system/admin/blockspadmin/class/blockspadmin.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

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 getEditItemLink has a boolean flag argument $withimage, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

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 getDeleteItemLink has a boolean flag argument $withimage, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

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 getEditItemLink has a boolean flag argument $onlyUrl, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

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 getDeleteItemLink has a boolean flag argument $userSide, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

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 getDeleteItemLink has a boolean flag argument $onlyUrl, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

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 'icms_ipf_Handler' in method '__construct'.
Open

        icms_ipf_Handler::__construct($db, 'blockspadmin', 'id', 'title', 'description', 'system');

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

Call to undeclared method \SystemBlockspadmin::hideFieldFromForm
Open

        $this->hideFieldFromForm('id');

Call to undeclared method \SystemBlockspadmin::getVar
Open

        $rtn = defined($this->getVar('title')) ? constant($this->getVar('title')) : $this->getVar('title');

Reference to undeclared class \icms_view_block_position_Object
Open

        return parent::getEditItemLink($onlyUrl, $withimage, $userSide);

Call to undeclared method \SystemBlockspadmin::hideFieldFromForm
Open

        $this->hideFieldFromForm('block_default');

Call to undeclared method \SystemBlockspadmin::hideFieldFromForm
Open

        $this->hideFieldFromForm('block_type');

Default value for string $onlyUrl can't be false
Open

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Reference to undeclared property \SystemBlockspadminHandler->db (Did you mean $db)
Open

        $this->table = $this->db->prefix('block_positions');

Static call to undeclared method icms_ipf_Handler::__construct()
Open

        icms_ipf_Handler::__construct($db, 'blockspadmin', 'id', 'title', 'description', 'system');

Call to undeclared method \SystemBlockspadmin::getVar
Open

        if ($this->getVar('block_default') == 1) return "";

Class extends undeclared class \icms_view_block_position_Handler
Open

class SystemBlockspadminHandler extends icms_view_block_position_Handler {

Reference to undeclared class \icms_view_block_position_Object
Open

        return parent::getDeleteItemLink($onlyUrl, $withimage, $userSide);

Parameter $handler has undeclared type \icms_view_block_position_Handler
Open

    public function __construct(& $handler) {

Parameter $db has undeclared type \IcmsDatabase
Open

    public function __construct(& $db) {

Reference to undeclared class \icms_view_block_position_Object
Open

        parent::__construct( $handler );

Class extends undeclared class \icms_view_block_position_Object
Open

class SystemBlockspadmin extends icms_view_block_position_Object {

Default value for string $onlyUrl can't be false
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Call to undeclared method \SystemBlockspadmin::getVar
Open

        if ($this->getVar('block_default') == 1) return "";

Call to method __construct from undeclared class \icms_ipf_Handler
Open

        icms_ipf_Handler::__construct($db, 'blockspadmin', 'id', 'title', 'description', 'system');

Reference to undeclared property \SystemBlockspadminHandler->table
Open

        $this->table = $this->db->prefix('block_positions');

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class SystemBlockspadminHandler extends icms_view_block_position_Handler {

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class SystemBlockspadmin extends icms_view_block_position_Object {

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

    public function __construct(& $db) {

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

Each class must be in a file by itself
Open

class SystemBlockspadminHandler extends icms_view_block_position_Handler {

Incorrect spacing between default value and equals sign for argument "$onlyUrl"; expected 1 but found 0
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Incorrect spacing between argument "$userSide" and equals sign; expected 1 but found 0
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Incorrect spacing between default value and equals sign for argument "$onlyUrl"; expected 1 but found 0
Open

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Incorrect spacing between argument "$withimage" and equals sign; expected 1 but found 0
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Incorrect spacing between default value and equals sign for argument "$withimage"; expected 1 but found 0
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Incorrect spacing between argument "$withimage" and equals sign; expected 1 but found 0
Open

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

The closing brace for the class must go on the next line after the body
Open

}

Incorrect spacing between default value and equals sign for argument "$userSide"; expected 1 but found 0
Open

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Expected 1 blank line at end of file; 2 found
Open

}

Incorrect spacing between default value and equals sign for argument "$withimage"; expected 1 but found 0
Open

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Incorrect spacing between argument "$onlyUrl" and equals sign; expected 1 but found 0
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Incorrect spacing between argument "$onlyUrl" and equals sign; expected 1 but found 0
Open

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Incorrect spacing between default value and equals sign for argument "$userSide"; expected 1 but found 0
Open

    public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Incorrect spacing between argument "$userSide" and equals sign; expected 1 but found 0
Open

    public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {

Inline control structures are not allowed
Open

        if ($this->getVar('block_default') == 1) return "";

Inline control structures are not allowed
Open

        if ($this->getVar('block_default') == 1) return "";

Expected 0 spaces before closing bracket; 1 found
Open

        parent::__construct( $handler );

Space after opening parenthesis of function call prohibited
Open

        parent::__construct( $handler );

There are no issues that match your filters.

Category
Status