core/modules/main/MainController.php

Summary

Maintainability
A
0 mins
Test Coverage

beforeInvoke accesses the super-global variable $_GET.
Open

    public function beforeInvoke()
    {
        if (isset($_GET['_route']) && substr($_GET['_route'], 0, 5) == 'admin') {
            Ajde::app()->getDocument()->setLayout(new Ajde_Layout(config('layout.admin')));
        }
Severity: Minor
Found in core/modules/main/MainController.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

beforeInvoke accesses the super-global variable $_GET.
Open

    public function beforeInvoke()
    {
        if (isset($_GET['_route']) && substr($_GET['_route'], 0, 5) == 'admin') {
            Ajde::app()->getDocument()->setLayout(new Ajde_Layout(config('layout.admin')));
        }
Severity: Minor
Found in core/modules/main/MainController.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Missing class import via use statement (line '8', column '55').
Open

            Ajde::app()->getDocument()->setLayout(new Ajde_Layout(config('layout.admin')));
Severity: Minor
Found in core/modules/main/MainController.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

There are no issues that match your filters.

Category
Status