Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
TriggerActions accesses the super-global variable $_POST. Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
InvalidFormState accesses the super-global variable $_POST. Open
public static function InvalidFormState() {
//ob_clean();
if (isset($_POST['Qform__FormCallType']) && $_POST['Qform__FormCallType'] == QCallType::Ajax) {
QApplication::$ProcessOutput = false;
QApplication::SendAjaxResponse(['loc' => 'reload']);
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
TriggerActions accesses the super-global variable $_POST. Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
Run accesses the super-global variable $_POST. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
TriggerMethod accesses the super-global variable $_POST. Open
protected function TriggerMethod($strControlId, $strMethodName, QAction $objAction) {
$mixParameter = $_POST['Qform__FormParameter'];
$objSourceControl = $this->objControlArray[$strControlId];
$params = QControl::_ProcessActionParams($objSourceControl, $objAction, $mixParameter);
- 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
InvalidFormState accesses the super-global variable $_POST. Open
public static function InvalidFormState() {
//ob_clean();
if (isset($_POST['Qform__FormCallType']) && $_POST['Qform__FormCallType'] == QCallType::Ajax) {
QApplication::$ProcessOutput = false;
QApplication::SendAjaxResponse(['loc' => 'reload']);
- 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
TriggerActions accesses the super-global variable $_POST. Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- 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
Function TriggerActions
has a Cognitive Complexity of 225 (exceeds 5 allowed). Consider refactoring. Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File QFormBase.class.php
has 1008 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file contains the QFormBase class.
*
* @package Controls
Function Run
has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
QFormBase
has 59 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class QFormBase extends QBaseClass {
///////////////////////////
// Static Members
///////////////////////////
/** @var bool True when css scripts get rendered on page. Lets user call RenderStyles in header. */
Method Run
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
Function RenderEnd
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function RenderEnd($blnDisplayOutput = true) {
// Ensure that RenderEnd() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
throw new QCallerException('$this->RenderBegin() was never called');
- 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 RenderEnd
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function RenderEnd($blnDisplayOutput = true) {
// Ensure that RenderEnd() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
throw new QCallerException('$this->RenderBegin() was never called');
Method TriggerActions
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
Function RenderAjax
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function RenderAjax() {
$aResponse = array();
if (QApplication::$JavascriptExclusiveCommand) {
/**
- 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 QFormBase has an overall complexity of 314 which is very high. The configured complexity threshold is 50. Open
abstract class QFormBase extends QBaseClass {
///////////////////////////
// Static Members
///////////////////////////
/** @var bool True when css scripts get rendered on page. Lets user call RenderStyles in header. */
- Exclude checks
The class QFormBase has 44 non-getter- and setter-methods. Consider refactoring QFormBase to keep number of methods under 25. Open
abstract class QFormBase extends QBaseClass {
///////////////////////////
// Static Members
///////////////////////////
/** @var bool True when css scripts get rendered on page. Lets user call RenderStyles in header. */
- 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 QFormBase has 23 public methods. Consider refactoring QFormBase to keep number of public methods under 10. Open
abstract class QFormBase extends QBaseClass {
///////////////////////////
// Static Members
///////////////////////////
/** @var bool True when css scripts get rendered on page. Lets user call RenderStyles in header. */
- 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
Method RenderAjax
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function RenderAjax() {
$aResponse = array();
if (QApplication::$JavascriptExclusiveCommand) {
/**
Function RenderBegin
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function RenderBegin($blnDisplayOutput = true) {
// Ensure that RenderBegin() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
break;
- 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 RenderStyles
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function RenderStyles($blnDisplayOutput = true, $blnInHead = true) {
$strToReturn = '';
$this->strIncludedStyleSheetFileArray = array();
// Figure out initial list of StyleSheet includes
- 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 RenderBegin
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function RenderBegin($blnDisplayOutput = true) {
// Ensure that RenderBegin() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
break;
The class QFormBase has 21 fields. Consider redesigning QFormBase to keep the number of fields under 15. Open
abstract class QFormBase extends QBaseClass {
///////////////////////////
// Static Members
///////////////////////////
/** @var bool True when css scripts get rendered on page. Lets user call RenderStyles in header. */
- 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
Method RenderStyles
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function RenderStyles($blnDisplayOutput = true, $blnInHead = true) {
$strToReturn = '';
$this->strIncludedStyleSheetFileArray = array();
// Figure out initial list of StyleSheet includes
Function ProcessStyleSheetList
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function ProcessStyleSheetList($strStyleSheetFileList) {
$strArrayToReturn = array();
// Is there a comma-delimited list of StyleSheet files to include?
if ($strStyleSheetFileList = trim($strStyleSheetFileList)) {
- 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 GetErrorControls
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function GetErrorControls($blnErrorsOnly = false) {
$objToReturn = array();
foreach ($this->GetAllControls() as $objControl) {
if ($objControl->ValidationError)
array_push($objToReturn, $objControl);
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __set($strName, $mixValue) {
switch ($strName) {
case "HtmlIncludeFilePath":
// Passed-in value is null -- use the "default" path name of file".tpl.php"
if (!$mixValue) {
Function __set
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __set($strName, $mixValue) {
switch ($strName) {
case "HtmlIncludeFilePath":
// Passed-in value is null -- use the "default" path name of file".tpl.php"
if (!$mixValue) {
- 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 GetChildControls
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function GetChildControls($objParentObject) {
$objControlArrayToReturn = array();
if ($objParentObject instanceof QForm) {
// They want all the ChildControls for this 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 ProcessJavaScriptList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function ProcessJavaScriptList($strJavaScriptFileList) {
if (empty($strJavaScriptFileList)) return null;
$strArrayToReturn = array();
- 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 GetErrorMessages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function GetErrorMessages($blnErrorsOnly = false) {
$strToReturn = array();
foreach ($this->GetAllControls() as $objControl) {
if ($objControl->ValidationError)
array_push($strToReturn, $objControl->ValidationError);
- 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 deeply nested control flow statements. Open
if (($strAjaxActionId == NULL) //if this call was not an ajax call
|| ($objAction->Id == NULL) // or the QAjaxAction derived action has no id set
//(a possible way to add a callback that gets executed on every ajax call for this control)
|| ($strAjaxActionId == $objAction->Id)) //or the ajax action id passed from client side equals the id of the current ajax action
$this->TriggerMethod($strControlId, $strMethodName, $objAction);
Function UnpackPostVar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static function UnpackPostVar($val) {
if (QApplication::$EncodingType != 'UTF-8' && QApplication::$RequestMode != QRequestMode::Ajax) {
// json_decode only accepts utf-8 encoded text. Ajax calls are already UTF-8 encoded.
$val = iconv(QApplication::$EncodingType, 'UTF-8', $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
Function ctlDesigner_Click
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function ctlDesigner_Click ($strFormId, $strControlId, $mixParam) {
if (isset($mixParam['id'])) {
$controlId = $mixParam['id'];
if (strpos($controlId, '_')) { // extra the real control id from a sub id
$controlId = substr($controlId, 0, strpos($controlId, '_'));
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function Unserialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function Unserialize($strPostDataState) {
// Setup and Call the FormStateHandler to retrieve the Serialized Form
$strFormStateHandler = QForm::$FormStateHandler;
$strSerializedForm = $strFormStateHandler::Load ($strPostDataState);
- 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 "HtmlIncludeFilePath": return $this->strHtmlIncludeFilePath;
Avoid too many return
statements within this method. Open
case "CssClass": return $this->strCssClass;
Avoid too many return
statements within this method. Open
return parent::__get($strName);
Function RemoveControl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function RemoveControl($strControlId) {
if (isset($this->objControlArray[$strControlId])) {
// Get the Control in Question
$objControl = $this->objControlArray[$strControlId];
- 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 EvaluateTemplate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function EvaluateTemplate($strTemplate) {
global $_ITEM;
global $_CONTROL;
global $_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
The method RenderAjax() has an NPath complexity of 6480. The configured NPath complexity threshold is 200. Open
protected function RenderAjax() {
$aResponse = array();
if (QApplication::$JavascriptExclusiveCommand) {
/**
- 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 RenderAjax() has 105 lines of code. Current threshold is set to 100. Avoid really long methods. Open
protected function RenderAjax() {
$aResponse = array();
if (QApplication::$JavascriptExclusiveCommand) {
/**
- Exclude checks
The method RenderEnd() has 186 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function RenderEnd($blnDisplayOutput = true) {
// Ensure that RenderEnd() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
throw new QCallerException('$this->RenderBegin() was never called');
- Exclude checks
The method RenderEnd() has an NPath complexity of 145152. The configured NPath complexity threshold is 200. Open
public function RenderEnd($blnDisplayOutput = true) {
// Ensure that RenderEnd() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
throw new QCallerException('$this->RenderBegin() was never called');
- 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 class QFormBase has 1885 lines of code. Current threshold is 1000. Avoid really long classes. Open
abstract class QFormBase extends QBaseClass {
///////////////////////////
// Static Members
///////////////////////////
/** @var bool True when css scripts get rendered on page. Lets user call RenderStyles in header. */
- Exclude checks
The method Run() has 253 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- Exclude checks
The method Run() has an NPath complexity of 49352688. The configured NPath complexity threshold is 200. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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 TriggerActions() has 151 lines of code. Current threshold is set to 100. Avoid really long methods. Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- Exclude checks
The method TriggerActions() has an NPath complexity of 41989. The configured NPath complexity threshold is 200. Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- 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 RenderBegin() has an NPath complexity of 768. The configured NPath complexity threshold is 200. Open
public function RenderBegin($blnDisplayOutput = true) {
// Ensure that RenderBegin() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
break;
- 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 Run() has a Cyclomatic Complexity of 53. The configured cyclomatic complexity threshold is 10. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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 RenderBegin() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. Open
public function RenderBegin($blnDisplayOutput = true) {
// Ensure that RenderBegin() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
break;
- 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 RenderEnd() has a Cyclomatic Complexity of 25. The configured cyclomatic complexity threshold is 10. Open
public function RenderEnd($blnDisplayOutput = true) {
// Ensure that RenderEnd() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
throw new QCallerException('$this->RenderBegin() was never called');
- 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 RenderAjax() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10. Open
protected function RenderAjax() {
$aResponse = array();
if (QApplication::$JavascriptExclusiveCommand) {
/**
- 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 TriggerActions() has a Cyclomatic Complexity of 49. The configured cyclomatic complexity threshold is 10. Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- 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 RenderStyles() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
public function RenderStyles($blnDisplayOutput = true, $blnInHead = true) {
$strToReturn = '';
$this->strIncludedStyleSheetFileArray = array();
// Figure out initial list of StyleSheet includes
- 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 class QFormBase has a coupling between objects value of 24. Consider to reduce the number of dependencies under 13. Open
abstract class QFormBase extends QBaseClass {
///////////////////////////
// Static Members
///////////////////////////
/** @var bool True when css scripts get rendered on page. Lets user call RenderStyles in header. */
- 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 '612', column '18'). Open
throw new QCallerException('FormStatus is in an unknown status');
- 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 '572', column '17'). Open
$dlg = new QModelConnectorEditDlg ($objClass, 'qconnectoreditdlg');
- 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 '608', column '18'). Open
throw new QCallerException('$this->RenderEnd() is never called in the HTML Include file');
- 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 '652', column '16'). Open
throw new Exception ('Unknown Post Var Type');
- 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 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 '1362', column '17'). Open
throw new Exception(sprintf('Control passed by Qform__FormControl does not exist: %s', $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
The method RenderStyles has a boolean flag argument $blnDisplayOutput, which is a certain sign of a Single Responsibility Principle violation. Open
public function RenderStyles($blnDisplayOutput = true, $blnInHead = 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 '576', column '11'). Open
new QAjaxAction ('ctlDesigner_Click', null, null, 'ui')
- 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 '1062', column '15'). Open
throw new QCallerException(sprintf("Custom Attribute does not exist in Form: %s", $strName));
- 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 '1482', column '16'). Open
throw new QCallerException('$this->RenderBegin() has already been called');
- 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 GetErrorMessages has a boolean flag argument $blnErrorsOnly, which is a certain sign of a Single Responsibility Principle violation. Open
public function GetErrorMessages($blnErrorsOnly = 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 '617', column '16'). Open
throw new Exception('Unknown Form CallType: ' . $objClass->strCallType);
- 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 '938', column '15'). Open
throw new QCallerException(sprintf('A Grouping already exists in the form with the ID: %s', $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 '1071', column '15'). Open
throw new QCallerException(sprintf('A Control already exists in the form with the ID: %s', $strGroupingId));
- 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 RenderBegin has a boolean flag argument $blnDisplayOutput, which is a certain sign of a Single Responsibility Principle violation. Open
public function RenderBegin($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 '162', column '17'). Open
throw new QCallerException('Accompanying HTML Include File does not exist: "' . $mixValue . '"');
- 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 '1130', 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 '726', column '15'). Open
throw new QDataBindException($objExc);
- 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 '1054', column '15'). Open
throw new QCallerException(sprintf("Custom Attribute does not exist in Form: %s", $strName));
- 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 '575', column '11'). Open
new QOnEvent('qdesignerclick'),
- 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 '936', column '15'). Open
throw new QCallerException(sprintf('A control already exists in the form with the ID: %s', $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 '1720', column '16'). Open
throw new QCallerException('$this->RenderBegin() was never called');
- 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 GetErrorControls has a boolean flag argument $blnErrorsOnly, which is a certain sign of a Single Responsibility Principle violation. Open
public function GetErrorControls($blnErrorsOnly = 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 '606', column '18'). Open
throw new QCallerException('$this->RenderBegin() is never called in the HTML Include file');
- 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 '1069', column '15'). Open
throw new QCallerException(sprintf('A Grouping already exists in the form with the ID: %s', $strGroupingId));
- 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 '1727', column '16'). Open
throw new QCallerException('FormStatus is in an unknown status');
- 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 '1032', column '15'). Open
throw new QCallerException(sprintf("Custom Attribute not supported through SetCustomAttribute(): %s", $strName));
- 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 '1485', column '16'). Open
throw new QCallerException('FormStatus is in an unknown status');
- 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 RenderEnd has a boolean flag argument $blnDisplayOutput, which is a certain sign of a Single Responsibility Principle violation. Open
public function RenderEnd($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 '1724', column '16'). Open
throw new QCallerException('$this->RenderEnd() has already been called');
- 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 '1252', column '19'). Open
throw new Exception('Unknown Form CallType: ' . $this->strCallType);
- 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 RenderStyles has a boolean flag argument $blnInHead, which is a certain sign of a Single Responsibility Principle violation. Open
public function RenderStyles($blnDisplayOutput = true, $blnInHead = 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
Avoid using static access to class 'QType' in method '__set'. Open
return ($this->strCssClass = 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 Run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// We have no form state -- Create Brand New One
$objClass = new $strFormClass();
// Globalize
- 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 VarExport 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 assigning values to variables in if clauses and the like (line '503', column '12'). Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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
The method Run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$objClass->checkableControlValues = [];
}
- 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 Run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$strControlId = $key;
}
- 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 'RenderAjax'. Open
QApplication::ExecuteJavaScript($strScript, QJsPriority::High); // put these last in the high priority queue, just before getting the commands below
- 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 '1191', column '13'). Open
protected function TriggerMethod($strControlId, $strMethodName, QAction $objAction) {
$mixParameter = $_POST['Qform__FormParameter'];
$objSourceControl = $this->objControlArray[$strControlId];
$params = QControl::_ProcessActionParams($objSourceControl, $objAction, $mixParameter);
- 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 'QForm' in method 'RenderAjax'. Open
$strFormState = QForm::Serialize($this);
- 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 'RenderAjax'. Open
QApplication::SendAjaxResponse($aResponse);
- 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 RenderBegin uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return '';
}
- 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 '1600', column '8'). Open
protected function ProcessStyleSheetList($strStyleSheetFileList) {
$strArrayToReturn = array();
// Is there a comma-delimited list of StyleSheet files to include?
if ($strStyleSheetFileList = trim($strStyleSheetFileList)) {
- 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
The method RenderEnd uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if(!QApplication::$CliMode) {
return $strHtml;
} else {
return '';
- 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 Run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
// Ajax post. Only send data to controls specified in the post to save time.
$previouslyFoundArray = array();
$controls = $_POST;
- 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 UnpackPostVar uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
throw new Exception ('Unknown Post Var Type');
}
- 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 InvalidFormState uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
header('Location: '. QApplication::$RequestUri);
}
- 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 'RenderAjax'. Open
QApplication::AddJavaScriptFiles($strScriptArray);
- 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 RemoveControl uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// if the parent is the form, then remove it from the dom through javascript, since the form won't be redrawn
QApplication::ExecuteSelectorFunction('#' . $objControl->GetWrapperId(), 'remove');
}
- 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 TriggerActions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} 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 'QForm' in method 'Run'. Open
$objClass = QForm::Unserialize($strPostDataState);
- 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 SetCustomAttribute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
$this->strCustomAttributeArray[$strName] = null;
unset($this->strCustomAttributeArray[$strName]);
}
- 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 '1301', column '14'). Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- 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 'QApplication' in method 'RenderEnd'. Open
QApplication::AddJavaScriptFiles($strJavaScriptArray);
- 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 Run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Remove all parents
$objClass->objControlArray[$strControlId]->SetParentControl(null);
$objClass->objControlArray[$strControlId]->SetForm(null);
$objClass->objControlArray[$strControlId] = 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 assigning values to variables in if clauses and the like (line '793', column '9'). Open
protected function RenderAjax() {
$aResponse = array();
if (QApplication::$JavascriptExclusiveCommand) {
/**
- 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 'QForm' in method 'RenderAjax'. Open
$strFormState = QForm::Serialize($this);
- 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 'GetJsFileUri'. Open
return QApplication::GetJsFileUri($strFile);
- 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 '1782', column '9'). Open
public function RenderEnd($blnDisplayOutput = true) {
// Ensure that RenderEnd() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
throw new QCallerException('$this->RenderBegin() was never called');
- 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 '506', column '12'). Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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 'QApplication' in method 'RenderAjax'. Open
QApplication::ExecuteJavaScript($strRender, QJsPriority::High);
- 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 TriggerActions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$strControlId = $_POST['Qform__FormControl'];
}
- 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 RenderStyles uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$strToReturn .= '<style type="text/css" media="all">@import "' . $this->GetCssFileUri($strScript) . '"</style>';
}
- 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 'RenderAjax'. Open
QApplication::SendAjaxResponse($aResponse);
- 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 TriggerActions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
$this->Form_Invalid(); // notify form that something went wrong
}
- 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 'RenderEnd'. Open
$strFormJsFiles = QApplication::RenderFiles(); // Render the form-level javascript files separately
- 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 'Unserialize'. Open
$objForm = QType::Cast($objForm, 'QForm');
- 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 TriggerMethod uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->$strMethodName($this, $params['controlId'], $params['param'], $params);
}
- 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 'Render'. Open
QApplication::ExecuteJsFunction('qc.broadcastChange');
- 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 'QWatcher' in method 'Render'. Open
if (QWatcher::WatchersChanged()) {
- 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 '1568', column '9'). Open
protected function ProcessJavaScriptList($strJavaScriptFileList) {
if (empty($strJavaScriptFileList)) return null;
$strArrayToReturn = array();
- 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
The method RenderStyles uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if(!QApplication::$CliMode) {
return $strToReturn;
} else {
return '';
- 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 RenderEnd uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return '';
}
- 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 Run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$objClass->objControlArray[$strControlId]->SetParentControl($objClass->objControlArray[$strValue]);
}
- 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 RenderAjax uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$objControl->RenderAttributeScripts(); // render one-time attribute commands only
}
- 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 'RenderAjax'. Open
$aResponse = array_merge($aResponse, QApplication::GetJavascriptCommandArray());
- 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 'RemoveControl'. Open
QApplication::ExecuteSelectorFunction('#' . $objControl->GetWrapperId(), 'remove');
- 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 RenderBegin uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if(!QApplication::$CliMode) {
return $strToReturn;
} else {
return '';
- 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 '1759', column '10'). Open
public function RenderEnd($blnDisplayOutput = true) {
// Ensure that RenderEnd() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
throw new QCallerException('$this->RenderBegin() was never called');
- 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 '1776', column '9'). Open
public function RenderEnd($blnDisplayOutput = true) {
// Ensure that RenderEnd() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
throw new QCallerException('$this->RenderBegin() was never called');
- 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 'QApplication' in method 'RenderAjax'. Open
$aResponse = QApplication::GetJavascriptCommandArray();
- 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 'QWatcher' in method 'RenderAjax'. Open
if (QWatcher::WatchersChanged()) {
- 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 'RenderAjax'. Open
QApplication::AddStyleSheets(array_keys($strScriptArray));
- 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 'QControl' in method 'TriggerMethod'. Open
QControl::_CallActionMethod ($objDestControl, $strMethodName, $this->strFormId, $params);
- 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 'RenderEnd'. Open
$strEndScript .= ';' . QApplication::RenderJavascript(false);
- 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 'RenderAjax'. Open
QApplication::ExecuteControlCommand($this->strFormId, 'attr', $attributes);
- 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 'RenderBegin'. Open
$strToReturn .= '<form ' . QHtml::RenderHtmlAttributes($strFormAttributeArray) . ">\n";
- 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 'InvalidFormState'. Open
QApplication::SendAjaxResponse(['loc' => 'reload']);
- 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 '798', column '9'). Open
protected function RenderAjax() {
$aResponse = array();
if (QApplication::$JavascriptExclusiveCommand) {
/**
- 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 '1348', column '13'). Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- 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 'QApplication' in method 'RenderEnd'. Open
QApplication::AddJavaScriptFiles($strScriptArray);
- 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 'RenderEnd'. Open
$strEndScript .= QApplication::RenderJavascript(true);
- 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 RenderStyles uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return '';
}
- 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 '1605', column '10'). Open
protected function ProcessStyleSheetList($strStyleSheetFileList) {
$strArrayToReturn = array();
// Is there a comma-delimited list of StyleSheet files to include?
if ($strStyleSheetFileList = trim($strStyleSheetFileList)) {
- 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 'QApplication' in method 'GetCssFileUri'. Open
return QApplication::GetCssFileUri($strFile);
- 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 'JavaScriptHelper' in method 'RenderEnd'. Open
$strControlScript = JavaScriptHelper::TerminateScript($strControlScript);
- 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 RenderAjax uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
ob_clean();
QApplication::SendAjaxResponse($aResponse);
}
- 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 GetControl 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 'QControl' in method 'TriggerMethod'. Open
$params = QControl::_ProcessActionParams($objSourceControl, $objAction, $mixParameter);
- 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 '1319', column '14'). Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} else {
- 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 'JavaScriptHelper' in method 'RenderEnd'. Open
$strGroupingScript = JavaScriptHelper::TerminateScript($strGroupingScript);
- 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 TriggerActions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Nope -- Throw an exception
throw new Exception(sprintf('Control passed by Qform__FormControl does not exist: %s', $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
Avoid assigning values to variables in if clauses and the like (line '1426', column '9'). Open
public function RenderStyles($blnDisplayOutput = true, $blnInHead = true) {
$strToReturn = '';
$this->strIncludedStyleSheetFileArray = array();
// Figure out initial list of StyleSheet includes
- 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 '1507', column '9'). Open
public function RenderBegin($blnDisplayOutput = true) {
// Ensure that RenderBegin() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
break;
- 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 'QApplication' in method 'RenderEnd'. Open
$strHtml .= QApplication::RenderFiles() . _nl(); // add plugin and control js files
- 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 'RenderEnd'. Open
QApplication::AddStyleSheets(array_keys($strScriptArray));
- 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 'JavaScriptHelper' in method 'RenderEnd'. Open
$strEndScript .= sprintf("qc.regCA(%s); \n", JavaScriptHelper::toJsObject($strControlIdToRegister));
- 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 'QForm' in method 'RenderEnd'. Open
$strHtml .= sprintf('<input type="hidden" name="Qform__FormState" id="Qform__FormState" value="%s" />', QForm::Serialize(clone($this))) . _nl();
- 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 private methods such as 'ctlDesigner_Click'. Open
private function ctlDesigner_Click ($strFormId, $strControlId, $mixParam) {
if (isset($mixParam['id'])) {
$controlId = $mixParam['id'];
if (strpos($controlId, '_')) { // extra the real control id from a sub id
$controlId = substr($controlId, 0, strpos($controlId, '_'));
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused parameters such as '$strControlId'. Open
private function ctlDesigner_Click ($strFormId, $strControlId, $mixParam) {
- 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 parameters such as '$strFormId'. Open
private function ctlDesigner_Click ($strFormId, $strControlId, $mixParam) {
- 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 parameters such as '$key'. Open
array_walk_recursive($val, function(&$v, $key) {
- 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
The method InvalidFormState() contains an exit expression. Open
exit();
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
Avoid unused local variables such as '$_ITEM'. Open
global $_ITEM;
- 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 '$_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 '$_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 '$objGrouping'. Open
foreach ($this->objGroupingArray as $strKey => $objGrouping)
- 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
TODO found Open
// TODO: Code to automatically execute any PrimaryButton's onclick action, if applicable
- Exclude checks
TODO found Open
// TODO: Output debugging information.
- Exclude checks
Similar blocks of code found in 4 locations. Consider refactoring. Open
public function __get($strName) {
switch ($strName) {
case "FormId": return $this->strFormId;
case "CallType": return $this->strCallType;
case "DefaultWaitIcon": return $this->objDefaultWaitIcon;
- 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 97.
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
foreach ($strJavaScriptFileList as $strScript) {
if ($strScript = trim($strScript)) {
// Include it if we're NOT ignoring it and it has NOT already been included
if ((array_search($strScript, $this->strIgnoreJavaScriptFileArray) === false) &&
- 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 91.
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
foreach ($strScriptArray as $strScript)
if ($strScript = trim($strScript))
// Include it if we're NOT ignoring it and it has NOT already been included
if ((array_search($strScript, $this->strIgnoreStyleSheetFileArray) === false) &&
- 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 91.
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 $strIncludedStyleSheetFileArray. Keep variable name length under 20. Open
protected $strIncludedStyleSheetFileArray = array();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $strIgnoreJavaScriptFileArray. Keep variable name length under 20. Open
protected $strIgnoreJavaScriptFileArray = array();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $strIgnoreStyleSheetFileArray. Keep variable name length under 20. Open
protected $strIgnoreStyleSheetFileArray = array();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $objControlArrayToReturn. Keep variable name length under 20. Open
$objControlArrayToReturn = array();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $strFormAttributeArray. Keep variable name length under 20. Open
$strFormAttributeArray = array();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $strJavaScriptFileList. Keep variable name length under 20. Open
protected function ProcessJavaScriptList($strJavaScriptFileList) {
- 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 $strPreviousRequestMode. Keep variable name length under 20. Open
protected $strPreviousRequestMode = 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 $strHtmlIncludeFilePath. Keep variable name length under 20. Open
protected $strHtmlIncludeFilePath;
- 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 $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 $checkableControlValues. Keep variable name length under 20. Open
protected $checkableControlValues = array();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $strPreviousRequestMode. Keep variable name length under 20. Open
$strPreviousRequestMode = $objForm->strPreviousRequestMode;
- 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 $strIncludedJavaScriptFileArray. Keep variable name length under 20. Open
protected $strIncludedJavaScriptFileArray = array();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $strStyleSheetFileList. Keep variable name length under 20. Open
protected function ProcessStyleSheetList($strStyleSheetFileList) {
- 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 $strControlIdToRegister. Keep variable name length under 20. Open
$strControlIdToRegister = array();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $strControlIdToRegister. Keep variable name length under 20. Open
$strControlIdToRegister = array();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid variables with short names like $a. Configured minimum length is 3. Open
$a = $this->GetAllControls();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $v. Configured minimum length is 3. Open
array_walk_recursive($val, function(&$v, $key) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $a. Configured minimum length is 3. Open
$a = $this->GetAllControls();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $f. Configured minimum length is 3. Open
$f = explode('::', $strMethodName);
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Constant FormStatusRenderBegun should be defined in uppercase Open
const FormStatusRenderBegun = 2;
- 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 FormStatusRenderEnded should be defined in uppercase Open
const FormStatusRenderEnded = 3;
- 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 FormStatusUnrendered should be defined in uppercase Open
const FormStatusUnrendered = 1;
- 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 static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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;
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 static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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 static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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;
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 static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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;
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 method CheckableControlValue is not named in camelCase. Open
public function CheckableControlValue($strControlId) {
if (array_key_exists($strControlId, $this->checkableControlValues)) {
return $this->checkableControlValues[$strControlId];
}
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 RenderAjaxHelper is not named in camelCase. Open
protected function RenderAjaxHelper($objControl) {
$controls = [];
if ($objControl) {
$controls = array_merge($controls, $objControl->RenderAjax()); // will return an array of controls to be merged with current controls
- 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 Form_Create is not named in camelCase. Open
protected function Form_Create() {}
- 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->objControlArray) foreach ($this->objControlArray as $objControl)
$objControl->VarExport(false);
if ($blnReturn) {
return var_export($this, 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 RemoveControl is not named in camelCase. Open
public function RemoveControl($strControlId) {
if (isset($this->objControlArray[$strControlId])) {
// Get the Control in Question
$objControl = $this->objControlArray[$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 Form_Initialize is not named in camelCase. Open
protected function Form_Initialize() {}
- 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 Form_Invalid is not named in camelCase. Open
protected function Form_Invalid() {}
- 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 GetModifiedControls is not named in camelCase. Open
public function GetModifiedControls() {
$ret = array_filter ($this->objControlArray, 'QForm::IsControlModified');
return $ret;
}
- 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 Form_Load is not named in camelCase. Open
protected function Form_Load() {}
- 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 Form_PreRender is not named in camelCase. Open
protected function Form_PreRender() {}
- 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 Form_Exit is not named in camelCase. Open
protected function Form_Exit() {}
- 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 ctlDesigner_Click is not named in camelCase. Open
private function ctlDesigner_Click ($strFormId, $strControlId, $mixParam) {
if (isset($mixParam['id'])) {
$controlId = $mixParam['id'];
if (strpos($controlId, '_')) { // extra the real control id from a sub id
$controlId = substr($controlId, 0, strpos($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 Render is not named in camelCase. Open
protected function Render() {
if (QWatcher::WatchersChanged()) {
QApplication::ExecuteJsFunction('qc.broadcastChange');
}
- 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) {
if ((is_array($this->strCustomAttributeArray)) && (array_key_exists($strName, $this->strCustomAttributeArray)))
return $this->strCustomAttributeArray[$strName];
else
throw new QCallerException(sprintf("Custom Attribute does not exist in Form: %s", $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 GetJsFileUri is not named in camelCase. Open
public function GetJsFileUri($strFile) {
return QApplication::GetJsFileUri($strFile);
}
- 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) {
if ((is_array($this->strCustomAttributeArray)) && (array_key_exists($strName, $this->strCustomAttributeArray))) {
$this->strCustomAttributeArray[$strName] = null;
unset($this->strCustomAttributeArray[$strName]);
} 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 GenerateAjaxActionId is not named in camelCase. Open
public function GenerateAjaxActionId() {
$strToReturn = sprintf('a%s', $this->intNextAjaxActionId);
$this->intNextAjaxActionId++;
return $strToReturn;
}
- 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 SaveControlState is not named in camelCase. Open
public function SaveControlState() {
// tell the controls to save their state
$a = $this->GetAllControls();
foreach ($a as $control) {
$control->_WriteState();
- 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 AddGrouping is not named in camelCase. Open
public function AddGrouping(QControlGrouping $objGrouping) {
$strGroupingId = $objGrouping->GroupingId;
if (array_key_exists($strGroupingId, $this->objGroupingArray))
throw new QCallerException(sprintf('A Grouping already exists in the form with the ID: %s', $strGroupingId));
if (array_key_exists($strGroupingId, $this->objControlArray))
- 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
protected function RenderAjax() {
$aResponse = array();
if (QApplication::$JavascriptExclusiveCommand) {
/**
- 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 AddControl is not named in camelCase. Open
public function AddControl(QControl $objControl) {
$strControlId = $objControl->ControlId;
$objControl->MarkAsModified(); // make sure new controls get drawn
if (array_key_exists($strControlId, $this->objControlArray))
throw new QCallerException(sprintf('A control already exists in the form with the ID: %s', $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 SetCustomAttribute is not named in camelCase. Open
public function SetCustomAttribute($strName, $strValue) {
if ($strName == "method" || $strName == "action")
throw new QCallerException(sprintf("Custom Attribute not supported through SetCustomAttribute(): %s", $strName));
if (!is_null($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 RemoveGrouping is not named in camelCase. Open
public function RemoveGrouping($strGroupingId) {
if (array_key_exists($strGroupingId, $this->objGroupingArray)) {
// Remove this Grouping
unset($this->objGroupingArray[$strGroupingId]);
}
- 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 GetAllGroupings is not named in camelCase. Open
public function GetAllGroupings() {
return $this->objGroupingArray;
}
- 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 RenderStyles is not named in camelCase. Open
public function RenderStyles($blnDisplayOutput = true, $blnInHead = true) {
$strToReturn = '';
$this->strIncludedStyleSheetFileArray = array();
// Figure out initial list of StyleSheet includes
- 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 GetErrorMessages is not named in camelCase. Open
public function GetErrorMessages($blnErrorsOnly = false) {
$strToReturn = array();
foreach ($this->GetAllControls() as $objControl) {
if ($objControl->ValidationError)
array_push($strToReturn, $objControl->ValidationError);
- 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 IsControlModified is not named in camelCase. Open
protected static function IsControlModified ($objControl) {
return $objControl->IsModified();
}
- 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 GenerateControlId is not named in camelCase. Open
public function GenerateControlId() {
// $strToReturn = sprintf('control%s', $this->intNextControlId);
$strToReturn = sprintf('c%s', $this->intNextControlId);
$this->intNextControlId++;
return $strToReturn;
- 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 Run is not named in camelCase. Open
public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
// See if we can get a Form Class out of PostData
$objClass = null;
if ($strFormId === null) {
$strFormId = $strFormClass;
- 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 GetControl is not named in camelCase. Open
public function GetControl($strControlId) {
if (isset($this->objControlArray[$strControlId])) {
return $this->objControlArray[$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 InvalidFormState is not named in camelCase. Open
public static function InvalidFormState() {
//ob_clean();
if (isset($_POST['Qform__FormCallType']) && $_POST['Qform__FormCallType'] == QCallType::Ajax) {
QApplication::$ProcessOutput = false;
QApplication::SendAjaxResponse(['loc' => 'reload']);
- 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 Serialize is not named in camelCase. Open
public static function Serialize(QForm $objForm) {
// Get and then Update PreviousRequestMode
$strPreviousRequestMode = $objForm->strPreviousRequestMode;
$objForm->strPreviousRequestMode = QApplication::$RequestMode;
- 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 RestoreControlState is not named in camelCase. Open
protected function RestoreControlState() {
// tell the controls to restore their state
$a = $this->GetAllControls();
foreach ($a as $control) {
$control->_ReadState();
- 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($objParentObject) {
$objControlArrayToReturn = array();
if ($objParentObject instanceof QForm) {
// They want all the ChildControls for this 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 RenderChildren is not named in camelCase. Open
protected function RenderChildren($blnDisplayOutput = true) {
$strToReturn = "";
foreach ($this->GetChildControls($this) 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 RenderEnd is not named in camelCase. Open
public function RenderEnd($blnDisplayOutput = true) {
// Ensure that RenderEnd() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
throw new QCallerException('$this->RenderBegin() was never called');
- 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 Form_Run is not named in camelCase. Open
protected function Form_Run() {}
- 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 Form_Validate is not named in camelCase. Open
protected function Form_Validate() {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 UnpackPostVar is not named in camelCase. Open
protected static function UnpackPostVar($val) {
if (QApplication::$EncodingType != 'UTF-8' && QApplication::$RequestMode != QRequestMode::Ajax) {
// json_decode only accepts utf-8 encoded text. Ajax calls are already UTF-8 encoded.
$val = iconv(QApplication::$EncodingType, 'UTF-8', $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 ResetValidationStates is not named in camelCase. Open
public function ResetValidationStates() {
foreach ($this->objControlArray as $objControl) {
$objControl->ValidationReset();
}
}
- 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 Unserialize is not named in camelCase. Open
public static function Unserialize($strPostDataState) {
// Setup and Call the FormStateHandler to retrieve the Serialized Form
$strFormStateHandler = QForm::$FormStateHandler;
$strSerializedForm = $strFormStateHandler::Load ($strPostDataState);
- 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 GetErrorControls is not named in camelCase. Open
public function GetErrorControls($blnErrorsOnly = false) {
$objToReturn = array();
foreach ($this->GetAllControls() as $objControl) {
if ($objControl->ValidationError)
array_push($objToReturn, $objControl);
- 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 TriggerMethod is not named in camelCase. Open
protected function TriggerMethod($strControlId, $strMethodName, QAction $objAction) {
$mixParameter = $_POST['Qform__FormParameter'];
$objSourceControl = $this->objControlArray[$strControlId];
$params = QControl::_ProcessActionParams($objSourceControl, $objAction, $mixParameter);
- 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 RenderBegin is not named in camelCase. Open
public function RenderBegin($blnDisplayOutput = true) {
// Ensure that RenderBegin() has not yet been called
switch ($this->intFormStatus) {
case QFormBase::FormStatusUnrendered:
break;
- 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;
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 ProcessStyleSheetList is not named in camelCase. Open
protected function ProcessStyleSheetList($strStyleSheetFileList) {
$strArrayToReturn = array();
// Is there a comma-delimited list of StyleSheet files to include?
if ($strStyleSheetFileList = trim($strStyleSheetFileList)) {
- 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 IsPostBack is not named in camelCase. Open
public function IsPostBack() {
return ($this->strCallType != QCallType::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 GetFormJavaScripts is not named in camelCase. Open
protected function GetFormJavaScripts() {
return array (__JQUERY_BASE__,
__JQUERY_EFFECTS__,
'ajaxq/ajaxq.js',
__QCUBED_JS_CORE__);
- 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 CallDataBinder is not named in camelCase. Open
public function CallDataBinder($callable, $objPaginatedControl) {
try {
call_user_func($callable, $objPaginatedControl);
} catch (QCallerException $objExc) {
throw new QDataBindException($objExc);
- 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 GetAllControls is not named in camelCase. Open
public function GetAllControls() {
return $this->objControlArray;
}
- 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
protected function ValidateControlAndChildren(QControl $objControl) {
return $objControl->ValidateControlAndChildren();
}
- 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 TriggerActions is not named in camelCase. Open
protected function TriggerActions($strControlIdOverride = null) {
if (array_key_exists('Qform__FormControl', $_POST)) {
if ($strControlIdOverride) {
$strControlId = $strControlIdOverride;
} 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 GetGrouping is not named in camelCase. Open
public function GetGrouping($strGroupingId) {
if (array_key_exists($strGroupingId, $this->objGroupingArray))
return $this->objGroupingArray[$strGroupingId];
else
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 ProcessJavaScriptList is not named in camelCase. Open
protected function ProcessJavaScriptList($strJavaScriptFileList) {
if (empty($strJavaScriptFileList)) return null;
$strArrayToReturn = array();
- 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 GetCssFileUri is not named in camelCase. Open
public function GetCssFileUri($strFile) {
return QApplication::GetCssFileUri($strFile);
}
- 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() {
}
}