lib/Ajde/Application.php

Summary

Maintainability
A
1 hr
Test Coverage

Method run has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        // For debugger
        $this->addTimer('<i>Application</i>');

Severity: Minor
Found in lib/Ajde/Application.php - About 1 hr to fix

    Missing class import via use statement (line '78', column '25').
    Open

            $response = new Ajde_Http_Response();
    Severity: Minor
    Found in lib/Ajde/Application.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 '86', column '26').
    Open

            $bootstrap = new Ajde_Core_Bootstrap();
    Severity: Minor
    Found in lib/Ajde/Application.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 using static access to class 'Ajde_Cache' in method 'run'.
    Open

            $cache = Ajde_Cache::getInstance();
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Controller' in method 'run'.
    Open

            $controller = Ajde_Controller::fromRoute($route);
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterBootstrap');
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Document' in method 'run'.
    Open

            $document = Ajde_Document::fromRoute($route);
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterDocumentCreated');
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterResponseSent');
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterRouteInitialized');
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterControllerInvoked');
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Http_Request' in method 'loadRequest'.
    Open

            $request = Ajde_Http_Request::fromGlobal();
    Severity: Minor
    Found in lib/Ajde/Application.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

    The method routingError uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                if (class_exists('Ajde_Exception_Log')) {
                    Ajde_Exception_Log::logException($exception);
                }
                Ajde_Http_Response::redirectNotFound();
    Severity: Minor
    Found in lib/Ajde/Application.php by phpmd

    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 using static access to class 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterResponseCreated');
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterRequestCreated');
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Http_Response' in method 'routingError'.
    Open

                Ajde_Http_Response::redirectNotFound();
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Exception_Log' in method 'routingError'.
    Open

                    Ajde_Exception_Log::logException($exception);
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterResponseSaved');
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterDocumentRendered');
    Severity: Minor
    Found in lib/Ajde/Application.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 'Ajde_Event' in method 'run'.
    Open

            Ajde_Event::trigger($this, 'onAfterControllerCreated');
    Severity: Minor
    Found in lib/Ajde/Application.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

    The class Ajde_Application is not named in CamelCase.
    Open

    class Ajde_Application extends Ajde_Object_Singleton
    {
        protected $_timers = [];
        protected $_timerLevel = 0;
    
    
    Severity: Minor
    Found in lib/Ajde/Application.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 $_timers is not named in camelCase.
    Open

    class Ajde_Application extends Ajde_Object_Singleton
    {
        protected $_timers = [];
        protected $_timerLevel = 0;
    
    
    Severity: Minor
    Found in lib/Ajde/Application.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

    The property $_timerLevel is not named in camelCase.
    Open

    class Ajde_Application extends Ajde_Object_Singleton
    {
        protected $_timers = [];
        protected $_timerLevel = 0;
    
    
    Severity: Minor
    Found in lib/Ajde/Application.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

    There are no issues that match your filters.

    Category
    Status