lib/Ajde/Resource/Qrcode.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using undefined variables such as '$t' which will lead to PHP notices.
Open

        $qr = new self($t);
Severity: Minor
Found in lib/Ajde/Resource/Qrcode.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using static access to class 'QRcode' in method 'write'.
Open

        QRcode::png($this->_text, false, QR_ECLEVEL_M, 6 /* = size */, 0 /* = margin */);
Severity: Minor
Found in lib/Ajde/Resource/Qrcode.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 unused local variables such as '$t'.
Open

        $qr = new self($t);
Severity: Minor
Found in lib/Ajde/Resource/Qrcode.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

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

        $qr = new self($t);
Severity: Minor
Found in lib/Ajde/Resource/Qrcode.php by phpmd

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

The class Ajde_Resource_Qrcode is not named in CamelCase.
Open

class Ajde_Resource_Qrcode extends Ajde_Resource
{
    protected $_text;

    public function __construct($text)
Severity: Minor
Found in lib/Ajde/Resource/Qrcode.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The property $_text is not named in camelCase.
Open

class Ajde_Resource_Qrcode extends Ajde_Resource
{
    protected $_text;

    public function __construct($text)
Severity: Minor
Found in lib/Ajde/Resource/Qrcode.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

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

        $qr = new self($t);
Severity: Minor
Found in lib/Ajde/Resource/Qrcode.php by phpmd

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

There are no issues that match your filters.

Category
Status