elboletaire/less-cake-plugin

View on GitHub
tests/TestCase/View/Helper/LessHelperTest.php

Summary

Maintainability
A
1 hr
Test Coverage

Method testLess has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testLess()
    {
        $options = [
            'cache' => false,
            'parser' => ['sourceMap' => false]
Severity: Minor
Found in tests/TestCase/View/Helper/LessHelperTest.php - About 1 hr to fix

    Missing class import via use statement (line '246', column '22').
    Open

            $class = new \ReflectionClass('Less\View\Helper\LessHelper');

    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 using static access to class '\Cake\Core\Configure' in method 'testLessWithNotExistingFiles'.
    Open

            Configure::write('debug', 0);

    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 '\Cake\Core\Configure' in method 'testLessDefaultOptions'.
    Open

            Configure::write('debug', 0);

    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 '\Cake\Core\Configure' in method 'testLessEnablesSourceMap'.
    Open

            Configure::write('debug', 1);

    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 '\Cake\Core\Configure' in method 'testLessWithNotExistingFiles'.
    Open

            Configure::write('debug', 1);

    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 '\Cake\Core\Configure' in method 'testLessReturnsJsBlockIfDevelopmentEnabled'.
    Open

            Configure::write('debug', 0);

    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

    TODO found
    Open

            // TODO

    There are no issues that match your filters.

    Category
    Status