Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function render(\DOMDocument $domDocument)
{
$domElement = parent::render($domDocument);
if ($this->style3d) {
$this->style3d->checkId();
- 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
Avoid excessively long variable names like $scriptActionParameters. Keep variable name length under 20. Open
public function setScriptActionParameters(array $scriptActionParameters = null)
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $scriptActionParameters. Keep variable name length under 20. Open
protected $scriptActionParameters = null;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $scriptActionParameters. Keep variable name length under 20. Open
public function setScriptAction($scriptAction, array $scriptActionParameters = null)
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Class constants must be uppercase; expected STYLE_BUTTONNAV but found STYLE_ButtonNav Open
const STYLE_ButtonNav = "ButtonNav";
- Exclude checks
Class constants must be uppercase; expected STYLE_TITLELOGO but found STYLE_Titlelogo Open
const STYLE_Titlelogo = "Titlelogo";
- Exclude checks
Class constants must be uppercase; expected STYLE_BASESTATION but found STYLE_BaseStation Open
const STYLE_BaseStation = "BaseStation";
- Exclude checks
Class constants must be uppercase; expected STYLE_TITLEEDITOR but found STYLE_TitleEditor Open
const STYLE_TitleEditor = "TitleEditor";
- Exclude checks
The closing brace for the class must go on the next line after the body Open
}
- Exclude checks
Class constants must be uppercase; expected STYLE_BASEBOXCASE but found STYLE_BaseBoxCase Open
const STYLE_BaseBoxCase = "BaseBoxCase";
- Exclude checks
Class constants must be uppercase; expected STYLE_TITLELOGO but found STYLE_TitleLogo Open
const STYLE_TitleLogo = "TitleLogo";
- Exclude checks
Class constants must be uppercase; expected STYLE_WINDOW but found STYLE_Window Open
const STYLE_Window = "Window";
- Exclude checks
Class constants must be uppercase; expected STYLE_TITLE but found STYLE_Title Open
const STYLE_Title = "Title";
- Exclude checks
Class constants must be uppercase; expected STYLE_BUTTONBACK but found STYLE_ButtonBack Open
const STYLE_ButtonBack = "ButtonBack";
- Exclude checks
Class constants must be uppercase; expected STYLE_BUTTONH but found STYLE_ButtonH Open
const STYLE_ButtonH = "ButtonH";
- Exclude checks
Class constants must be uppercase; expected STYLE_STATION3X3 but found STYLE_Station3x3 Open
const STYLE_Station3x3 = "Station3x3";
- Exclude checks
Constant STYLE_ButtonH should be defined in uppercase Open
const STYLE_ButtonH = "ButtonH";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_Station3x3 should be defined in uppercase Open
const STYLE_Station3x3 = "Station3x3";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_Title should be defined in uppercase Open
const STYLE_Title = "Title";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_TitleEditor should be defined in uppercase Open
const STYLE_TitleEditor = "TitleEditor";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_Window should be defined in uppercase Open
const STYLE_Window = "Window";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_ButtonNav should be defined in uppercase Open
const STYLE_ButtonNav = "ButtonNav";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_BaseStation should be defined in uppercase Open
const STYLE_BaseStation = "BaseStation";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_Titlelogo should be defined in uppercase Open
const STYLE_Titlelogo = "Titlelogo";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_ButtonBack should be defined in uppercase Open
const STYLE_ButtonBack = "ButtonBack";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_TitleLogo should be defined in uppercase Open
const STYLE_TitleLogo = "TitleLogo";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant STYLE_BaseBoxCase should be defined in uppercase Open
const STYLE_BaseBoxCase = "BaseBoxCase";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Usage of ELSE IF is discouraged; use ELSEIF instead Open
} else if ($this->style3dId) {
- Exclude checks