Showing 1,792 of 1,794 total issues

Avoid unused parameters such as '$field'.
Open

    public function getHtmlTags(Model $row, ?Field $field): array
Severity: Minor
Found in src/Table/Column/Link.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 using static access to class '\Closure' in method 'cloneColumnView'.
Open

        $view->name = \Closure::bind(static fn (Table $table) => $view->_shorten($table->name, $view->shortName, null), null, Table::class)($this->table);
Severity: Minor
Found in src/Table/Column.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

Avoid using static access to class 'Atk4\Ui\JsCallback' in method 'resizableColumn'.
Open

            $cb = JsCallback::addTo($this);
Severity: Minor
Found in src/Table.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 renderView() has an NPath complexity of 1200. The configured NPath complexity threshold is 200.
Open

    protected function renderView(): void
    {
        if (!$this->columns) {
            throw (new Exception('Table does not have any columns defined'))
                ->addMoreInfo('columns', $this->columns);
Severity: Minor
Found in src/Table.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

Avoid using static access to class '\Atk4\Core\Factory' in method 'initTable'.
Open

        $table = $this->container->add(Factory::factory([Table::class, 'class.very compact very basic striped single line' => true, 'reload' => $this->container], $this->table), 'Table');
Severity: Minor
Found in src/Grid.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

Avoid using static access to class 'Atk4\Ui\View' in method 'renderView'.
Open

        View::renderView();
Severity: Minor
Found in src/Table.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

Avoid using static access to class 'Atk4\Ui\Button' in method 'addButton'.
Open

        return Button::addTo($this->menu->addItem(), [$label]);
Severity: Minor
Found in src/Grid.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

Avoid using static access to class 'Atk4\Ui\JsSearch' in method 'addQuickSearch'.
Open

        $this->quickSearch = JsSearch::addTo($view, ['reload' => $this->container, 'autoQuery' => $hasAutoQuery]);
Severity: Minor
Found in src/Grid.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 addExecutorButton uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $button = $this->getExecutorFactory()->createTrigger($executor->getAction(), ExecutorFactory::TABLE_BUTTON);
        }
Severity: Minor
Found in src/Grid.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 '$args'.
Open

    public function addBulkAction($item, \Closure $callback, $args = [])
Severity: Minor
Found in src/Grid.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 using static access to class '\Closure' in method 'parseTemplate'.
Open

            \Closure::bind(static function () use ($tagTrees, $parentTemplate) {
                foreach ($tagTrees as $tagTree) {
                    $tagTree->parentTemplate = $parentTemplate;
                }
            }, null, TagTree::class)();
Severity: Minor
Found in src/HtmlTemplate.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

Avoid using static access to class 'Atk4\Ui\JsPaginator' in method 'addJsPaginator'.
Open

        $this->jsPaginator = JsPaginator::addTo($this, ['view' => $container, 'options' => $options]);
Severity: Minor
Found in src/Lister.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

Avoid using static access to class 'Atk4\Ui\Text' in method 'init'.
Open

                $this->text = Text::addTo($this, [$this->text]);
Severity: Minor
Found in src/Message.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 renderView uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // fix top modal corner rounding, first div must not be empty (must not be lower than 5px)
            // https://github.com/fomantic/Fomantic-UI/blob/2.9.0/src/definitions/modules/modal.less#L43
            $this->template->loadFromString(preg_replace('~<div class="\{\$headerClass\}">\{\$title\}</div>\s*~', '', $this->template->toLoadableString(), 1));
        }
Severity: Minor
Found in src/Modal.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 using static access to class 'Atk4\Ui\Table\Column' in method 'addDecorator'.
Open

        $decorator = $this->_addUnchecked(Table\Column::fromSeed($seed, ['table' => $this]));
Severity: Minor
Found in src/Table.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 renderView uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $this->renderItem($tItem, $item);
            }
Severity: Minor
Found in src/Paginator.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 using static access to class 'Atk4\Ui\Panel\Content' in method 'addDynamicContent'.
Open

        $this->dynamicContent = Content::addTo($this, [], ['LoadContent']);
Severity: Minor
Found in src/Panel/Right.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

Avoid using static access to class '\Atk4\Core\Factory' in method 'addConfirmation'.
Open

        $this->closeModal->addButtonAction(Factory::factory($okButton));
Severity: Minor
Found in src/Panel/Right.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

Avoid using static access to class '\Atk4\Data\Persistence\Sql\Expression' in method '_typecastSaveField'.
Open

                    : Expression::castFloatToString($value);
Severity: Minor
Found in src/Persistence/Ui.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 _typecastLoadField() has 105 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    protected function _typecastLoadField(Field $field, $value)
    {
        switch ($field->type) {
            case 'boolean':
                if (is_string($value)) {
Severity: Minor
Found in src/Persistence/Ui.php by phpmd
Severity
Category
Status
Source
Language