qcubed/framework

View on GitHub
sample.php

Summary

Maintainability
A
2 hrs
Test Coverage

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

            $this->btnButton->AddAction(new QClickEvent(), new QServerAction('btnButton_Click'));
Severity: Minor
Found in sample.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 '20', column '55').
Open

            $this->btnButton->AddAction(new QClickEvent(), new QServerAction('btnButton_Click'));
Severity: Minor
Found in sample.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 '15', column '28').
Open

            $this->lblMessage = new QLabel($this);
Severity: Minor
Found in sample.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 '18', column '27').
Open

            $this->btnButton = new QButton($this);
Severity: Minor
Found in sample.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

Avoid unused parameters such as '$strFormId'.
Open

        protected function btnButton_Click($strFormId, $strControlId, $strParameter) {
Severity: Minor
Found in sample.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 '$strControlId'.
Open

        protected function btnButton_Click($strFormId, $strControlId, $strParameter) {
Severity: Minor
Found in sample.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 '$strParameter'.
Open

        protected function btnButton_Click($strFormId, $strControlId, $strParameter) {
Severity: Minor
Found in sample.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

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

<?php
    /**
     * This is a standard, sample QForm which you can use as a starting
     * point to build any QForm page that you wish.
     */
Severity: Major
Found in sample.php and 2 other locations - About 2 hrs to fix
assets/php/examples/basic_ajax/intro.php on lines 1..35
assets/php/examples/basic_qform/intro.php on lines 1..41

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 141.

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

        protected function btnButton_Click($strFormId, $strControlId, $strParameter) {
            $this->lblMessage->Text = 'Hello, World!';
        }
Severity: Minor
Found in sample.php by phpmd

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

        protected function Form_Create() {
            $this->lblMessage = new QLabel($this);
            $this->lblMessage->Text = 'Click the button to change my message.';
            
            $this->btnButton = new QButton($this);
Severity: Minor
Found in sample.php by phpmd

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