Showing 434 of 434 total issues
Function getEditor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function getEditor($helper = null, $options = null)
{
/** @var Helper $helper */
if (null === $options) {
$options = [];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The closing brace for the interface must go on the next line after the body Open
Open
}
- Exclude checks
There must be one USE keyword per declaration Open
Open
use XoopsModules\About\{
- Exclude checks
There must be one USE keyword per declaration Open
Open
use XoopsModules\About\{
- Exclude checks
The closing brace for the class must go on the next line after the body Open
Open
}
- Exclude checks
There must be one blank line after the last USE statement; 0 found; Open
Open
use XoopsModules\About\PageHandler;
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
Open
];
- Exclude checks
Scope keyword "public" must be followed by a single space Open
Open
public $dirname;
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
Open
];
- Exclude checks
There must be one blank line after the namespace declaration Open
Open
namespace XoopsModules\About;
- Exclude checks
There must be one blank line after the last USE statement; 3 found; Open
Open
use XoopsModules\About\Helper;
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
Open
];
- Exclude checks
There must be a single space after the USE keyword Open
Open
use Xmf\Module\Admin;
- Exclude checks
There must be one USE keyword per declaration Open
Open
use XoopsModules\About\{
- Exclude checks
Method name "Utility::template_lookup" is not in camel caps format Open
Open
public static function &template_lookup($index_by_page = false)
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
Open
];
- Exclude checks
There must be one blank line after the last USE statement; 0 found; Open
Open
use XoopsModules\About\PageHandler;
- Exclude checks
There must be one blank line after the last USE statement; 0 found; Open
Open
use XoopsModules\About\Helper;
- Exclude checks
Missing class import via use statement (line '56', column '24'). Open
Open
$dirInfo = new \SplFileInfo($old_dir);
- 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 '170', column '24'). Open
Open
$dirInfo = new \SplFileInfo($old_dir);
- 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();
}