Missing class import via use statement (line '61', column '24'). Open
$CFG = new MX_Config;
- Read upRead up
- Exclude checks
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 '58', column '25'). Open
$LANG = new MX_Lang;
- Read upRead up
- Exclude checks
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 'CI_Controller' in method '__construct'. Open
self::$APP = CI_Controller::get_instance();
- Read upRead up
- Exclude checks
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
Saw unextractable annotation for comment '* @method __construct'
Open
* @method __construct
- Exclude checks
The phpdoc comment for @method
cannot occur on a method
Open
* @method __construct
- Exclude checks
Call to method get_instance
from undeclared class \CI_Controller
(Did you mean class \MX_Controller) Open
self::$APP = CI_Controller::get_instance();
- Exclude checks
Class \CI
defined at /code/third_party/MX/Ci.php:39
was previously defined as Class \CI
at /code/third_party/MX/Base.php:40
Open
class CI
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class CI
- Exclude checks
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 39 and the first side effect is on line 1. Open
<?php defined('BASEPATH') or exit('No direct script access allowed');
- Exclude checks
Avoid classes with short names like CI. Configured minimum length is 3. Open
class CI
{
public static $APP;
/**
- Read upRead up
- Exclude checks
ShortClassName
Since: 2.9
Detects when classes or interfaces have a very short name.
Example
class Fo {
}
interface Fo {
}
Source https://phpmd.org/rules/naming.html#shortclassname
The variable $LANG is not named in camelCase. Open
public function __construct()
{
// assign the application instance
self::$APP = CI_Controller::get_instance();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $LANG is not named in camelCase. Open
public function __construct()
{
// assign the application instance
self::$APP = CI_Controller::get_instance();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $CFG is not named in camelCase. Open
public function __construct()
{
// assign the application instance
self::$APP = CI_Controller::get_instance();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $CFG is not named in camelCase. Open
public function __construct()
{
// assign the application instance
self::$APP = CI_Controller::get_instance();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $CFG is not named in camelCase. Open
public function __construct()
{
// assign the application instance
self::$APP = CI_Controller::get_instance();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $LANG is not named in camelCase. Open
public function __construct()
{
// assign the application instance
self::$APP = CI_Controller::get_instance();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}