Showing 2,233 of 2,233 total issues
Function render
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function render($echo = false, $domDocument = null)
{
$isChild = (bool)$domDocument;
if (!$isChild) {
$domDocument = new \DOMDocument("1.0", "utf-8");
- 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
File Paging.php
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace FML\Script\Features;
use FML\Controls\Control;
Method render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($echo = false, $domDocument = null)
{
$isChild = (bool)$domDocument;
if (!$isChild) {
$domDocument = new \DOMDocument("1.0", "utf-8");
Script
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Script
{
/*
* Constants
Function render
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function render(\DOMDocument $domDocument)
{
$domElement = $domDocument->createElement($this->getTagName());
if ($this->controlId) {
$domElement->setAttribute("id", $this->controlId);
- 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
File TMUIProperties.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace FML\XmlRpc;
/**
Function __construct
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($control = null, $keyNameOrCode = null, $rememberState = true)
{
if ($control && !$control instanceof Control) {
// backwards-compatibility - control parameter has been introduced later on
$rememberState = $keyNameOrCode;
- 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
Function render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function render(\DOMDocument $domDocument)
{
$domElement = parent::render($domDocument);
if ($this->default !== null) {
$domElement->setAttribute("default", $this->default);
- 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
Function collect
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function collect()
{
$params = func_get_args();
$scriptFeatures = array();
foreach ($params as $object) {
- 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
Audio
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Audio extends Control implements Playable, Scriptable
{
/**
* @var string $data Data url
Video
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Video extends Control implements Playable, Scriptable
{
/**
* @var string $data Data url
CustomUI
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class CustomUI
{
/**
* @var bool $globalVisible If the UI should be shown at all
Function render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function render(\DOMDocument $domDocument)
{
$domElement = $domDocument->createElement("mood");
if ($this->lightAmbientColor) {
$domElement->setAttribute("LAmbient_LinearRgb", $this->lightAmbientColor);
- 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
Method render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(\DOMDocument $domDocument)
{
$domElement = parent::render($domDocument);
if ($this->default !== null) {
$domElement->setAttribute("default", $this->default);
Method render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(\DOMDocument $domDocument)
{
$domElement = parent::render($domDocument);
if ($this->name) {
$domElement->setAttribute("name", $this->name);
Method render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(\DOMDocument $domDocument)
{
$domElement = $domDocument->createElement("mood");
if ($this->lightAmbientColor) {
$domElement->setAttribute("LAmbient_LinearRgb", $this->lightAmbientColor);
Method render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(\DOMDocument $domDocument)
{
$domElement = $domDocument->createElement($this->getTagName());
if ($this->controlId) {
$domElement->setAttribute("id", $this->controlId);
Avoid excessively long variable names like $skyGradientKeyElement. Keep variable name length under 20. Open
$skyGradientKeyElement = $skyGradientKey->render($domDocument);
- 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 $checkpointListProperties. Keep variable name length under 20. Open
protected $checkpointListProperties = array();
- 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 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++ ) {
}
}
}