qcubed/framework

View on GitHub
assets/php/examples/basic_ajax/wait_icon.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $this->btnButton->AddAction(new QClickEvent(), new QAjaxAction('btnButton_Click'));

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 '15', column '27').
Open

        $this->lblMessage = new QLabel($this);

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 '19', column '26').
Open

        $this->btnButton = new QButton($this);

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 '21', column '27').
Open

        $this->btnButton2 = new QButton($this);

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 '25', column '35').
Open

        $this->objDefaultWaitIcon = new QWaitIcon($this);

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 '28', column '35').
Open

        $this->btnButton->AddAction(new QClickEvent(), new QAjaxAction('btnButton_Click'));

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 '31', column '55').
Open

        $this->btnButton2->AddAction(new QClickEvent(), new QAjaxAction('btnButton_Click', null));

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 '31', column '36').
Open

        $this->btnButton2->AddAction(new QClickEvent(), new QAjaxAction('btnButton_Click', null));

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 btnButton_Click uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $this->lblMessage->Text = $strMessage;
        }

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 '$strFormId'.
Open

    protected function btnButton_Click($strFormId, $strControlId, $strParameter) {

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 '$strParameter'.
Open

    protected function btnButton_Click($strFormId, $strControlId, $strParameter) {

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 '$strControlId'.
Open

    protected function btnButton_Click($strFormId, $strControlId, $strParameter) {

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 method Form_Create is not named in camelCase.
Open

    protected function Form_Create() {
        // Define the Label
        $this->lblMessage = new QLabel($this);
        $this->lblMessage->Text = 'Click the button to change my message.';

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method btnButton_Click is not named in camelCase.
Open

    protected function btnButton_Click($strFormId, $strControlId, $strParameter) {
        $strMessage = 'Hello, world!';
        // Let's add artificial latency/wait to show the spinner
        sleep(1);
        if ($this->lblMessage->Text == $strMessage){

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status