QueryString accesses the super-global variable $_GET. Open
public static function QueryString($strItem) {
if (array_key_exists($strItem, $_GET))
return $_GET[$strItem];
else
return null;
- 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
IsRemoteAdminSession accesses the super-global variable $_SERVER. Open
public static function IsRemoteAdminSession() {
// Allow Remote?
if (ALLOW_REMOTE_ADMIN === true)
return false;
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
IsRemoteAdminSession accesses the super-global variable $_SERVER. Open
public static function IsRemoteAdminSession() {
// Allow Remote?
if (ALLOW_REMOTE_ADMIN === true)
return false;
- 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
IsRemoteAdminSession accesses the super-global variable $_SERVER. Open
public static function IsRemoteAdminSession() {
// Allow Remote?
if (ALLOW_REMOTE_ADMIN === true)
return false;
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
GenerateQueryString accesses the super-global variable $_GET. Open
public static function GenerateQueryString($arr = null) {
if(null === $arr)
$arr = $_GET;
if (count($arr)) {
$strToReturn = '';
- 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
IsRemoteAdminSession accesses the super-global variable $_SERVER. Open
public static function IsRemoteAdminSession() {
// Allow Remote?
if (ALLOW_REMOTE_ADMIN === true)
return false;
- 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
Redirect accesses the super-global variable $_POST. Open
public static function Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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
IsRemoteAdminSession accesses the super-global variable $_SERVER. Open
public static function IsRemoteAdminSession() {
// Allow Remote?
if (ALLOW_REMOTE_ADMIN === true)
return false;
- 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
Redirect accesses the super-global variable $_SERVER. Open
public static function Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
Redirect accesses the super-global variable $_SERVER. Open
public static function Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
QueryString accesses the super-global variable $_GET. Open
public static function QueryString($strItem) {
if (array_key_exists($strItem, $_GET))
return $_GET[$strItem];
else
return null;
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
DeleteCookie accesses the super-global variable $_COOKIE. Open
public static function DeleteCookie($strName) {
if (isset($_COOKIE[$strName])) { // don't post a cookie if its not set
$dttTimeout = QDateTime::Now();
$dttTimeout->AddYears(-5);
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
Redirect accesses the super-global variable $_POST. Open
public static function Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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
CheckRemoteAdmin accesses the super-global variable $_SERVER. Open
public static function CheckRemoteAdmin() {
if (!QApplication::IsRemoteAdminSession()) {
return;
}
- 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
Initialize accesses the super-global variable $_SERVER. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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 Initialize
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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 QApplicationBase.class.php
has 726 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This abstract class should never be instantiated. It contains static methods,
* variables and constants to be used throughout the application.
*
QApplicationBase
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class QApplicationBase extends QBaseClass {
//////////////////////////
// Public Static Variables
//////////////////////////
Method Initialize
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
Function Autoload
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static function Autoload($strClassName) {
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
return true;
} else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
- 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 InitializeDatabaseConnections
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static function InitializeDatabaseConnections() {
// for backward compatibility, don't use MAX_DB_CONNECTION_INDEX directly,
// but check if MAX_DB_CONNECTION_INDEX is defined
$intMaxIndex = defined('MAX_DB_CONNECTION_INDEX') ? constant('MAX_DB_CONNECTION_INDEX') : 9;
- 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 QApplicationBase has an overall complexity of 208 which is very high. The configured complexity threshold is 50. Open
abstract class QApplicationBase extends QBaseClass {
//////////////////////////
// Public Static Variables
//////////////////////////
- Exclude checks
The class QApplicationBase has 32 non-getter- and setter-methods. Consider refactoring QApplicationBase to keep number of methods under 25. Open
abstract class QApplicationBase extends QBaseClass {
//////////////////////////
// Public Static Variables
//////////////////////////
- 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 QApplicationBase has 30 public methods. Consider refactoring QApplicationBase to keep number of public methods under 10. Open
abstract class QApplicationBase extends QBaseClass {
//////////////////////////
// Public Static Variables
//////////////////////////
- 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
Function RenderCommandArray
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private static function RenderCommandArray(array $commandArray) {
$strScript = '';
foreach ($commandArray as $command) {
if (isset($command['script'])) { // a script to use eval on
$strScript .= sprintf('%s;', $command['script']) . _nl();
- 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 Redirect
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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 QApplicationBase has 30 fields. Consider redesigning QApplicationBase to keep the number of fields under 15. Open
abstract class QApplicationBase extends QBaseClass {
//////////////////////////
// Public Static Variables
//////////////////////////
- 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 RenderJavascript
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
Function RenderJavascript
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 VarDump
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function VarDump() {
_p('<div class="var-dump"><strong>QCubed Settings</strong><ul>', false);
$arrValidationErrors = QInstallationValidator::Validate();
foreach ($arrValidationErrors as $objResult) {
printf('<li><strong class="warning">WARNING:</strong> %s</li>', $objResult->strMessage);
Method RenderCommandArray
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function RenderCommandArray(array $commandArray) {
$strScript = '';
foreach ($commandArray as $command) {
if (isset($command['script'])) { // a script to use eval on
$strScript .= sprintf('%s;', $command['script']) . _nl();
Function VarDump
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function VarDump() {
_p('<div class="var-dump"><strong>QCubed Settings</strong><ul>', false);
$arrValidationErrors = QInstallationValidator::Validate();
foreach ($arrValidationErrors as $objResult) {
printf('<li><strong class="warning">WARNING:</strong> %s</li>', $objResult->strMessage);
- 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 ExecuteSelectorFunction
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function ExecuteSelectorFunction ($mixSelector, $strFunctionName /*, ..., QJsPriority */) {
if (!(is_string($mixSelector) || (is_array($mixSelector) && count($mixSelector) == 2))) {
throw new QCallerException ('Selector must be a string or an array of two items');
}
$args = func_get_args();
Method InitializeDatabaseConnections
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function InitializeDatabaseConnections() {
// for backward compatibility, don't use MAX_DB_CONNECTION_INDEX directly,
// but check if MAX_DB_CONNECTION_INDEX is defined
$intMaxIndex = defined('MAX_DB_CONNECTION_INDEX') ? constant('MAX_DB_CONNECTION_INDEX') : 9;
The class QApplicationBase has 64 public methods and attributes. Consider reducing the number of public items to less than 45. Open
abstract class QApplicationBase extends QBaseClass {
//////////////////////////
// Public Static Variables
//////////////////////////
- Read upRead up
- Exclude checks
ExcessivePublicCount
Since: 0.1
A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.
Example
public class Foo {
public $value;
public $something;
public $var;
// [... more more public attributes ...]
public function doWork() {}
public function doMoreWork() {}
public function doWorkAgain() {}
// [... more more public methods ...]
}
Source https://phpmd.org/rules/codesize.html#excessivepubliccount
Method GetJavascriptCommandArray
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
Function IsRemoteAdminSession
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function IsRemoteAdminSession() {
// Allow Remote?
if (ALLOW_REMOTE_ADMIN === true)
return false;
- 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 ExecuteJavaScript
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function ExecuteJavaScript($strJavaScript, $strPriority = QJsPriority::Standard) {
if (is_bool($strPriority)) {
//we keep this codepath for backward compatibility
if ($strPriority === true) {
throw new QCallerException('Please specify a correct priority value');
- 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 OutputPage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function OutputPage($strBuffer) {
// If the ProcessOutput flag is set to false, simply return the buffer
// without processing anything.
if (!QApplication::$ProcessOutput)
return $strBuffer;
- 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 ExecuteSelectorFunction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function ExecuteSelectorFunction ($mixSelector, $strFunctionName /*, ..., QJsPriority */) {
if (!(is_string($mixSelector) || (is_array($mixSelector) && count($mixSelector) == 2))) {
throw new QCallerException ('Selector must be a string or an array of two items');
}
$args = func_get_args();
- 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 SetCookie
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function SetCookie($strName, $strValue, QDateTime $dttTimeout, $strPath = '/', $strDomain = null, $blnSecure = false) {
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $strBuffer;
Avoid too many return
statements within this method. Open
return false;
Function GetJavascriptCommandArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [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
Function ExecuteJsFunction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function ExecuteJsFunction($strFunctionName /*, ... */) {
$args = func_get_args();
array_shift ($args);
if ($args && end($args) === QJsPriority::High) {
$code = QAjaxResponse::CommandsHigh;
- 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 IsIPInRange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function IsIPInRange($ip, $range) {
$ip = trim($ip);
if (strpos($range, '/') !== false) {
// we are given a IP/mask
list($net, $mask) = explode('/', $range);
- 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 QApplicationBase has 1401 lines of code. Current threshold is 1000. Avoid really long classes. Open
abstract class QApplicationBase extends QBaseClass {
//////////////////////////
// Public Static Variables
//////////////////////////
- Exclude checks
The method Initialize() has an NPath complexity of 11321856. The configured NPath complexity threshold is 200. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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 Initialize() has 185 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- Exclude checks
The method RenderJavascript() has an NPath complexity of 576. The configured NPath complexity threshold is 200. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 InitializeDatabaseConnections() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
public static function InitializeDatabaseConnections() {
// for backward compatibility, don't use MAX_DB_CONNECTION_INDEX directly,
// but check if MAX_DB_CONNECTION_INDEX is defined
$intMaxIndex = defined('MAX_DB_CONNECTION_INDEX') ? constant('MAX_DB_CONNECTION_INDEX') : 9;
- 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 ExecuteSelectorFunction() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. Open
public static function ExecuteSelectorFunction ($mixSelector, $strFunctionName /*, ..., QJsPriority */) {
if (!(is_string($mixSelector) || (is_array($mixSelector) && count($mixSelector) == 2))) {
throw new QCallerException ('Selector must be a string or an array of two items');
}
$args = func_get_args();
- 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 Initialize() has a Cyclomatic Complexity of 43. The configured cyclomatic complexity threshold is 10. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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 RenderJavascript() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[QAjaxResponse::CommandsFinal][] = ['selector'=>$mixSelector, 'func'=>$strFunctionName, 'params'=>$args, 'final'=>true];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[$code][] = ['func'=>$strFunctionName, 'params'=>$args];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
array_merge (QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets], $strStyleSheetArray);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptFileArray' which will lead to PHP notices. Open
array_merge (QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts], $strJavaScriptFileArray);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
if (empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets] =
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[QAjaxResponse::Close] = true;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptFileArray' which will lead to PHP notices. Open
QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts] = $strJavaScriptFileArray;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets] = $strStyleSheetArray;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptFileArray' which will lead to PHP notices. Open
QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts] =
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[QAjaxResponse::Alert][] = $strMessage;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$Database' which will lead to PHP notices. Open
QApplication::$Database[$intIndex] = new $strDatabaseType($intIndex, $objConfigArray);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$aResponse' which will lead to PHP notices. Open
$aResponse[QAjaxResponse::Close] = 1;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptFileArray' which will lead to PHP notices. Open
if (empty(QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts])) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$ClassFile' which will lead to PHP notices. Open
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$ClassFile' which will lead to PHP notices. Open
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[QAjaxResponse::CommandsLow][] = ['script'=>$strJavaScript];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$aResponse' which will lead to PHP notices. Open
QApplication::SendAjaxResponse($aResponse);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[QAjaxResponse::CommandsHigh][] = ['script'=>$strJavaScript];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[QAjaxResponse::CommandsMedium][] = ['script'=>$strJavaScript];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$JavascriptCommandArray' which will lead to PHP notices. Open
QApplication::$JavascriptCommandArray[$code][] = ['selector'=>$mixSelector, 'func'=>$strFunctionName, 'params'=>$args];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
The class QApplicationBase has a coupling between objects value of 19. Consider to reduce the number of dependencies under 13. Open
abstract class QApplicationBase extends QBaseClass {
//////////////////////////
// Public Static Variables
//////////////////////////
- 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
The method CloseWindow has a boolean flag argument $blnAbortCurrentScript, which is a certain sign of a Single Responsibility Principle violation. Open
public static function CloseWindow($blnAbortCurrentScript = 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 '1227', column '24'). Open
$objParams = new QJsParameterList($params);
- 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 RenderJavascript has a boolean flag argument $blnBeforeControls, which is a certain sign of a Single Responsibility Principle violation. Open
public static function RenderJavascript($blnBeforeControls = 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 '976', column '15'). Open
throw new QCallerException ('Selector must be a string or an array of two items');
- 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 SetCookie has a boolean flag argument $blnSecure, which is a certain sign of a Single Responsibility Principle violation. Open
public static function SetCookie($strName, $strValue, QDateTime $dttTimeout, $strPath = '/', $strDomain = null, $blnSecure = 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 '555', column '15'). Open
throw new QCallerException('Error handler is already currently overridden. Cannot override twice. Call RestoreErrorHandler before calling SetErrorHandler again.');
- 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 '464', column '15'). Open
throw new Exception('Do not define DB_CONNECTION_0. Start at DB_CONNECTION_1');
- 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 '496', column '18'). Open
throw new Exception('Database Type is not valid: ' . $objConfigArray['adapter']);
- 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 '571', column '15'). Open
throw new QCallerException('Error handler is not currently overridden. Cannot reset something that was never overridden.');
- 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 '276', column '15'). Open
throw new Exception('Error on QApplication::Initialize() - ScriptFilename or ScriptName was not set');
- 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 '926', column '16'). Open
throw new QCallerException('Please specify a correct priority value');
- 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 '490', column '17'). Open
throw new Exception('No Server Defined for ' . $strConstantName . ': ' . constant($strConstantName));
- 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 Redirect has a boolean flag argument $blnAbortCurrentScript, which is a certain sign of a Single Responsibility Principle violation. Open
public static function Redirect($strLocation, $blnAbortCurrentScript = 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 '775', column '14'). Open
throw new QRemoteAdminDeniedException();
- 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 '1218', column '24'). Open
$objParams = new QJsParameterList($params);
- 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 '237', column '14'). Open
throw new QCallerException('Application should never be instantiated. All methods and variables are publically statically accessible.');
- 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 '301', column '17'). Open
throw new Exception('Invalid URL Rewrite type: ' . __URL_REWRITE__);
- 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 '487', column '17'). Open
throw new Exception('No Adapter Defined for ' . $strConstantName . ': ' . var_export($objConfigArray, true));
- 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
Avoid assigning values to variables in if clauses and the like (line '527', column '27'). Open
public static function Autoload($strClassName) {
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
return true;
} else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
- 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 'GenerateQueryStringHelper'. Open
$strToReturn .= QApplication::GenerateQueryStringHelper($strKey . '[' . $strSubKey . ']', $mixSubValue);
- 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 '1217', column '10'). Open
private static function RenderCommandArray(array $commandArray) {
$strScript = '';
foreach ($commandArray as $command) {
if (isset($command['script'])) { // a script to use eval on
$strScript .= sprintf('%s;', $command['script']) . _nl();
- 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 RenderCommandArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$strParams = '';
}
- 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 'QDbBackedSessionHandler' in method 'SessionOverride'. Open
QDbBackedSessionHandler::Initialize(DB_BACKED_SESSION_HANDLER_DB_INDEX, DB_BACKED_SESSION_HANDLER_TABLE_NAME);
- 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 SetErrorHandler uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
set_error_handler($strName, $intLevel);
QApplicationBase::$intStoredErrorLevel = -1;
}
- 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 RenderCommandArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
$strSelector = '"' . $command['selector'] . '"';
}
- 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 Initialize uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
QApplication::$RequestUri = sprintf('%s%s%s',
QApplication::$ScriptName, QApplication::$PathInfo,
(QApplication::$QueryString) ? sprintf('?%s', QApplication::$QueryString) : null);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method ExecuteJsFunction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
$code = QAjaxResponse::CommandsMedium;
}
- 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 'IsRemoteAdminSession'. Open
if (QApplication::IsIPInRange($_SERVER['REMOTE_ADDR'], $strIpAddress) ||
- 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 ExecuteJavaScript uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
switch ($strPriority) {
case QJsPriority::High:
QApplication::$JavascriptCommandArray[QAjaxResponse::CommandsHigh][] = ['script'=>$strJavaScript];
break;
- 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 'QApplicationBase' in method 'OutputPage'. Open
$strScript = QApplicationBase::RenderJavascript();
- 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 RenderCommandArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
$strParams = '';
}
- 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 CloseWindow uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Use JavaScript to close
_p('<script type="text/javascript">window.close();</script>', false);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method AddStyleSheets uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets] =
array_merge (QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets], $strStyleSheetArray);
}
- 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 'JavascriptHelper' in method 'SendAjaxResponse'. Open
$strJSON = JavascriptHelper::toJSON($strResponseArray);
- 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 '533', column '26'). Open
public static function Autoload($strClassName) {
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
return true;
} else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
- 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 Redirect uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
global $_FORM;
if ($_FORM) {
$_FORM->SaveControlState();
- 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 Redirect uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// We're likely using this as a CGI
// Use JavaScript to redirect
printf('<script type="text/javascript">document.location = "%s";</script>', $strLocation);
}
- 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 'CloseWindow'. 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 OutputPage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Update Cache-Control setting
header('Cache-Control: ' . QApplication::$CacheControl);
// make sure the server does not override the character encoding value by explicitly sending it out as a header.
// some servers will use an internal default if not specified in the header, and that will override the "encoding" value sent in the text.
- 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 CloseWindow uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
// Clear the output buffer (if any)
ob_clean();
if (QApplication::$RequestMode == QRequestMode::Ajax) {
- 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 'GenerateQueryString'. Open
$strToReturn .= QApplication::GenerateQueryStringHelper(urlencode($strKey), $mixValue);
- 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 ExecuteSelectorFunction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
$code = QAjaxResponse::CommandsMedium;
}
- 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 '530', column '27'). Open
public static function Autoload($strClassName) {
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
return true;
} else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
- 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 'CheckRemoteAdmin'. Open
if (!QApplication::IsRemoteAdminSession()) {
- 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 'IsRemoteAdminSession'. Open
(array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && (QApplication::IsIPInRange($_SERVER['HTTP_X_FORWARDED_FOR'], $strIpAddress)))) {
- 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 OutputPage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (QApplication::$RequestMode == QRequestMode::Ajax) {
return trim($strBuffer);
} else {
// Update Cache-Control setting
- 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 'QInstallationValidator' in method 'VarDump'. Open
$arrValidationErrors = QInstallationValidator::Validate();
- 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 IsIPInRange uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// mask is an integer
$ip_mask = ~((1 << (32 - $mask)) - 1);
}
- 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 'EndOutputBuffering'. Open
return QApplication::OutputPage($strBuffer);
- 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 Initialize uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
QApplicationBase::$objCacheProvider = new $strCacheProviderClass();
}
- 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 Redirect uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Was "DOCUMENT_ROOT" set?
if (array_key_exists('DOCUMENT_ROOT', $_SERVER) && ($_SERVER['DOCUMENT_ROOT'])) {
// If so, we're likely using PHP as a Plugin/Module
// Use 'header' to redirect
- 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 AddJavaScriptFiles uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts] =
array_merge (QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts], $strJavaScriptFileArray);
}
- 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 '524', column '27'). Open
public static function Autoload($strClassName) {
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
return true;
} else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
- 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 SetCookie uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
setcookie($strName, $strValue, $dttTimeout->Timestamp, $strPath, $strDomain, $blnSecure);
}
- 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 'RenderFiles'. Open
$strScript .= sprintf('<script type="text/javascript" src="%s"></script>', QApplication::GetJsFileUri($js)) . "\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 'QFolder' in method 'MakeDirectory'. Open
return QFolder::MakeDirectory($strPath, $intMode);
- 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 'Redirect'. Open
QApplication::SendAjaxResponse(array(QAjaxResponse::Location => $strLocation));
- 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 Initialize uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
preg_match ('#opera\s(.+)#', $strUserAgent, $matches);
if ($matches) {
QApplication::$BrowserVersion = (float)$matches[1];
}
- 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 'QString' in method 'PathInfo'. Open
if (QString::FirstCharacter($strPathInfo) == '/')
- 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 '1226', column '10'). Open
private static function RenderCommandArray(array $commandArray) {
$strScript = '';
foreach ($commandArray as $command) {
if (isset($command['script'])) { // a script to use eval on
$strScript .= sprintf('%s;', $command['script']) . _nl();
- 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 '535', column '33'). Open
public static function Autoload($strClassName) {
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
return true;
} else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
- 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 'QDateTime' in method 'DeleteCookie'. Open
$dttTimeout = QDateTime::Now();
- 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 local variables such as '$objObject'. Open
if (QApplication::$Database) foreach (QApplication::$Database as $intKey => $objObject) {
- 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
The method Redirect() 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 '$str'. Open
$str = '';
- 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
The method CloseWindow() 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
TODO found Open
* TODO: break this into two routines, since the resulting UI behavior is really different. Redirect and LoadPage??
- Exclude checks
TODO found Open
* TODO: Since this is implemented with an "eval" on the client side in ajax, we should phase this out in favor
- Exclude checks
TODO found Open
// TODO: Cache PathInfo
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
public static function GetCssFileUri($strFile) {
if ((strpos($strFile, "http") === 0) || (strpos($strFile, "https") === 0))
return $strFile;
if (strpos($strFile, "/") === 0)
return __VIRTUAL_DIRECTORY__ . $strFile;
- 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 98.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public static function GetJsFileUri($strFile) {
if ((strpos($strFile, "http") === 0) || (strpos($strFile, "https") === 0))
return $strFile;
if (strpos($strFile, "/") === 0)
return __VIRTUAL_DIRECTORY__ . $strFile;
- 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 98.
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 $strCacheProviderClass. Keep variable name length under 20. Open
$strCacheProviderClass = 'QCacheProviderNoCache';
- 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 $JavascriptCommandArray. Keep variable name length under 20. Open
protected static $JavascriptCommandArray = 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 $blnAbortCurrentScript. Keep variable name length under 20. Open
public static function CloseWindow($blnAbortCurrentScript = 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 $JavascriptExclusiveCommand. Keep variable name length under 20. Open
public static $JavascriptExclusiveCommand = 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 $strJavaScriptFileArray. Keep variable name length under 20. Open
public static function AddJavaScriptFiles ($strJavaScriptFileArray) {
- 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 $blnAbortCurrentScript. Keep variable name length under 20. Open
public static function Redirect($strLocation, $blnAbortCurrentScript = true) {
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $DefaultCrossScriptingMode. Keep variable name length under 20. Open
public static $DefaultCrossScriptingMode = QCrossScripting::Legacy;
- 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[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $ip. Configured minimum length is 3. Open
public static function IsIPInRange($ip, $range) {
- 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 Chrome should be defined in uppercase Open
const Chrome = 0x100000;
- 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 Macintosh should be defined in uppercase Open
const Macintosh = 0x2000000;
- 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 High should be defined in uppercase Open
const High = '*jsHigh*';
- 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 Safari should be defined in uppercase Open
const Safari = 0x200;
- 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 Linux should be defined in uppercase Open
const Linux = 0x1000000;
- 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 Mobile should be defined in uppercase Open
const Mobile = 0x4000000; // some kind of mobile browser
- 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 Standard should be defined in uppercase Open
const Standard = '*jsMed*';
- 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 InternetExplorer should be defined in uppercase Open
const InternetExplorer = 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
Constant Standard should be defined in uppercase Open
const Standard = 'Standard';
- 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 Ajax should be defined in uppercase Open
const Ajax = 'Ajax';
- 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 Unsupported should be defined in uppercase Open
const Unsupported = 0x8000000;
- 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 Last should be defined in uppercase Open
const Last = '*jsFinal*';
- 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 Konqueror should be defined in uppercase Open
const Konqueror = 0x20000;
- 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 Low should be defined in uppercase Open
const Low = '*jsLow*';
- 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 Opera should be defined in uppercase Open
const Opera = 0x2000;
- 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 Exclusive should be defined in uppercase Open
const Exclusive = '*jsExclusive*';
- 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 Windows should be defined in uppercase Open
const Windows = 0x800000;
- 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 Firefox should be defined in uppercase Open
const Firefox = 0x10;
- 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 Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $JavascriptFileArray is not named in camelCase. Open
public static function RenderFiles() {
$strScript = '';
// Javascript files should get processed before the commands.
if (!empty(QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function ExecuteJavaScript($strJavaScript, $strPriority = QJsPriority::Standard) {
if (is_bool($strPriority)) {
//we keep this codepath for backward compatibility
if ($strPriority === true) {
throw new QCallerException('Please specify a correct priority value');
- 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 $JavascriptFileArray is not named in camelCase. Open
public static function AddJavaScriptFiles ($strJavaScriptFileArray) {
if (empty(QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts])) {
QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts] = $strJavaScriptFileArray;
}
else {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $ClassFile is not named in camelCase. Open
public static function Autoload($strClassName) {
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
return true;
} else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
- 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 $ip_mask is not named in camelCase. Open
public static function IsIPInRange($ip, $range) {
$ip = trim($ip);
if (strpos($range, '/') !== false) {
// we are given a IP/mask
list($net, $mask) = explode('/', $range);
- 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 $ip_mask is not named in camelCase. Open
public static function IsIPInRange($ip, $range) {
$ip = trim($ip);
if (strpos($range, '/') !== false) {
// we are given a IP/mask
list($net, $mask) = explode('/', $range);
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function DisplayAlert($strMessage) {
QApplication::$JavascriptCommandArray[QAjaxResponse::Alert][] = $strMessage;
}
- 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 $ip_mask is not named in camelCase. Open
public static function IsIPInRange($ip, $range) {
$ip = trim($ip);
if (strpos($range, '/') !== false) {
// we are given a IP/mask
list($net, $mask) = explode('/', $range);
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function AddStyleSheets (array $strStyleSheetArray) {
if (empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets] = $strStyleSheetArray;
}
else {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function ExecuteJavaScript($strJavaScript, $strPriority = QJsPriority::Standard) {
if (is_bool($strPriority)) {
//we keep this codepath for backward compatibility
if ($strPriority === true) {
throw new QCallerException('Please specify a correct priority value');
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function ExecuteSelectorFunction ($mixSelector, $strFunctionName /*, ..., QJsPriority */) {
if (!(is_string($mixSelector) || (is_array($mixSelector) && count($mixSelector) == 2))) {
throw new QCallerException ('Selector must be a string or an array of two items');
}
$args = func_get_args();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $JavascriptCommandArray is not named in camelCase. Open
public static function ExecuteSelectorFunction ($mixSelector, $strFunctionName /*, ..., QJsPriority */) {
if (!(is_string($mixSelector) || (is_array($mixSelector) && count($mixSelector) == 2))) {
throw new QCallerException ('Selector must be a string or an array of two items');
}
$args = func_get_args();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $JavascriptCommandArray is not named in camelCase. Open
public static function AddStyleSheets (array $strStyleSheetArray) {
if (empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets] = $strStyleSheetArray;
}
else {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 $ClassFile is not named in camelCase. Open
public static function Autoload($strClassName) {
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
return true;
} else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function CloseWindow($blnAbortCurrentScript = false) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Close] = true;
}
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function AddStyleSheets (array $strStyleSheetArray) {
if (empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets] = $strStyleSheetArray;
}
else {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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 $JavascriptFileArray is not named in camelCase. Open
public static function AddJavaScriptFiles ($strJavaScriptFileArray) {
if (empty(QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts])) {
QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts] = $strJavaScriptFileArray;
}
else {
- 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 $JavascriptFileArray is not named in camelCase. Open
public static function AddJavaScriptFiles ($strJavaScriptFileArray) {
if (empty(QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts])) {
QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts] = $strJavaScriptFileArray;
}
else {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $Database is not named in camelCase. Open
public static function InitializeDatabaseConnections() {
// for backward compatibility, don't use MAX_DB_CONNECTION_INDEX directly,
// but check if MAX_DB_CONNECTION_INDEX is defined
$intMaxIndex = defined('MAX_DB_CONNECTION_INDEX') ? constant('MAX_DB_CONNECTION_INDEX') : 9;
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function ExecuteJsFunction($strFunctionName /*, ... */) {
$args = func_get_args();
array_shift ($args);
if ($args && end($args) === QJsPriority::High) {
$code = QAjaxResponse::CommandsHigh;
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function AddStyleSheets (array $strStyleSheetArray) {
if (empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets] = $strStyleSheetArray;
}
else {
- 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 $JavascriptFileArray is not named in camelCase. Open
public static function AddJavaScriptFiles ($strJavaScriptFileArray) {
if (empty(QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts])) {
QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts] = $strJavaScriptFileArray;
}
else {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function ExecuteJavaScript($strJavaScript, $strPriority = QJsPriority::Standard) {
if (is_bool($strPriority)) {
//we keep this codepath for backward compatibility
if ($strPriority === true) {
throw new QCallerException('Please specify a correct priority value');
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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 $ip_mask is not named in camelCase. Open
public static function IsIPInRange($ip, $range) {
$ip = trim($ip);
if (strpos($range, '/') !== false) {
// we are given a IP/mask
list($net, $mask) = explode('/', $range);
- 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 $JavascriptFileArray is not named in camelCase. Open
public static function RenderFiles() {
$strScript = '';
// Javascript files should get processed before the commands.
if (!empty(QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts])) {
- 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 $JavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [QApplication::$JavascriptExclusiveCommand];
- 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 InitializeDatabaseConnections is not named in camelCase. Open
public static function InitializeDatabaseConnections() {
// for backward compatibility, don't use MAX_DB_CONNECTION_INDEX directly,
// but check if MAX_DB_CONNECTION_INDEX is defined
$intMaxIndex = defined('MAX_DB_CONNECTION_INDEX') ? constant('MAX_DB_CONNECTION_INDEX') : 9;
- 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 ExecuteControlCommand is not named in camelCase. Open
public static function ExecuteControlCommand ($strControlId, $strFunctionName /*, ..., QJsPriority */) {
$args = func_get_args();
$args[0] = '#' . $strControlId;
call_user_func_array('QApplication::ExecuteSelectorFunction', $args);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method GetJsFileUri is not named in camelCase. Open
public static function GetJsFileUri($strFile) {
if ((strpos($strFile, "http") === 0) || (strpos($strFile, "https") === 0))
return $strFile;
if (strpos($strFile, "/") === 0)
return __VIRTUAL_DIRECTORY__ . $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 StartOutputBuffering is not named in camelCase. Open
public static function StartOutputBuffering() {
if (php_sapi_name() !== 'cli' && // Do not buffer the command line interface
!defined('__NO_OUTPUT_BUFFER__')) {
ob_start('QApplicationBase::EndOutputBuffering');
- 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 Initialize is not named in camelCase. Open
public static function Initialize() {
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli')
- 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 IsBrowser is not named in camelCase. Open
public static function IsBrowser($intBrowserType) {
return ($intBrowserType & QApplication::$BrowserType);
}
- 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 DeleteCookie is not named in camelCase. Open
public static function DeleteCookie($strName) {
if (isset($_COOKIE[$strName])) { // don't post a cookie if its not set
$dttTimeout = QDateTime::Now();
$dttTimeout->AddYears(-5);
- 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 RenderCommandArray is not named in camelCase. Open
private static function RenderCommandArray(array $commandArray) {
$strScript = '';
foreach ($commandArray as $command) {
if (isset($command['script'])) { // a script to use eval on
$strScript .= sprintf('%s;', $command['script']) . _nl();
- 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 SessionOverride is not named in camelCase. Open
public static function SessionOverride() {
// Are we using QDbBackedSessionHandler?
if (defined("DB_BACKED_SESSION_HANDLER_DB_INDEX") &&
constant("DB_BACKED_SESSION_HANDLER_DB_INDEX") != 0 && defined("DB_BACKED_SESSION_HANDLER_TABLE_NAME")) {
// Yes we are going to override PHP's default file based handlers.
- 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 CloseWindow is not named in camelCase. Open
public static function CloseWindow($blnAbortCurrentScript = false) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Close] = 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 AddStyleSheets is not named in camelCase. Open
public static function AddStyleSheets (array $strStyleSheetArray) {
if (empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets] = $strStyleSheetArray;
}
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 EndOutputBuffering is not named in camelCase. Open
public static function EndOutputBuffering($strBuffer) {
return QApplication::OutputPage($strBuffer);
}
- 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 Redirect is not named in camelCase. Open
public static function Redirect($strLocation, $blnAbortCurrentScript = true) {
if (!$blnAbortCurrentScript) {
// Use the javascript command mechanism
QApplication::$JavascriptCommandArray[QAjaxResponse::Location] = $strLocation;
- 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 QueryString is not named in camelCase. Open
public static function QueryString($strItem) {
if (array_key_exists($strItem, $_GET))
return $_GET[$strItem];
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 GetCssFileUri is not named in camelCase. Open
public static function GetCssFileUri($strFile) {
if ((strpos($strFile, "http") === 0) || (strpos($strFile, "https") === 0))
return $strFile;
if (strpos($strFile, "/") === 0)
return __VIRTUAL_DIRECTORY__ . $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 GenerateQueryStringHelper is not named in camelCase. Open
protected static function GenerateQueryStringHelper($strKey, $mixValue) {
if (is_array($mixValue)) {
$strToReturn = null;
foreach ($mixValue as $strSubKey => $mixSubValue) {
$strToReturn .= QApplication::GenerateQueryStringHelper($strKey . '[' . $strSubKey . ']', $mixSubValue);
- 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 ExecuteJavaScript is not named in camelCase. Open
public static function ExecuteJavaScript($strJavaScript, $strPriority = QJsPriority::Standard) {
if (is_bool($strPriority)) {
//we keep this codepath for backward compatibility
if ($strPriority === true) {
throw new QCallerException('Please specify a correct priority value');
- 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 ExecuteJsFunction is not named in camelCase. Open
public static function ExecuteJsFunction($strFunctionName /*, ... */) {
$args = func_get_args();
array_shift ($args);
if ($args && end($args) === QJsPriority::High) {
$code = QAjaxResponse::CommandsHigh;
- 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 RenderJavascript is not named in camelCase. Open
public static function RenderJavascript($blnBeforeControls = false) {
$strScript = '';
// Style sheet injection by a control. Not very common, as other ways of adding style sheets would normally be done first.
if (!empty(QApplication::$JavascriptCommandArray[QAjaxResponse::StyleSheets])) {
- 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 MakeDirectory is not named in camelCase. Open
public static function MakeDirectory($strPath, $intMode = null) {
return QFolder::MakeDirectory($strPath, $intMode);
}
- 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 ExecuteSelectorFunction is not named in camelCase. Open
public static function ExecuteSelectorFunction ($mixSelector, $strFunctionName /*, ..., QJsPriority */) {
if (!(is_string($mixSelector) || (is_array($mixSelector) && count($mixSelector) == 2))) {
throw new QCallerException ('Selector must be a string or an array of two items');
}
$args = func_get_args();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method SetCookie is not named in camelCase. Open
public static function SetCookie($strName, $strValue, QDateTime $dttTimeout, $strPath = '/', $strDomain = null, $blnSecure = false) {
if (QApplication::$RequestMode == QRequestMode::Ajax) {
self::ExecuteJsFunction ('qcubed.setCookie', $strName, $strValue, $dttTimeout, $strPath, $strDomain, $blnSecure);
}
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 CheckRemoteAdmin is not named in camelCase. Open
public static function CheckRemoteAdmin() {
if (!QApplication::IsRemoteAdminSession()) {
return;
}
- 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 IsRemoteAdminSession is not named in camelCase. Open
public static function IsRemoteAdminSession() {
// Allow Remote?
if (ALLOW_REMOTE_ADMIN === true)
return false;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method IsIPInRange is not named in camelCase. Open
public static function IsIPInRange($ip, $range) {
$ip = trim($ip);
if (strpos($range, '/') !== false) {
// we are given a IP/mask
list($net, $mask) = explode('/', $range);
- 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 OutputPage is not named in camelCase. Open
public static function OutputPage($strBuffer) {
// If the ProcessOutput flag is set to false, simply return the buffer
// without processing anything.
if (!QApplication::$ProcessOutput)
return $strBuffer;
- 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 RenderFiles is not named in camelCase. Open
public static function RenderFiles() {
$strScript = '';
// Javascript files should get processed before the commands.
if (!empty(QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts])) {
- 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 GenerateQueryString is not named in camelCase. Open
public static function GenerateQueryString($arr = null) {
if(null === $arr)
$arr = $_GET;
if (count($arr)) {
$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 PathInfo is not named in camelCase. Open
public static function PathInfo($intIndex) {
// TODO: Cache PathInfo
$strPathInfo = urldecode(QApplication::$PathInfo);
// Remove Starting '/'
- 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 AddJavaScriptFiles is not named in camelCase. Open
public static function AddJavaScriptFiles ($strJavaScriptFileArray) {
if (empty(QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts])) {
QApplication::$JavascriptFileArray[QAjaxResponse::JavaScripts] = $strJavaScriptFileArray;
}
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 Autoload is not named in camelCase. Open
public static function Autoload($strClassName) {
if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
require_once (QApplication::$ClassFile[strtolower($strClassName)]);
return true;
} else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
- 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 GetJavascriptCommandArray is not named in camelCase. Open
public static function GetJavascriptCommandArray() {
if (QApplication::$JavascriptExclusiveCommand) {
// only render this one;
$a[QAjaxResponse::CommandsMedium] = [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 VarDump is not named in camelCase. Open
public static function VarDump() {
_p('<div class="var-dump"><strong>QCubed Settings</strong><ul>', false);
$arrValidationErrors = QInstallationValidator::Validate();
foreach ($arrValidationErrors as $objResult) {
printf('<li><strong class="warning">WARNING:</strong> %s</li>', $objResult->strMessage);
- 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 SetErrorHandler is not named in camelCase. Open
public static function SetErrorHandler($strName, $intLevel = null) {
if (!is_null(QApplicationBase::$intStoredErrorLevel))
throw new QCallerException('Error handler is already currently overridden. Cannot override twice. Call RestoreErrorHandler before calling SetErrorHandler again.');
if (!$strName) {
// No Error Handling is wanted -- simulate a "On Error, Resume" type of functionality
- 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 DisplayAlert is not named in camelCase. Open
public static function DisplayAlert($strMessage) {
QApplication::$JavascriptCommandArray[QAjaxResponse::Alert][] = $strMessage;
}
- 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 SendAjaxResponse is not named in camelCase. Open
public static function SendAjaxResponse(array $strResponseArray) {
header('Content-Type: text/json'); // not application/json, as IE reportedly blows up on that, but jQuery knows what to do.
$strJSON = JavascriptHelper::toJSON($strResponseArray);
if (QApplication::$EncodingType && QApplication::$EncodingType != 'UTF-8') {
$strJSON = iconv(QApplication::$EncodingType, 'UTF-8', $strJSON); // json must be UTF-8 encoded
- 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 RestoreErrorHandler is not named in camelCase. Open
public static function RestoreErrorHandler() {
if (is_null(QApplicationBase::$intStoredErrorLevel))
throw new QCallerException('Error handler is not currently overridden. Cannot reset something that was never overridden.');
if (QApplicationBase::$intStoredErrorLevel != -1)
error_reporting(QApplicationBase::$intStoredErrorLevel);
- 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 Translate is not named in camelCase. Open
public static function Translate($strToken) {
if (QApplication::$LanguageObject)
return QApplication::$LanguageObject->TranslateToken($strToken);
else
return $strToken;
- 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 HtmlEntities is not named in camelCase. Open
public static function HtmlEntities($strText) {
return htmlentities($strText, ENT_COMPAT | ENT_HTML5, QApplication::$EncodingType);
}
- 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() {
}
}