midasplatform/Midas

View on GitHub
core/AppForm.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class 'Zend_Controller_Front' in method '__construct'.
Open

        $fc = Zend_Controller_Front::getInstance();
Severity: Minor
Found in core/AppForm.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 'Zend_Loader' in method 't'.
Open

        Zend_Loader::loadClass('InternationalizationComponent', BASE_PATH.'/core/controllers/components');
Severity: Minor
Found in core/AppForm.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 'InternationalizationComponent' in method 't'.
Open

        return InternationalizationComponent::translate($text);
Severity: Minor
Found in core/AppForm.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 short method names like AppForm::t(). The configured minimum method name length is 3.
Open

    protected function t($text)
    {
        Zend_Loader::loadClass('InternationalizationComponent', BASE_PATH.'/core/controllers/components');

        return InternationalizationComponent::translate($text);
Severity: Minor
Found in core/AppForm.php by phpmd

ShortMethodName

Since: 0.2

Detects when very short method names are used.

Example

class ShortMethod {
    public function a( $index ) { // Violation
    }
}

Source https://phpmd.org/rules/naming.html#shortmethodname

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

class AppForm
Severity: Minor
Found in core/AppForm.php by phpcodesniffer

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

        $fc = Zend_Controller_Front::getInstance();
Severity: Minor
Found in core/AppForm.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