ForgetState accesses the super-global variable $_SESSION. Open
public function ForgetState() {
if (defined ('__SESSION_SAVED_STATE__')) {
$formName = get_class($this->objForm);
unset($_SESSION[__SESSION_SAVED_STATE__][$formName][$this->ControlId]);
}
- Read upRead up
- Exclude checks
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
_ReadState accesses the super-global variable $_SESSION. Open
public function _ReadState() {
if (defined ('__SESSION_SAVED_STATE__') && $this->blnSaveState) {
$formName = get_class($this->objForm);
if (isset ($_SESSION[__SESSION_SAVED_STATE__][$formName][$this->ControlId])) {
$state = $_SESSION[__SESSION_SAVED_STATE__][$formName][$this->ControlId];
- Read upRead up
- Exclude checks
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
_ReadState accesses the super-global variable $_SESSION. Open
public function _ReadState() {
if (defined ('__SESSION_SAVED_STATE__') && $this->blnSaveState) {
$formName = get_class($this->objForm);
if (isset ($_SESSION[__SESSION_SAVED_STATE__][$formName][$this->ControlId])) {
$state = $_SESSION[__SESSION_SAVED_STATE__][$formName][$this->ControlId];
- Read upRead up
- Exclude checks
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
_WriteState accesses the super-global variable $_SESSION. Open
public function _WriteState() {
global $_FORM;
assert ($_FORM !== null);
if (defined ('__SESSION_SAVED_STATE__') && $this->blnSaveState) {
- Read upRead up
- Exclude checks
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
File QControlBase.class.php
has 1201 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* QControlBase is the base class of all QControls and shares their common properties.
*
* Not every control will utilize every single one of these properties.
QControlBase
has 96 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class QControlBase extends QHtmlAttributeManager {
/*
* Constannts
*/
Function __set
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- 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 __set
has 279 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
Function RenderOutput
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
protected function RenderOutput($strOutput, $blnDisplayOutput, $blnForceAsBlockElement = false) {
if ($blnForceAsBlockElement) {
$this->blnIsBlockElement = true; // must be remembered for ajax drawing
}
- 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 class QControlBase has 60 public methods. Consider refactoring QControlBase to keep number of public methods under 10. Open
abstract class QControlBase extends QHtmlAttributeManager {
/*
* Constannts
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class QControlBase has 66 non-getter- and setter-methods. Consider refactoring QControlBase to keep number of methods under 25. Open
abstract class QControlBase extends QHtmlAttributeManager {
/*
* Constannts
*/
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class QControlBase has an overall complexity of 372 which is very high. The configured complexity threshold is 50. Open
abstract class QControlBase extends QHtmlAttributeManager {
/*
* Constannts
*/
- Exclude checks
Function RenderHelper
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function RenderHelper($mixParameterArray, $strRenderMethod) {
// Make sure the form is already "RenderBegun"
if ((!$this->objForm) || ($this->objForm->FormStatus != QForm::FormStatusRenderBegun)) {
if (!$this->objForm)
$objExc = new QCallerException('Control\'s form does not exist. It could be that you are attempting to render after RenderEnd() has been called on the form.');
- 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 GetAllActions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function GetAllActions($strEventType, $strActionType = null) {
$objArrayToReturn = array();
if ($this->objActionArray) foreach ($this->objActionArray as $objActionArray) {
foreach ($objActionArray as $objAction)
if (get_class($objAction->Event) == $strEventType) {
- 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 RenderOutput
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function RenderOutput($strOutput, $blnDisplayOutput, $blnForceAsBlockElement = false) {
if ($blnForceAsBlockElement) {
$this->blnIsBlockElement = true; // must be remembered for ajax drawing
}
Method __get
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __get($strName) {
switch ($strName) {
case "Display": return $this->blnDisplay;
case "CausesValidation": return $this->mixCausesValidation;
case "Required": return $this->blnRequired;
Function RenderAjax
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function RenderAjax() {
// Only render if this control has been modified at all
$controls = [];
if ($this->IsModified()) {
// Render if (1) object has no parent or (2) parent was not rendered nor currently being rendered
- 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 RenderWithName
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function RenderWithName($blnDisplayOutput = true) {
////////////////////
// Call RenderHelper
$this->RenderHelper(func_get_args(), __FUNCTION__);
////////////////////
Function __construct
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($objParentObject, $strControlId = null) {
if ($objParentObject instanceof QForm)
$this->objForm = $objParentObject;
else if ($objParentObject instanceof QControl) {
$this->objParentControl = $objParentObject;
- 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 class QControlBase has 44 fields. Consider redesigning QControlBase to keep the number of fields under 15. Open
abstract class QControlBase extends QHtmlAttributeManager {
/*
* Constannts
*/
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Function RenderWithName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function RenderWithName($blnDisplayOutput = true) {
////////////////////
// Call RenderHelper
$this->RenderHelper(func_get_args(), __FUNCTION__);
////////////////////
- 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 GetTemplatePath
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function GetTemplatePath($strTemplate) {
// If no path is specified, or a relative path, use the path of the child control's file as the starting point.
if (strpos($strTemplate, DIRECTORY_SEPARATOR) !== 0) {
$strOriginalPath = $strTemplate;
- 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 RenderHelper
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function RenderHelper($mixParameterArray, $strRenderMethod) {
// Make sure the form is already "RenderBegun"
if ((!$this->objForm) || ($this->objForm->FormStatus != QForm::FormStatusRenderBegun)) {
if (!$this->objForm)
$objExc = new QCallerException('Control\'s form does not exist. It could be that you are attempting to render after RenderEnd() has been called on the form.');
The class QControlBase has 85 public methods and attributes. Consider reducing the number of public items to less than 45. Open
abstract class QControlBase extends QHtmlAttributeManager {
/*
* Constannts
*/
- Read upRead up
- Exclude checks
ExcessivePublicCount
Since: 0.1
A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.
Example
public class Foo {
public $value;
public $something;
public $var;
// [... more more public attributes ...]
public function doWork() {}
public function doMoreWork() {}
public function doWorkAgain() {}
// [... more more public methods ...]
}
Source https://phpmd.org/rules/codesize.html#excessivepubliccount
Function GetControlFromHierarchyByMethodName
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function GetControlFromHierarchyByMethodName($strMethodName, $blnIncludeCurrentControl = true) {
if ($blnIncludeCurrentControl == true) {
$ctlDelegatorControl = $this;
} else {
if (!$this->ParentControl) {
- 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 __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($objParentObject, $strControlId = null) {
if ($objParentObject instanceof QForm)
$this->objForm = $objParentObject;
else if ($objParentObject instanceof QControl) {
$this->objParentControl = $objParentObject;
Method GetModelConnectorParams
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function GetModelConnectorParams() {
return array(
new QModelConnectorParam ('QControl', 'CssClass', 'Css Class assigned to the control', QType::String),
new QModelConnectorParam ('QControl', 'AccessKey', 'Access Key to focus control', QType::String),
new QModelConnectorParam ('QControl', 'CausesValidation', 'How and what to validate. Can also be set to a control.', QModelConnectorParam::SelectionList,
Function ValidateControlAndChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function ValidateControlAndChildren() {
// Initially Assume Validation is True
$blnToReturn = true;
// Check the Control Itself
- 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 RenderChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function RenderChildren($blnDisplayOutput = true) {
$strToReturn = "";
foreach ($this->GetChildControls() as $objControl) {
if (!$objControl->Rendered) {
- 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 WakeupHelper
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function WakeupHelper($objForm, $obj) {
if (is_array ($obj)) {
$ret = array();
foreach ($obj as $key=>$val) {
$ret[$key] = self::WakeupHelper($objForm, $val);
- 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 too many return
statements within this method. Open
case "Rendered": return $this->blnRendered;
Avoid too many return
statements within this method. Open
case "Rendering": return $this->blnRendering;
Avoid too many return
statements within this method. Open
case "RenderMethod": return $this->strRenderMethod;
Avoid too many return
statements within this method. Open
case "Form": return $this->objForm;
Avoid too many return
statements within this method. Open
case "HtmlAfter": return $this->strHtmlAfter;
Avoid too many return
statements within this method. Open
case "Name": return $this->strName;
Avoid too many return
statements within this method. Open
case "ActionParameter": return $this->mixActionParameter;
Avoid too many return
statements within this method. Open
case "DragObj": return $this->objDraggable;
Avoid too many return
statements within this method. Open
case "ScriptsOnly": return $this->blnScriptsOnly;
Avoid too many return
statements within this method. Open
case "ActionsMustTerminate": return $this->blnActionsMustTerminate;
Avoid too many return
statements within this method. Open
case "JavaScripts": return $this->strJavaScripts;
Avoid too many return
statements within this method. Open
case "WrapperCssClass": return $this->GetWrapperStyler()->CssClass;
Avoid too many return
statements within this method. Open
return parent::__get($strName);
Avoid too many return
statements within this method. Open
case "LinkedNode": return $this->objLinkedNode;
Avoid too many return
statements within this method. Open
case "HtmlBefore": return $this->strHtmlBefore;
Avoid too many return
statements within this method. Open
case "Instructions": return $this->strInstructions;
Avoid too many return
statements within this method. Open
case "Droppable": return $this->objDroppable && !$this->objDroppable->Disabled;
Avoid too many return
statements within this method. Open
case "Modified": return $this->IsModified();
Avoid too many return
statements within this method. Open
case "AutoRender": return $this->blnAutoRender;
Avoid too many return
statements within this method. Open
case "Moveable": return $this->objDraggable && !$this->objDraggable->Disabled;
Avoid too many return
statements within this method. Open
case "Resizable": return $this->objResizable && !$this->objResizable->Disabled;
Avoid too many return
statements within this method. Open
case "WrapperModified": return $this->blnWrapperModified;
Avoid too many return
statements within this method. Open
case "StyleSheets": return $this->strStyleSheets;
Avoid too many return
statements within this method. Open
case "ControlId": return $this->strControlId;
Avoid too many return
statements within this method. Open
case "Minimize": return $this->blnMinimize;
Avoid too many return
statements within this method. Open
case "DropObj": return $this->objDroppable;
Avoid too many return
statements within this method. Open
case "Warning": return $this->strWarning;
Avoid too many return
statements within this method. Open
case "ResizeObj": return $this->objResizable;
Avoid too many return
statements within this method. Open
case "ParentControl": return $this->objParentControl;
Avoid too many return
statements within this method. Open
case "OnPage": return $this->blnOnPage;
Avoid too many return
statements within this method. Open
case "UseWrapper": return $this->blnUseWrapper;
Avoid too many return
statements within this method. Open
case "WrapperStyles": return $this->getWrapperStyler();
Avoid too many return
statements within this method. Open
case "WrapLabel": return $this->blnWrapLabel;
Avoid too many return
statements within this method. Open
case "Visible": return $this->blnVisible;
Avoid too many return
statements within this method. Open
case "PreferredRenderMethod": return $this->strPreferredRenderMethod;
Function RenderWithError
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function RenderWithError($blnDisplayOutput = true) {
// Call RenderHelper
$this->RenderHelper(func_get_args(), __FUNCTION__);
/**
- 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 class QControlBase has 2371 lines of code. Current threshold is 1000. Avoid really long classes. Open
abstract class QControlBase extends QHtmlAttributeManager {
/*
* Constannts
*/
- Exclude checks
The method RenderOutput() has an NPath complexity of 288. The configured NPath complexity threshold is 200. Open
protected function RenderOutput($strOutput, $blnDisplayOutput, $blnForceAsBlockElement = false) {
if ($blnForceAsBlockElement) {
$this->blnIsBlockElement = true; // must be remembered for ajax drawing
}
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method RenderHelper() has an NPath complexity of 360. The configured NPath complexity threshold is 200. Open
protected function RenderHelper($mixParameterArray, $strRenderMethod) {
// Make sure the form is already "RenderBegun"
if ((!$this->objForm) || ($this->objForm->FormStatus != QForm::FormStatusRenderBegun)) {
if (!$this->objForm)
$objExc = new QCallerException('Control\'s form does not exist. It could be that you are attempting to render after RenderEnd() has been called on the form.');
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method __set() has 301 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Exclude checks
The method RenderAjax() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. Open
public function RenderAjax() {
// Only render if this control has been modified at all
$controls = [];
if ($this->IsModified()) {
// Render if (1) object has no parent or (2) parent was not rendered nor currently being rendered
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method RenderHelper() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. Open
protected function RenderHelper($mixParameterArray, $strRenderMethod) {
// Make sure the form is already "RenderBegun"
if ((!$this->objForm) || ($this->objForm->FormStatus != QForm::FormStatusRenderBegun)) {
if (!$this->objForm)
$objExc = new QCallerException('Control\'s form does not exist. It could be that you are attempting to render after RenderEnd() has been called on the form.');
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method RenderOutput() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10. Open
protected function RenderOutput($strOutput, $blnDisplayOutput, $blnForceAsBlockElement = false) {
if ($blnForceAsBlockElement) {
$this->blnIsBlockElement = true; // must be remembered for ajax drawing
}
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method __set() has a Cyclomatic Complexity of 76. The configured cyclomatic complexity threshold is 10. Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method __get() has a Cyclomatic Complexity of 43. The configured cyclomatic complexity threshold is 10. Open
public function __get($strName) {
switch ($strName) {
case "Display": return $this->blnDisplay;
case "CausesValidation": return $this->mixCausesValidation;
case "Required": return $this->blnRequired;
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Avoid using undefined variables such as '$params' which will lead to PHP notices. Open
$params['originalParam'] = $mixParameter;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$params' which will lead to PHP notices. Open
$params['action'] = $objAction;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$params' which will lead to PHP notices. Open
$params['param'] = $mixParameter; // this value can be modified by subclass if needed
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$params' which will lead to PHP notices. Open
$params['controlId'] = $this->strControlId;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$params' which will lead to PHP notices. Open
return $params;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
The class QControlBase has a coupling between objects value of 27. Consider to reduce the number of dependencies under 13. Open
abstract class QControlBase extends QHtmlAttributeManager {
/*
* Constannts
*/
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Missing class import via use statement (line '272', column '16'). Open
throw new QCallerException('ControlIds must be only alphanumeric characters: ' . $strControlId);
- 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 '398', column '22'). Open
$reflector = new ReflectionClass(get_class($this));
- 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
The method GetChildControls has a boolean flag argument $blnUseNumericIndexes, which is a certain sign of a Single Responsibility Principle violation. Open
public function GetChildControls($blnUseNumericIndexes = true) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '405', column '24'). Open
$reflector = new ReflectionClass(get_class($this->objParentControl));
- 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 '413', column '23'). Open
$reflector = new ReflectionClass(get_class($this->objForm));
- 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 '263', column '15'). Open
throw new QCallerException('ParentObject must be either a QForm or QControl object');
- 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 '1232', column '20'). Open
$objExc = new QCallerException('Control cannot be rendered after RenderEnd() has been called on the form.');
- 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
The method VarExport has a boolean flag argument $blnReturn, which is a certain sign of a Single Responsibility Principle violation. Open
public function VarExport($blnReturn = true) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '1948', column '30'). Open
$this->objWatcher = new QWatcher(); // only create a watcher object when needed, since it is stored in the form state
- 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 '1244', column '19'). Open
$objExc = new QCallerException('This control has already been rendered: ' . $this->strControlId);
- 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 '2463', column '9'). Open
new QModelConnectorParam ('QControl', 'Resizable', '', QType::Boolean),
- 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 '2455', column '9'). Open
new QModelConnectorParam ('QControl', 'Required', 'Will it fail validation if nothing is entered (default depends on data definition, if NULL is allowed.)?', QType::Boolean),
- 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 '2459', column '9'). Open
new QModelConnectorParam ('QControl', 'Height', 'Height in pixels. However, you can specify a different unit (e.g. 3.0 em).', QType::String),
- 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 '2462', column '9'). Open
new QModelConnectorParam ('QControl', 'Moveable', '', QType::Boolean),
- 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
The method RenderWithError has a boolean flag argument $blnDisplayOutput, which is a certain sign of a Single Responsibility Principle violation. Open
public function RenderWithError($blnDisplayOutput = true) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '2296', column '35'). Open
$this->objDroppable = new QDroppable($this);
- 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 '718', column '15'). Open
throw new QCallerException('First parameter of AddAction is expecting an object of type QEvent');
- 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
The method GetWrapperStyleAttributes has a boolean flag argument $blnIsBlockElement, which is a certain sign of a Single Responsibility Principle violation. Open
protected function GetWrapperStyleAttributes($blnIsBlockElement = false) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '2454', column '9'). Open
new QModelConnectorParam ('QControl', 'Enabled', 'Will it start as enabled (default true)?', QType::Boolean),
- 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 '2465', column '9'). Open
new QModelConnectorParam ('QControl', 'UseWrapper', 'Control will be forced to be wrapped with a div', QType::Boolean),
- 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 '2445', column '9'). Open
new QModelConnectorParam ('QControl', 'AccessKey', 'Access Key to focus control', QType::String),
- 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 '2464', column '9'). Open
new QModelConnectorParam ('QControl', 'Droppable', '', QType::Boolean),
- 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 '722', column '15'). Open
throw new QCallerException('Second parameter of AddAction is expecting an object of type QAction');
- 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 '1230', column '20'). Open
$objExc = new QCallerException('Control\'s form does not exist. It could be that you are attempting to render after RenderEnd() has been called on the form.');
- 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 '2275', column '35'). Open
$this->objResizable = new QResizable($this);
- 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 '2457', column '9'). Open
new QModelConnectorParam ('QControl', 'ToolTip', '', QType::String),
- 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 '2466', column '9'). Open
new QModelConnectorParam ('QControl', 'WrapperCssClass', '', QType::String),
- 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 '2460', column '9'). Open
new QModelConnectorParam ('QControl', 'Width', 'Width in pixels. However, you can specify a different unit (e.g. 3.0 em).', QType::String),
- 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 '1092', column '35'). Open
$this->objWrapperStyler = new QTagStyler();
- 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 '1234', column '20'). Open
$objExc = new QCallerException('Control cannot be rendered until RenderBegin() has been called on the form.');
- 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
The method Render has a boolean flag argument $blnDisplayOutput, which is a certain sign of a Single Responsibility Principle violation. Open
public function Render($blnDisplayOutput = true /* ... */) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method GetControlFromHierarchyByMethodName has a boolean flag argument $blnIncludeCurrentControl, which is a certain sign of a Single Responsibility Principle violation. Open
public function GetControlFromHierarchyByMethodName($strMethodName, $blnIncludeCurrentControl = true) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method RenderChildren has a boolean flag argument $blnDisplayOutput, which is a certain sign of a Single Responsibility Principle violation. Open
protected function RenderChildren($blnDisplayOutput = true) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '2444', column '9'). Open
new QModelConnectorParam ('QControl', 'CssClass', 'Css Class assigned to the control', QType::String),
- 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 '2461', column '9'). Open
new QModelConnectorParam ('QControl', 'Instructions', 'Additional help for user.', QType::String),
- 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
The method RenderWithName has a boolean flag argument $blnDisplayOutput, which is a certain sign of a Single Responsibility Principle violation. Open
public function RenderWithName($blnDisplayOutput = true) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method RenderWrappedOutput has a boolean flag argument $blnForceAsBlockElement, which is a certain sign of a Single Responsibility Principle violation. Open
protected function RenderWrappedOutput($strOutput, $blnForceAsBlockElement = false) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '2458', column '9'). Open
new QModelConnectorParam ('QControl', 'Visible', '', QType::Boolean),
- 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 '753', column '15'). Open
throw new QCallerException('First parameter of AddAction is expecting on object of type QEvent');
- 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
The method RenderOutput has a boolean flag argument $blnForceAsBlockElement, which is a certain sign of a Single Responsibility Principle violation. Open
protected function RenderOutput($strOutput, $blnDisplayOutput, $blnForceAsBlockElement = false) {
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '2254', column '35'). Open
$this->objDraggable = new QDraggable($this, $this->ControlId . 'draggable');
- 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 '2456', column '9'). Open
new QModelConnectorParam ('QControl', 'TabIndex', '', QType::Integer),
- 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 '2467', column '9'). Open
new QModelConnectorParam ('QControl', 'PreferredRenderMethod', '', QType::String)
- 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 '2446', column '9'). Open
new QModelConnectorParam ('QControl', 'CausesValidation', 'How and what to validate. Can also be set to a control.', QModelConnectorParam::SelectionList,
- 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
The method GetChildControl uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
return null;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method RemoveChildControl uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (isset($this->objChildControlArray[$strControlId])) {
$objChildControl = $this->objChildControlArray[$strControlId];
$objChildControl->objParentControl = null;
unset($this->objChildControlArray[$strControlId]);
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
// Verify ControlId is only AlphaNumeric Characters
if (ctype_alnum($strControlId))
$this->strControlId = $strControlId;
else
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QHtml' in method 'RenderCssStyles'. Open
return QHtml::RenderStyles($styles);
- 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
The method RenderOutput uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$strOutput = $strOutput . $this->GetNonWrappedHtml();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '2189', column '36'). Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'QClickEvent' in method 'OnDoubleClick'. Open
$this->AddAction(QClickEvent::CreateWithOptions($arrEventOptions), $objAction);
- 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
Avoid using static access to class 'QKeyUpEvent' in method 'OnKeyUp'. Open
$this->AddAction(QKeyUpEvent::CreateWithOptions($arrEventOptions), $objAction);
- 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
The method AddPluginJavascriptFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Use the default location, relative to plugin's own directory given.
$this->AddJavascriptFile(__PLUGIN_ASSETS__ . '/' . $strPluginName . "/js/" . $strJsFileName);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method AddPluginCssFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
if (strpos($strCssFileName, "/") === 0) {
// custom location for plugin javascript, relative to virtual dir
$this->AddCssFile($strCssFileName);
} else {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '2200', column '39'). Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '2229', column '42'). Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'QType' in method '__set'. Open
if (QType::Cast($mixValue, QType::Boolean)) {
- 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
Avoid using static access to class 'QType' in method '__set'. Open
if ($this->blnVisible !== ($mixValue = QType::Cast($mixValue, QType::Boolean))) {
- 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
Avoid using static access to class 'QType' in method '__set'. Open
if (QType::Cast($mixValue, QType::Boolean)) {
- 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
Avoid using static access to class 'QType' in method '__set'. Open
$this->blnMinimize = QType::Cast($mixValue, QType::Boolean);
- 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
Avoid using static access to class 'QType' in method '__set'. Open
$this->blnAutoRender = QType::Cast($mixValue, QType::Boolean);
- 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
The method AddJavascriptFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->strJavaScripts = $strJsFileName;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method RenderOutput uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Do nothing. RenderAjax will handle it.
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method GetControlFromHierarchyByMethodName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (!$this->ParentControl) {
// ParentControl is null. This means the parent is a QForm.
$ctlDelegatorControl = $this->Form;
} else {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QType' in method '__set'. Open
$this->objLinkedNode = QType::Cast($mixValue, 'QQNode');
- 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
The method AddPluginCssFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Use the default location
$this->AddCssFile(__PLUGIN_ASSETS__ . '/' . $strPluginName . "/css/" . $strCssFileName);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QBlurEvent' in method 'OnBlur'. Open
$this->AddAction(QBlurEvent::CreateWithOptions($arrEventOptions), $objAction);
- 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
The method GetControlFromHierarchyByMethodName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (!$ctlDelegatorControl->ParentControl) {
// ParentControl is null. This means the parent is a QForm.
$ctlDelegatorControl = $ctlDelegatorControl->Form;
} else {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QType' in method '__set'. Open
if ($this->strValidationError !== ($mixValue = QType::Cast($mixValue, QType::String))) {
- 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
The method RenderOutput uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$strOutput = $strOutput . $this->GetNonWrappedHtml();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QType' in method '__set'. Open
$this->mixActionParameter = ($mixValue instanceof QJsClosure) ? $mixValue : QType::Cast($mixValue, QType::String);
- 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
Avoid using static access to class 'QHtml' in method 'RenderWithName'. Open
$strMessage = sprintf('<span class="warning">%s</span>', QHtml::RenderString($this->strWarning));
- 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
Avoid using static access to class 'QHtml' in method 'RenderComment'. Open
return QHtml::Comment( $strType . ' ' . get_class($this) . ' ' . $this->strName . ' id:' . $this->strControlId);
- 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
The method _GetFormAttributes uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
return $this->strFormAttributes;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method GetControlFromHierarchyByMethodName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$ctlDelegatorControl = $this->ParentControl;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
if ($this->objResizable) {
$this->objResizable->Disabled = true;
}
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
if ($this->objDroppable) {
$this->objDroppable->Disabled = true;
}
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QClickEvent' in method 'OnClick'. Open
$this->AddAction(QClickEvent::CreateWithOptions($arrEventOptions), $objAction);
- 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
The method AddCssFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->strStyleSheets = $strCssFileName;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method RenderOutput uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$strOutput = $strOutput . $this->GetNonWrappedHtml();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QHtml' in method 'RenderWrappedOutput'. Open
return QHtml::RenderTag($strTag, $attributes, $strOutput);
- 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
Avoid using static access to class 'QHtml' in method 'RenderWithName'. Open
$strToReturn = QHtml::RenderTag('div', $aWrapperAttributes, $strToReturn);
- 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
Avoid assigning values to variables in if clauses and the like (line '2155', column '34'). Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'QType' in method '__set'. Open
if ($this->strPreferredRenderMethod !== ($mixValue = QType::Cast($mixValue, QType::String))) {
- 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
Avoid using static access to class 'QType' in method '__set'. Open
if ($this->strHtmlAfter !== ($mixValue = QType::Cast($mixValue, QType::String))) {
- 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
The method GetControlFromHierarchyByMethodName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$ctlDelegatorControl = $ctlDelegatorControl->ParentControl;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->objDraggable->Disabled = false;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '2166', column '48'). Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'QType' in method '__set'. Open
if (QType::Cast($mixValue, QType::Boolean)) {
- 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
Avoid using static access to class 'QType' in method '__set'. Open
$strWrapperCssClass = QType::Cast($mixValue, QType::String);
- 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
Avoid using static access to class 'QType' in method '__set'. Open
if($this->blnUseWrapper != QType::Cast($mixValue, QType::Boolean)) {
- 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
Avoid using static access to class 'QType' in method '__set'. Open
if ($this->strName !== ($mixValue = QType::Cast($mixValue, QType::String))) {
- 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
The method RemoveAllActions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
$this->objActionArray = array();
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method Render uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Avoid going through the time to render the control if we are not going to display it.
$strOutput = "";
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '2178', column '37'). Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'QChangeEvent' in method 'OnChange'. Open
$this->AddAction(QChangeEvent::CreateWithOptions($arrEventOptions), $objAction);
- 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
Avoid using static access to class 'QType' in method '__set'. Open
if ($this->strWarning !== ($mixValue = QType::Cast($mixValue, QType::String))) {
- 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
The method __set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->objResizable->Disabled = false;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method _GetFormAttributes uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
return null;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QAction' in method 'GetJavaScriptForEvent'. Open
return QAction::RenderActions($this, $strEventName, $this->objActionArray[$strEventName]);
- 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
Avoid using static access to class 'QType' in method '__set'. Open
if ($this->strHtmlBefore !== ($mixValue = QType::Cast($mixValue, QType::String))) {
- 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
Avoid using static access to class 'QType' in method '__set'. Open
if ($this->strInstructions !== ($mixValue = QType::Cast($mixValue, QType::String))) {
- 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
Avoid using static access to class 'QApplication' in method 'Blink'. Open
QApplication::ExecuteJavaScript(sprintf('qc.getW("%s").blink("%s", "%s");', $this->strControlId, $strFromColor, $strToColor));
- 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
The method RenderOutput uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return $strOutput;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QHtml' in method 'RenderWithError'. Open
$strOutput .= sprintf('<br %s/><span %sclass="warning">%s</span>', $strDataRel, $strDataRel, QHtml::RenderString($this->strWarning));
- 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
Avoid using static access to class 'QHtml' in method 'RenderWithName'. Open
QHtml::RenderTag('span', ['class'=>"instructions"], QHtml::RenderString($this->strInstructions));
- 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
Avoid using static access to class 'QType' in method '__set'. Open
$this->blnRequired = QType::Cast($mixValue, QType::Boolean);
- 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
The method __set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->objDroppable->Disabled = false;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method AddPluginJavascriptFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
if (strpos($strJsFileName, "/") === 0) {
// custom location for plugin javascript, relative to virtual directory
$this->AddJavascriptFile($strJsFileName);
} else {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QApplication' in method 'Focus'. Open
QApplication::ExecuteControlCommand($this->strControlId, 'focus');
- 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
Avoid using static access to class 'QHtml' in method 'RenderWithName'. Open
$strLabel = QHtml::RenderTag('label', null, QHtml::RenderString($this->strName));
- 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
Avoid using static access to class 'QType' in method '__set'. Open
$mixValue = QType::Cast($mixValue, QType::Boolean);
- 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
Avoid using static access to class 'QFocusEvent' in method 'OnFocus'. Open
$this->AddAction(QFocusEvent::CreateWithOptions($arrEventOptions), $objAction);
- 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
Avoid using static access to class 'QHtml' in method 'RenderWithError'. Open
$strOutput .= sprintf('<br %s/><span %sclass="error">%s</span>', $strDataRel, $strDataRel, QHtml::RenderString($this->strValidationError));
- 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
The method RenderWithName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
}else{
$strInstructions = '';
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QHtml' in method 'RenderWithName'. Open
$strToReturn = QHtml::RenderTag('div', ['class'=>$strLabelClass], $strLabel . $strInstructions);
- 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
The method GetWrapperId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return $this->ControlId;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '2214', column '34'). Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '2315', column '31'). Open
public function __set($strName, $mixValue) {
switch ($strName) {
// Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
case "Position":
case "Top":
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'QType' in method '__set'. Open
if($this->blnWrapLabel != QType::Cast($mixValue, QType::Boolean)) {
- 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
The method RenderOutput uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// if this is an injected top-level control, then we need to render the whole thing
if (!$this->blnOnPage) {
if ($this->blnUseWrapper) {
$strOutput = $this->RenderWrappedOutput($strOutput, $blnForceAsBlockElement) . $this->GetNonWrappedHtml();
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QHtml' in method 'RenderWithName'. Open
QHtml::RenderTag('span', ['class'=>"instructions"], QHtml::RenderString($this->strInstructions));
- 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
Avoid using static access to class 'QHtml' in method 'RenderWithName'. Open
$strLabel = QHtml::RenderTag('label', null, QHtml::RenderString($this->strName));
- 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
Avoid using static access to class 'QHtml' in method 'RenderWithName'. Open
$strMessage = sprintf('<span class="error">%s</span>', QHtml::RenderString($this->strValidationError));
- 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
The method Watch uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->objWatcher = new QWatcher(); // only create a watcher object when needed, since it is stored in the form state
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __set uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
if ($this->objDraggable) {
$this->objDraggable->Disabled = true;
}
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QType' in method '__set'. Open
$this->blnSaveState = QType::Cast($mixValue, QType::Boolean);
- 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
Avoid unused parameters such as '$state'. Open
protected function PutState($state) {}
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused local variables such as '$_CONTROL'. Open
global $_CONTROL;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$_ITEM'. Open
global $_ITEM; // used by data repeater
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$_FORM'. Open
global $_FORM;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$objActions'. Open
foreach ($this->objActionArray as $strEventName => $objActions) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused parameters such as '$blnIsBlockElement'. Open
protected function GetWrapperStyleAttributes($blnIsBlockElement = false) {
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
TODO found Open
TODO: Implement and test the code below to reduce the amount of redrawing. In particular, the current
- Exclude checks
TODO found Open
// TODO: do this in javascript
- Exclude checks
TODO found Open
* TODO: Turn this into a specific command to avoid the javascript eval that happens on the other end.
- Exclude checks
TODO found Open
* TODO: Turn this into a specific command to avoid the javascript eval that happens on the other end.
- Exclude checks
TODO found Open
* TODO: This can likely be done just in javascript without a complete refresh of the control.
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
case "Resizable":
try {
$this->MarkAsWrapperModified();
if (QType::Cast($mixValue, QType::Boolean)) {
if (!$this->objResizable) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 114.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case "Droppable":
try {
$this->MarkAsWrapperModified();
if (QType::Cast($mixValue, QType::Boolean)) {
if (!$this->objDroppable) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 114.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case "ValidationError":
try {
if (is_string($mixValue) && trim($mixValue) === '') { // treat empty strings as nulls to prevent unnecessary drawing
$mixValue = null;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 104.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case "Warning":
try {
if (is_string($mixValue) && trim($mixValue) === '') { // treat empty strings as nulls to prevent unnecessary drawing
$mixValue = null;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 104.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function AddPluginJavascriptFile($strPluginName, $strJsFileName) {
if (strpos($strJsFileName, "http") === 0) {
$this->AddJavascriptFile($strJsFileName); // plugin uses js from some other website
}
else {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function AddPluginCssFile($strPluginName, $strCssFileName) {
if (strpos($strCssFileName, "http") === 0) {
$this->AddCssFile($strCssFileName); // plugin uses style sheet from some other website
}
else {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid excessively long variable names like $strCustomAttributeArray. Keep variable name length under 20. Open
protected $strCustomAttributeArray = 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 $blnActionsMustTerminate. Keep variable name length under 20. Open
protected $blnActionsMustTerminate = false;
- 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 $strPreferredRenderMethod. Keep variable name length under 20. Open
protected $strPreferredRenderMethod = 'Render';
- 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 $RenderExtensionInstance. Keep variable name length under 20. Open
$RenderExtensionInstance = new $classname;
- 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 $blnIncludeCurrentControl. Keep variable name length under 20. Open
public function GetControlFromHierarchyByMethodName($strMethodName, $blnIncludeCurrentControl = true) {
- 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 $blnForceAsBlockElement. Keep variable name length under 20. Open
protected function RenderWrappedOutput($strOutput, $blnForceAsBlockElement = false) {
- 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 $blnForceAsBlockElement. Keep variable name length under 20. Open
protected function RenderOutput($strOutput, $blnDisplayOutput, $blnForceAsBlockElement = false) {
- 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
Constant CommentEnd should be defined in uppercase Open
const CommentEnd = 'End';
- 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 CommentStart should be defined in uppercase Open
const CommentStart = 'Begin';
- 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
The variable $_FORM is not named in camelCase. Open
public function _WriteState() {
global $_FORM;
assert ($_FORM !== null);
if (defined ('__SESSION_SAVED_STATE__') && $this->blnSaveState) {
- 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 $_CONTROL is not named in camelCase. Open
public function EvaluateTemplate($strTemplate) {
global $_ITEM; // used by data repeater
global $_CONTROL;
global $_FORM;
- 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 $_FORM is not named in camelCase. Open
public function _WriteState() {
global $_FORM;
assert ($_FORM !== null);
if (defined ('__SESSION_SAVED_STATE__') && $this->blnSaveState) {
- 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 $_ITEM is not named in camelCase. Open
public function EvaluateTemplate($strTemplate) {
global $_ITEM; // used by data repeater
global $_CONTROL;
global $_FORM;
- 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 $_FORM is not named in camelCase. Open
public function _WriteState() {
global $_FORM;
assert ($_FORM !== null);
if (defined ('__SESSION_SAVED_STATE__') && $this->blnSaveState) {
- 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 $_FORM is not named in camelCase. Open
public function EvaluateTemplate($strTemplate) {
global $_ITEM; // used by data repeater
global $_CONTROL;
global $_FORM;
- 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 $RenderExtensionInstance is not named in camelCase. Open
public function RenderExtensionRenderer($classname, $methodname, $args=array()){
$RenderExtensionInstance = new $classname;
return $RenderExtensionInstance->{$methodname}($args);
}
- 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 $RenderExtensionInstance is not named in camelCase. Open
public function RenderExtensionRenderer($classname, $methodname, $args=array()){
$RenderExtensionInstance = new $classname;
return $RenderExtensionInstance->{$methodname}($args);
}
- 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 method GetState is not named in camelCase. Open
protected function GetState() {
return null;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method WakeupHelper is not named in camelCase. Open
public static function WakeupHelper($objForm, $obj) {
if (is_array ($obj)) {
$ret = array();
foreach ($obj as $key=>$val) {
$ret[$key] = self::WakeupHelper($objForm, $val);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetChildControl is not named in camelCase. Open
public function GetChildControl($strControlId) {
if (isset($this->objChildControlArray[$strControlId])) {
return $this->objChildControlArray[$strControlId];
}
else {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RemoveChildControl is not named in camelCase. Open
public function RemoveChildControl($strControlId, $blnRemoveFromForm) {
$this->blnModified = true;
if ($blnRemoveFromForm) {
$this->objForm->RemoveControl($strControlId); // will call back to here with $blnRemoveFromForm = false
} else {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _WriteState is not named in camelCase. Open
public function _WriteState() {
global $_FORM;
assert ($_FORM !== null);
if (defined ('__SESSION_SAVED_STATE__') && $this->blnSaveState) {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetChildControls is not named in camelCase. Open
public function GetChildControls($blnUseNumericIndexes = true) {
if ($blnUseNumericIndexes) {
$objToReturn = array();
foreach ($this->objChildControlArray as $objChildControl)
array_push($objToReturn, $objChildControl);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RemoveChildControls is not named in camelCase. Open
public function RemoveChildControls($blnRemoveFromForm) {
foreach ($this->objChildControlArray as $objChildControl) {
$this->RemoveChildControl($objChildControl->ControlId, $blnRemoveFromForm);
}
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _CallActionMethod is not named in camelCase. Open
public static function _CallActionMethod(QControl $objDestControl, $strMethodName, $strFormId, $params) {
$objDestControl->$strMethodName($strFormId, $params['controlId'], $params['param'], $params);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Sleep is not named in camelCase. Open
public function Sleep() {
$this->objForm = null;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method SleepHelper is not named in camelCase. Open
public static function SleepHelper($obj) {
if ($obj instanceof QForm) {
// assume its THE form
return '**QF;';
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _ReadState is not named in camelCase. Open
public function _ReadState() {
if (defined ('__SESSION_SAVED_STATE__') && $this->blnSaveState) {
$formName = get_class($this->objForm);
if (isset ($_SESSION[__SESSION_SAVED_STATE__][$formName][$this->ControlId])) {
$state = $_SESSION[__SESSION_SAVED_STATE__][$formName][$this->ControlId];
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method AddChildControl is not named in camelCase. Open
public function AddChildControl(QControl $objControl) {
$this->blnModified = true;
$this->objChildControlArray[$objControl->ControlId] = $objControl;
$objControl->objParentControl = $this;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method PutState is not named in camelCase. Open
protected function PutState($state) {}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method OnBlur is not named in camelCase. Open
public function OnBlur(QAction $objAction, $arrEventOptions=null) {
$this->AddAction(QBlurEvent::CreateWithOptions($arrEventOptions), $objAction);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method ParsePostData is not named in camelCase. Open
abstract public function ParsePostData();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Validate is not named in camelCase. Open
abstract public function Validate();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetTemplatePath is not named in camelCase. Open
public function GetTemplatePath($strTemplate) {
// If no path is specified, or a relative path, use the path of the child control's file as the starting point.
if (strpos($strTemplate, DIRECTORY_SEPARATOR) !== 0) {
$strOriginalPath = $strTemplate;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Wakeup is not named in camelCase. Open
public function Wakeup(QForm $objForm) {
$this->objForm = $objForm;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method EvaluateTemplate is not named in camelCase. Open
public function EvaluateTemplate($strTemplate) {
global $_ITEM; // used by data repeater
global $_CONTROL;
global $_FORM;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _ProcessActionParams is not named in camelCase. Open
public static function _ProcessActionParams(QControl $objSourceControl, QAction $objAction, $mixParameter) {
$mixParameters['param'] = null;
$mixParameters = $objSourceControl->ProcessActionParameters($objAction, $mixParameter);
return $mixParameters;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method ProcessActionParameters is not named in camelCase. Open
protected function ProcessActionParameters(QAction $objAction, $mixParameter) {
$params['param'] = $mixParameter; // this value can be modified by subclass if needed
$params['originalParam'] = $mixParameter;
$params['action'] = $objAction;
$params['controlId'] = $this->strControlId;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method ForgetState is not named in camelCase. Open
public function ForgetState() {
if (defined ('__SESSION_SAVED_STATE__')) {
$formName = get_class($this->objForm);
unset($_SESSION[__SESSION_SAVED_STATE__][$formName][$this->ControlId]);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderHelper is not named in camelCase. Open
protected function RenderHelper($mixParameterArray, $strRenderMethod) {
// Make sure the form is already "RenderBegun"
if ((!$this->objForm) || ($this->objForm->FormStatus != QForm::FormStatusRenderBegun)) {
if (!$this->objForm)
$objExc = new QCallerException('Control\'s form does not exist. It could be that you are attempting to render after RenderEnd() has been called on the form.');
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method IsModified is not named in camelCase. Open
public function IsModified() {
return ($this->blnModified ||
($this->objWatcher && !$this->objWatcher->IsCurrent()));
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RemoveAllActions is not named in camelCase. Open
public function RemoveAllActions($strEventName = null) {
// Modified
$this->blnModified = true;
if ($strEventName) {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetControlHtml is not named in camelCase. Open
abstract protected function GetControlHtml();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderComment is not named in camelCase. Open
public function RenderComment($strType) {
return QHtml::Comment( $strType . ' ' . get_class($this) . ' ' . $this->strName . ' id:' . $this->strControlId);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderExtensionRenderer is not named in camelCase. Open
public function RenderExtensionRenderer($classname, $methodname, $args=array()){
$RenderExtensionInstance = new $classname;
return $RenderExtensionInstance->{$methodname}($args);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RemoveCustomAttribute is not named in camelCase. Open
public function RemoveCustomAttribute($strName) {
$this->RemoveHtmlAttribute($strName);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method ResetFlags is not named in camelCase. Open
public function ResetFlags() {
$this->blnRendered = false;
$this->blnModified = false;
$this->blnWrapperModified = false;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method AddJavascriptFile is not named in camelCase. Open
public function AddJavascriptFile($strJsFileName) {
if($this->strJavaScripts) {
$this->strJavaScripts .= ','.$strJsFileName;
} else {
$this->strJavaScripts = $strJsFileName;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetJqControlId is not named in camelCase. Open
public function GetJqControlId() {
return $this->ControlId;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method AddCssFile is not named in camelCase. Open
public function AddCssFile($strCssFileName) {
if($this->strStyleSheets) {
$this->strStyleSheets .= ','.$strCssFileName;
} else {
$this->strStyleSheets = $strCssFileName;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetControlFromHierarchyByMethodName is not named in camelCase. Open
public function GetControlFromHierarchyByMethodName($strMethodName, $blnIncludeCurrentControl = true) {
if ($blnIncludeCurrentControl == true) {
$ctlDelegatorControl = $this;
} else {
if (!$this->ParentControl) {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetForm is not named in camelCase. Open
public function GetForm() {
return $this->objForm;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Blink is not named in camelCase. Open
public function Blink($strFromColor = '#ffff66', $strToColor = '#ffffff') {
QApplication::ExecuteJavaScript(sprintf('qc.getW("%s").blink("%s", "%s");', $this->strControlId, $strFromColor, $strToColor));
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetCustomStyle is not named in camelCase. Open
public function GetCustomStyle($strName) {
return $this->GetCssStyle($strName);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetWrapperStyler is not named in camelCase. Open
public function GetWrapperStyler() {
if (!$this->objWrapperStyler) {
$this->objWrapperStyler = new QTagStyler();
}
return $this->objWrapperStyler;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetWrapperAttributes is not named in camelCase. Open
protected function GetWrapperAttributes($attributeOverrides = null) {
$styleOverrides = null;
if (!$this->blnDisplay) {
$styleOverrides = ['display'=>'none'];
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetEndScript is not named in camelCase. Open
public function GetEndScript() {
$strToReturn = '';
if ($this->objResizable)
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Render is not named in camelCase. Open
public function Render($blnDisplayOutput = true /* ... */) {
$blnMinimized = QApplication::$Minimize;
if ($this->blnMinimize) {
QApplication::$Minimize = true;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method MarkAsRendered is not named in camelCase. Open
public function MarkAsRendered() {
$this->blnRendered = true;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetCustomAttribute is not named in camelCase. Open
public function GetCustomAttribute($strName) {
return $this->GetHtmlAttribute($strName);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetJavaScriptForEvent is not named in camelCase. Open
public function GetJavaScriptForEvent($strEventName) {
return QAction::RenderActions($this, $strEventName, $this->objActionArray[$strEventName]);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Refresh is not named in camelCase. Open
public function Refresh() {
if ((!$this->blnRendered) &&
(!$this->blnRendering))
$this->MarkAsModified();
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method ValidateControlAndChildren is not named in camelCase. Open
public function ValidateControlAndChildren() {
// Initially Assume Validation is True
$blnToReturn = true;
// Check the Control Itself
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method OnFocus is not named in camelCase. Open
public function OnFocus(QAction $objAction, $arrEventOptions=null) {
$this->AddAction(QFocusEvent::CreateWithOptions($arrEventOptions), $objAction);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method SetForm is not named in camelCase. Open
public function SetForm($objForm) {
$this->objForm = $objForm;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Focus is not named in camelCase. Open
public function Focus() {
QApplication::ExecuteControlCommand($this->strControlId, 'focus');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method ValidationReset is not named in camelCase. Open
public function ValidationReset() {
if (($this->strValidationError) || ($this->strWarning)) {
$this->blnModified = true;
}
$this->strValidationError = null;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetEndHtml is not named in camelCase. Open
public function GetEndHtml() {}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderOutput is not named in camelCase. Open
protected function RenderOutput($strOutput, $blnDisplayOutput, $blnForceAsBlockElement = false) {
if ($blnForceAsBlockElement) {
$this->blnIsBlockElement = true; // must be remembered for ajax drawing
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderWithError is not named in camelCase. Open
public function RenderWithError($blnDisplayOutput = true) {
// Call RenderHelper
$this->RenderHelper(func_get_args(), __FUNCTION__);
/**
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method AddPluginCssFile is not named in camelCase. Open
public function AddPluginCssFile($strPluginName, $strCssFileName) {
if (strpos($strCssFileName, "http") === 0) {
$this->AddCssFile($strCssFileName); // plugin uses style sheet from some other website
}
else {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderCssStyles is not named in camelCase. Open
public function RenderCssStyles($styleOverrides = null) {
$styles = $this->styles;
if ($styleOverrides) {
$styles = array_merge($this->styles, $styleOverrides);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetWrapperId is not named in camelCase. Open
public function GetWrapperId() {
if ($this->blnUseWrapper) {
return $this->ControlId . '_ctl';
} else {
return $this->ControlId;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method AddAction is not named in camelCase. Open
public function AddAction($objEvent, $objAction) {
if (!($objEvent instanceof QEvent)) {
throw new QCallerException('First parameter of AddAction is expecting an object of type QEvent');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method SetCustomAttribute is not named in camelCase. Open
public function SetCustomAttribute($strName, $strValue) {
$this->SetHtmlAttribute($strName, $strValue);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method SetCustomStyle is not named in camelCase. Open
public function SetCustomStyle($strName, $strValue) {
$this->SetCssStyle($strName, $strValue);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderHtmlAttributes is not named in camelCase. Open
public function RenderHtmlAttributes($attributeOverrides = null, $styleOverrides = null) {
$attributes['id'] = $this->strControlId;
if ($attributeOverrides) {
$attributes = array_merge($attributes, $attributeOverrides);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetStyleAttributes is not named in camelCase. Open
public function GetStyleAttributes() {
return $this->RenderCssStyles();
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RemoveWrapperCssClass is not named in camelCase. Open
public function RemoveWrapperCssClass($strClass) {
if ($this->GetWrapperStyler()->RemoveCssClass($strClass)) {
$this->MarkAsWrapperModified();
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method IsDescendantOf is not named in camelCase. Open
public function IsDescendantOf ($objControl) {
$objParent = $this->objParentControl;
while ($objParent) {
if ($objParent == $objControl) {
return true;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method AddAttributeScript is not named in camelCase. Open
public function AddAttributeScript ($strMethod, $args /*, ... */)
{
$args = func_get_args();
$this->strAttributeScripts[] = $args;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderChildren is not named in camelCase. Open
protected function RenderChildren($blnDisplayOutput = true) {
$strToReturn = "";
foreach ($this->GetChildControls() as $objControl) {
if (!$objControl->Rendered) {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method MarkAsWrapperModified is not named in camelCase. Open
public function MarkAsWrapperModified() {
$this->blnWrapperModified = true;
$this->blnModified = true;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Watch is not named in camelCase. Open
public function Watch (QQNode $objNode)
{
if (!$this->objWatcher) {
if (defined('WATCHER_CLASS')) {
$class = WATCHER_CLASS;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method AddPluginJavascriptFile is not named in camelCase. Open
public function AddPluginJavascriptFile($strPluginName, $strJsFileName) {
if (strpos($strJsFileName, "http") === 0) {
$this->AddJavascriptFile($strJsFileName); // plugin uses js from some other website
}
else {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method OnChange is not named in camelCase. Open
public function OnChange(QAction $objAction, $arrEventOptions=null) {
$this->AddAction(QChangeEvent::CreateWithOptions($arrEventOptions), $objAction);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method OnKeyUp is not named in camelCase. Open
public function OnKeyUp(QAction $objAction, $arrEventOptions=null) {
$this->AddAction(QKeyUpEvent::CreateWithOptions($arrEventOptions), $objAction);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetAttributes is not named in camelCase. Open
public function GetAttributes() {
return $this->RenderHtmlAttributes() . ' ';
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetNonWrappedHtml is not named in camelCase. Open
protected function GetNonWrappedHtml() {}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method MarkAsModified is not named in camelCase. Open
public function MarkAsModified() {
$this->blnModified = true;
/*
TODO: Implement and test the code below to reduce the amount of redrawing. In particular, the current
implementation will cause invisible and display:none controls to be redrawn whenever something changes,
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method SetParentControl is not named in camelCase. Open
public function SetParentControl($objControl) {
// Mark this object as modified
$this->MarkAsModified();
// Mark the old parent (if applicable) as modified
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RemoveCustomStyle is not named in camelCase. Open
public function RemoveCustomStyle($strName) {
$this->RemoveCssStyle($strName);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetCustomAttributes is not named in camelCase. Open
public function GetCustomAttributes() {
return $this->RenderHtmlAttributes();
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderWrappedOutput is not named in camelCase. Open
protected function RenderWrappedOutput($strOutput, $blnForceAsBlockElement = false) {
$strTag = ($this->blnIsBlockElement || $blnForceAsBlockElement) ? 'div' : 'span';
$overrides = ['id'=>$this->GetWrapperId()];
$attributes = $this->GetWrapperAttributes($overrides);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method SetFocus is not named in camelCase. Open
public function SetFocus() {
$this->Focus();
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method MakeCurrent is not named in camelCase. Open
public function MakeCurrent() {
if ($this->objWatcher) {
$this->objWatcher->MakeCurrent();
}
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _GetFormAttributes is not named in camelCase. Open
public function _GetFormAttributes() {
if (QApplication::$RequestMode == QRequestMode::Ajax) {
if ($this->IsModified()) {
return $this->strFormAttributes;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method AddWrapperCssClass is not named in camelCase. Open
public function AddWrapperCssClass($strClass) {
if ($this->GetWrapperStyler()->AddCssClass($strClass)) {
$this->MarkAsWrapperModified();
}
/**
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderAjax is not named in camelCase. Open
public function RenderAjax() {
// Only render if this control has been modified at all
$controls = [];
if ($this->IsModified()) {
// Render if (1) object has no parent or (2) parent was not rendered nor currently being rendered
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method OnClick is not named in camelCase. Open
public function OnClick(QAction $objAction, $arrEventOptions=null) {
$this->AddAction(QClickEvent::CreateWithOptions($arrEventOptions), $objAction);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method AddActionArray is not named in camelCase. Open
public function AddActionArray($objEvent, $objActionArray) {
if (!($objEvent instanceof QEvent)) {
throw new QCallerException('First parameter of AddAction is expecting on object of type QEvent');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method ResetOnPageStatus is not named in camelCase. Open
public function ResetOnPageStatus() {
$this->blnOnPage = false;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method OnDoubleClick is not named in camelCase. Open
public function OnDoubleClick(QAction $objAction, $arrEventOptions=null) {
$this->AddAction(QClickEvent::CreateWithOptions($arrEventOptions), $objAction);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetWrapperStyleAttributes is not named in camelCase. Open
protected function GetWrapperStyleAttributes($blnIsBlockElement = false) {
return $this->GetWrapperStyler()->RenderCssStyles();
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderAttributeScripts is not named in camelCase. Open
public function RenderAttributeScripts()
{
if ($this->strAttributeScripts) {
foreach ($this->strAttributeScripts as $scriptArgs) {
array_unshift($scriptArgs, $this->getJqControlId());
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderWithName is not named in camelCase. Open
public function RenderWithName($blnDisplayOutput = true) {
////////////////////
// Call RenderHelper
$this->RenderHelper(func_get_args(), __FUNCTION__);
////////////////////
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetAllActions is not named in camelCase. Open
public function GetAllActions($strEventType, $strActionType = null) {
$objArrayToReturn = array();
if ($this->objActionArray) foreach ($this->objActionArray as $objActionArray) {
foreach ($objActionArray as $objAction)
if (get_class($objAction->Event) == $strEventType) {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method RenderActionScripts is not named in camelCase. Open
public function RenderActionScripts() {
$strToReturn = '';
foreach ($this->objActionArray as $strEventName => $objActions) {
$strToReturn .= $this->GetJavaScriptForEvent($strEventName);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method VarExport is not named in camelCase. Open
public function VarExport($blnReturn = true) {
if ($this->objForm)
$this->objForm = $this->objForm->FormId;
if ($this->objParentControl)
$this->objParentControl = $this->objParentControl->ControlId;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetModelConnectorParams is not named in camelCase. Open
public static function GetModelConnectorParams() {
return array(
new QModelConnectorParam ('QControl', 'CssClass', 'Css Class assigned to the control', QType::String),
new QModelConnectorParam ('QControl', 'AccessKey', 'Access Key to focus control', QType::String),
new QModelConnectorParam ('QControl', 'CausesValidation', 'How and what to validate. Can also be set to a control.', QModelConnectorParam::SelectionList,
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}