File QCodeGenBase.class.php
has 707 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
$strErrorString = str_replace("SimpleXMLElement::__construct() [<a href='function.SimpleXMLElement---construct'>function.SimpleXMLElement---construct</a>]: ", '', $__exc_errstr);
QCodeGen::$RootErrors .= sprintf("%s\r\n", $strErrorString);
QCodeGenBase
has 47 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class QCodeGenBase extends QBaseClass {
// Class Name Suffix/Prefix
/** @var string Class Prefix, as specified in the codegen_settings.xml file */
protected $strClassPrefix;
/** @var string Class suffix, as specified in the codegen_settings.xml file */
The class QCodeGenBase has 42 non-getter- and setter-methods. Consider refactoring QCodeGenBase to keep number of methods under 25. Open
abstract class QCodeGenBase extends QBaseClass {
// Class Name Suffix/Prefix
/** @var string Class Prefix, as specified in the codegen_settings.xml file */
protected $strClassPrefix;
/** @var string Class suffix, as specified in the codegen_settings.xml file */
- 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 QCodeGenBase has 19 public methods. Consider refactoring QCodeGenBase to keep number of public methods under 10. Open
abstract class QCodeGenBase extends QBaseClass {
// Class Name Suffix/Prefix
/** @var string Class Prefix, as specified in the codegen_settings.xml file */
protected $strClassPrefix;
/** @var string Class suffix, as specified in the codegen_settings.xml file */
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class QCodeGenBase has an overall complexity of 220 which is very high. The configured complexity threshold is 50. Open
abstract class QCodeGenBase extends QBaseClass {
// Class Name Suffix/Prefix
/** @var string Class Prefix, as specified in the codegen_settings.xml file */
protected $strClassPrefix;
/** @var string Class suffix, as specified in the codegen_settings.xml file */
- Exclude checks
Function GenerateFile
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function GenerateFile($strModuleSubPath, $strTemplateFilePath, $mixArgumentArray, $blnSave = true) {
// Setup Debug/Exception Message
if (QCodeGen::DebugMode) _p("Evaluating $strTemplateFilePath<br/>", false);
// Check to see if the template file exists, and if it does, Load It
- 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 ModelConnectorControlClass
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function ModelConnectorControlClass($objColumn) {
// Is the class specified by the developer?
if ($o = $objColumn->Options) {
if (isset ($o['FormGen']) && $o['FormGen'] == QFormGen::LabelOnly) {
- 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 buildTemplateArray
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function buildTemplateArray ($strTemplateFilePath, &$strTemplateArray) {
if (!$strTemplateFilePath) return;
if (substr( $strTemplateFilePath, -1 ) != '/') {
$strTemplateFilePath .= '/';
}
- 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 CalculateObjectDescription
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function CalculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, $blnPluralize) {
// Strip Prefixes (if applicable)
$strTableName = $this->StripPrefixFromTable($strTableName);
$strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
- 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 CalculateObjectDescriptionForAssociation
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function CalculateObjectDescriptionForAssociation($strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize) {
// Strip Prefixes (if applicable)
$strTableName = $this->StripPrefixFromTable($strTableName);
$strAssociationTableName = $this->StripPrefixFromTable($strAssociationTableName);
$strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
Method Run
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function Run($strSettingsXmlFilePath) {
define ('__CODE_GENERATING__', true);
QCodeGen::$CodeGenArray = array();
QCodeGen::$SettingsFilePath = $strSettingsXmlFilePath;
Method GenerateFile
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function GenerateFile($strModuleSubPath, $strTemplateFilePath, $mixArgumentArray, $blnSave = true) {
// Setup Debug/Exception Message
if (QCodeGen::DebugMode) _p("Evaluating $strTemplateFilePath<br/>", false);
// Check to see if the template file exists, and if it does, Load It
Function GenerateFiles
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function GenerateFiles($strTemplatePrefix, $mixArgumentArray) {
// If you are editing core templates, and getting EOF errors only on the travis build, this may be your problem. Scan your files and remove short tags.
if (QCodeGen::DebugMode && ini_get ('short_open_tag')) _p("Warning: PHP directive short_open_tag is on. Using short tags will cause unexpected EOF on travis build.\n", false);
// Default the template paths
- 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 CalculateObjectDescriptionForAssociation
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function CalculateObjectDescriptionForAssociation($strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize) {
// Strip Prefixes (if applicable)
$strTableName = $this->StripPrefixFromTable($strTableName);
$strAssociationTableName = $this->StripPrefixFromTable($strAssociationTableName);
$strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
- 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 ModelConnectorControlClass
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function ModelConnectorControlClass($objColumn) {
// Is the class specified by the developer?
if ($o = $objColumn->Options) {
if (isset ($o['FormGen']) && $o['FormGen'] == QFormGen::LabelOnly) {
Method CalculateObjectDescription
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function CalculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, $blnPluralize) {
// Strip Prefixes (if applicable)
$strTableName = $this->StripPrefixFromTable($strTableName);
$strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
Function Run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function Run($strSettingsXmlFilePath) {
define ('__CODE_GENERATING__', true);
QCodeGen::$CodeGenArray = array();
QCodeGen::$SettingsFilePath = $strSettingsXmlFilePath;
- 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 TypeTokenFromTypeName
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function TypeTokenFromTypeName($strName) {
$strToReturn = '';
for($intIndex = 0; $intIndex < strlen($strName); $intIndex++)
if (((ord($strName[$intIndex]) >= ord('a')) &&
(ord($strName[$intIndex]) <= ord('z'))) ||
- 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 ModelConnectorPropertyName
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function ModelConnectorPropertyName ($objColumn) {
if ($objColumn instanceof QSqlColumn) {
if ($objColumn->Reference) {
return $objColumn->Reference->PropertyName;
} else {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method LookupSetting
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function LookupSetting($objNode, $strTagName, $strAttributeName = null, $strType = QType::String) {
if ($strTagName)
$objNode = $objNode->$strTagName;
if ($strAttributeName) {
Consider simplifying this complex logical expression. Open
if (((ord($strName[$intIndex]) >= ord('a')) &&
(ord($strName[$intIndex]) <= ord('z'))) ||
((ord($strName[$intIndex]) >= ord('A')) &&
(ord($strName[$intIndex]) <= ord('Z'))) ||
((ord($strName[$intIndex]) >= ord('0')) &&
Function LookupSetting
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static public function LookupSetting($objNode, $strTagName, $strAttributeName = null, $strType = QType::String) {
if ($strTagName)
$objNode = $objNode->$strTagName;
if ($strAttributeName) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if ((QString::FirstCharacter($strFilename) == '_') &&
(substr($strFilename, strlen($strFilename) - 8) == '.tpl.php')
) {
$strTemplateArray[$strModuleName][$strFilename] = $strTemplateFilePath . $strModuleName . '/' . $strFilename;
}
Method ImplodeObjectArray
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function ImplodeObjectArray($strGlue, $strPrefix, $strSuffix, $strProperty, $objArrayToImplode) {
Function Pluralize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function Pluralize($strName) {
// Special Rules go Here
switch (true) {
case (strtolower($strName) == 'play'):
return $strName . 's';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this method. Open
return $strToReturn;
Avoid too many return
statements within this method. Open
return $objColumn->ObjectDescriptionPlural;
Avoid too many return
statements within this method. Open
case 'QIntegerTextBox': return new QIntegerTextBox_CodeGenerator();
Avoid too many return
statements within this method. Open
return QType::DateTime;
Avoid too many return
statements within this method. Open
case 'QFloatTextBox': return new QFloatTextBox_CodeGenerator();
Avoid too many return
statements within this method. Open
return 'QTextBox';
Avoid too many return
statements within this method. Open
return 'QCheckBoxList'; // for multi-selection
Avoid too many return
statements within this method. Open
return QType::Float;
Avoid too many return
statements within this method. Open
return QType::String;
Avoid too many return
statements within this method. Open
case 'QTextBox': return new QTextBox_CodeGenerator();
Avoid too many return
statements within this method. Open
return $strToReturn;
Avoid too many return
statements within this method. Open
return QType::Integer;
Avoid too many return
statements within this method. Open
case 'QDateTimePicker': return new QDateTimePicker_CodeGenerator();
Avoid too many return
statements within this method. Open
return 'QDateTimePicker';
Avoid too many return
statements within this method. Open
return 'QListBox';
Avoid too many return
statements within this method. Open
return $strName . "es";
Avoid too many return
statements within this method. Open
return new $strControlCodeGeneratorClass($strOrigControlClass);
Avoid too many return
statements within this method. Open
return QType::DateTime;
Avoid too many return
statements within this method. Open
return 'QFloatTextBox';
Avoid too many return
statements within this method. Open
return $strName . "zes";
Avoid too many return
statements within this method. Open
return 'QListBox';
Avoid too many return
statements within this method. Open
return 'QCheckBoxList'; // for multi-selection
Avoid too many return
statements within this method. Open
return sprintf("%sAs%s",
$strToReturn,
QConvertNotation::CamelCaseFromUnderscore($strColumnName));
Avoid too many return
statements within this method. Open
return QType::String;
Avoid too many return
statements within this method. Open
return 'QCheckBox';
Avoid too many return
statements within this method. Open
return $strName . "es";
Avoid too many return
statements within this method. Open
return $strName . "s";
Avoid too many return
statements within this method. Open
case 'QCheckBoxList': return new QCheckBoxList_CodeGenerator();
Avoid too many return
statements within this method. Open
return 'QIntegerTextBox';
Function CalculateGraphPrefixArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function CalculateGraphPrefixArray($objForeignKeyArray) {
// Analyze Column Names to determine GraphPrefixArray
if ((strpos(strtolower($objForeignKeyArray[0]->ColumnNameArray[0]), 'parent') !== false) ||
(strpos(strtolower($objForeignKeyArray[1]->ColumnNameArray[0]), 'child') !== false)) {
$strGraphPrefixArray[0] = '';
- 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 GetControlCodeGenerator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function GetControlCodeGenerator($objColumn) {
$strControlClass = $this->ModelConnectorControlClass($objColumn);
if (method_exists($strControlClass, 'GetCodeGenerator')) {
return call_user_func($strControlClass.'::GetCodeGenerator');
- 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 QCodeGenBase has 1206 lines of code. Current threshold is 1000. Avoid really long classes. Open
abstract class QCodeGenBase extends QBaseClass {
// Class Name Suffix/Prefix
/** @var string Class Prefix, as specified in the codegen_settings.xml file */
protected $strClassPrefix;
/** @var string Class suffix, as specified in the codegen_settings.xml file */
- Exclude checks
The method ModelConnectorControlClass() has an NPath complexity of 308. The configured NPath complexity threshold is 200. Open
protected function ModelConnectorControlClass($objColumn) {
// Is the class specified by the developer?
if ($o = $objColumn->Options) {
if (isset ($o['FormGen']) && $o['FormGen'] == QFormGen::LabelOnly) {
- 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 GenerateFile() has an NPath complexity of 3840. The configured NPath complexity threshold is 200. Open
public function GenerateFile($strModuleSubPath, $strTemplateFilePath, $mixArgumentArray, $blnSave = true) {
// Setup Debug/Exception Message
if (QCodeGen::DebugMode) _p("Evaluating $strTemplateFilePath<br/>", false);
// Check to see if the template file exists, and if it does, Load It
- 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 CalculateObjectDescriptionForAssociation() has an NPath complexity of 486. The configured NPath complexity threshold is 200. Open
protected function CalculateObjectDescriptionForAssociation($strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize) {
// Strip Prefixes (if applicable)
$strTableName = $this->StripPrefixFromTable($strTableName);
$strAssociationTableName = $this->StripPrefixFromTable($strAssociationTableName);
$strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
- 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 GenerateFiles() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
public function GenerateFiles($strTemplatePrefix, $mixArgumentArray) {
// If you are editing core templates, and getting EOF errors only on the travis build, this may be your problem. Scan your files and remove short tags.
if (QCodeGen::DebugMode && ini_get ('short_open_tag')) _p("Warning: PHP directive short_open_tag is on. Using short tags will cause unexpected EOF on travis build.\n", false);
// Default the template paths
- 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 buildTemplateArray() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
protected function buildTemplateArray ($strTemplateFilePath, &$strTemplateArray) {
if (!$strTemplateFilePath) return;
if (substr( $strTemplateFilePath, -1 ) != '/') {
$strTemplateFilePath .= '/';
}
- 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 TypeTokenFromTypeName() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
protected function TypeTokenFromTypeName($strName) {
$strToReturn = '';
for($intIndex = 0; $intIndex < strlen($strName); $intIndex++)
if (((ord($strName[$intIndex]) >= ord('a')) &&
(ord($strName[$intIndex]) <= ord('z'))) ||
- 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 ModelConnectorControlClass() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10. Open
protected function ModelConnectorControlClass($objColumn) {
// Is the class specified by the developer?
if ($o = $objColumn->Options) {
if (isset ($o['FormGen']) && $o['FormGen'] == QFormGen::LabelOnly) {
- 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 GetControlCodeGenerator() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. Open
public function GetControlCodeGenerator($objColumn) {
$strControlClass = $this->ModelConnectorControlClass($objColumn);
if (method_exists($strControlClass, 'GetCodeGenerator')) {
return call_user_func($strControlClass.'::GetCodeGenerator');
- 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 GenerateFile() has a Cyclomatic Complexity of 18. The configured cyclomatic complexity threshold is 10. Open
public function GenerateFile($strModuleSubPath, $strTemplateFilePath, $mixArgumentArray, $blnSave = true) {
// Setup Debug/Exception Message
if (QCodeGen::DebugMode) _p("Evaluating $strTemplateFilePath<br/>", false);
// Check to see if the template file exists, and if it does, Load It
- 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 VariableTypeFromDbType() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
protected function VariableTypeFromDbType($strDbType) {
switch ($strDbType) {
case QDatabaseFieldType::Bit:
return QType::Boolean;
case QDatabaseFieldType::Blob:
- 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 CalculateObjectDescriptionForAssociation() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10. Open
protected function CalculateObjectDescriptionForAssociation($strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize) {
// Strip Prefixes (if applicable)
$strTableName = $this->StripPrefixFromTable($strTableName);
$strAssociationTableName = $this->StripPrefixFromTable($strAssociationTableName);
$strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
- 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 CalculateObjectDescription() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. Open
protected function CalculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, $blnPluralize) {
// Strip Prefixes (if applicable)
$strTableName = $this->StripPrefixFromTable($strTableName);
$strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
- 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 '$templateSettings' which will lead to PHP notices. Open
$strDirectorySuffix = QType::Cast($templateSettings['DirectorySuffix'], QType::String);
- 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
$strEscapeIdentifierEnd = QApplication::$Database[$this->intDatabaseIndex]->EscapeIdentifierEnd;
- 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
$strEscapeIdentifierBegin = QApplication::$Database[$this->intDatabaseIndex]->EscapeIdentifierBegin;
- 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 '$templateSettings' which will lead to PHP notices. Open
$blnDocrootFlag = QType::Cast($templateSettings['DocrootFlag'], QType::Boolean);
- 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 '$templateSettings' which will lead to PHP notices. Open
$strTemplate = $this->EvaluatePHP($strTemplateFilePath, $mixArgumentArray, $templateSettings);
- 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 '$templateSettings' which will lead to PHP notices. Open
$strTargetDirectory = QType::Cast($templateSettings['TargetDirectory'], QType::String);
- 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 '$templateSettings' which will lead to PHP notices. Open
$blnOverwriteFlag = QType::Cast($templateSettings['OverwriteFlag'], QType::Boolean);
- 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 '$templateSettings' which will lead to PHP notices. Open
$strTargetFileName = QType::Cast($templateSettings['TargetFileName'], QType::String);
- 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 '$strGraphPrefixArray' which will lead to PHP notices. Open
$strGraphPrefixArray[1] = 'Parent';
- 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 '$strGraphPrefixArray' which will lead to PHP notices. Open
$strGraphPrefixArray[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 '$strGraphPrefixArray' which will lead to PHP notices. Open
$strGraphPrefixArray[0] = 'Parent';
- 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 '$strGraphPrefixArray' which will lead to PHP notices. Open
return $strGraphPrefixArray;
- 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 '$strGraphPrefixArray' which will lead to PHP notices. Open
$strGraphPrefixArray[0] = 'Parent';
- 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 '$strGraphPrefixArray' which will lead to PHP notices. Open
$strGraphPrefixArray[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 '$strGraphPrefixArray' which will lead to PHP notices. Open
$strGraphPrefixArray[0] = '';
- 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 QCodeGenBase has a coupling between objects value of 26. Consider to reduce the number of dependencies under 13. Open
abstract class QCodeGenBase extends QBaseClass {
// Class Name Suffix/Prefix
/** @var string Class Prefix, as specified in the codegen_settings.xml file */
protected $strClassPrefix;
/** @var string Class suffix, as specified in the codegen_settings.xml file */
- 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
Remove error control operator '@' on line 403. Open
protected function getTemplateSettings($strTemplateFilePath, &$strTemplate = null) {
if ($strTemplate === null)
$strTemplate = file_get_contents($strTemplateFilePath);
$strError = 'Template\'s first line must be <template OverwriteFlag="boolean" DocrootFlag="boolean" TargetDirectory="string" DirectorySuffix="string" TargetFileName="string"/>: ' . $strTemplateFilePath;
// Parse out the first line (which contains path and overwriting information)
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '430', column '15'). Open
throw new QCallerException('Template File Not Found: ' . $strTemplateFilePath);
- 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 '856', column '14'). Open
throw new Exception('Unknown column type.');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '936', column '33'). Open
case 'QTextBox': return new QTextBox_CodeGenerator();
- 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 '937', column '40'). Open
case 'QIntegerTextBox': return new QIntegerTextBox_CodeGenerator();
- 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 '935', column '40'). Open
case 'QDateTimePicker': return new QDateTimePicker_CodeGenerator();
- 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 '218', column '40'). Open
QCodeGen::$CodeGenArray[] = new QDatabaseCodeGen($objChildNode);
- 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 ParameterCleanupFromColumn has a boolean flag argument $blnIncludeEquality, which is a certain sign of a Single Responsibility Principle violation. Open
protected function ParameterCleanupFromColumn(QSqlColumn $objColumn, $blnIncludeEquality = 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 '407', column '15'). Open
throw new Exception($strError);
- 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 '468', column '17'). Open
throw new Exception('Unable to mkdir ' . $strTargetDirectory);
- 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 '395', column '15'). Open
throw new Exception($strError);
- 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 '326', column '16'). Open
throw new Exception(sprintf("Template path: %s does not appear to be a valid directory.", $strPath));
- 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 '939', column '38'). Open
case 'QCheckBoxList': return new QCheckBoxList_CodeGenerator();
- 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 '191', column '34'). Open
QCodeGen::$SettingsXml = new SimpleXMLElement(file_get_contents($strSettingsXmlFilePath));
- 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 '442', column '15'). Open
throw new QCallerException ('Can\'t override include path. Make sure your apache or server settings allow include paths to be 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 '934', column '34'). Open
case 'QCheckBox': return new QCheckBox_CodeGenerator();
- 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 '948', column '16'). Open
throw new QCallerException("Cannot find an appropriate subclass of AbstractControl_CodeGenerator for ".$strOrigControlClass);
- 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 GenerateFile has a boolean flag argument $blnSave, which is a certain sign of a Single Responsibility Principle violation. Open
public function GenerateFile($strModuleSubPath, $strTemplateFilePath, $mixArgumentArray, $blnSave = 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 '455', column '15'). Open
throw new Exception('the template settings cannot be null');
- 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 '774', column '15'). Open
throw new Exception ('Unknown column type.');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '962', column '15'). Open
return new QDataGrid_CodeGenerator();
- 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 '221', column '40'). Open
QCodeGen::$CodeGenArray[] = new QRestServiceCodeGen($objChildNode);
- 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 '403', column '28'). Open
@$objTemplateXml = new SimpleXMLElement($strFirstLine);
- 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 '933', column '33'). Open
case 'QListBox': return new QListBox_CodeGenerator();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '938', column '38'). Open
case 'QFloatTextBox': return new QFloatTextBox_CodeGenerator();
- 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 '1169', column '16'). Open
throw new Exception("Invalid Db Type to Convert: $strDbType");
- 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 using static access to class 'QType' in method 'GenerateFile'. Open
$blnOverwriteFlag = QType::Cast($templateSettings['OverwriteFlag'], QType::Boolean);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QType' in method 'LookupSetting'. Open
$intToReturn = QType::Cast($objNode[$strAttributeName], QType::Integer);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QType' in method 'LookupSetting'. Open
$strToReturn = trim(QType::Cast($objNode[$strAttributeName], QType::String));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QType' in method 'LookupSetting'. Open
$strToReturn = trim(QType::Cast($objNode, QType::String));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method ModelConnectorPropertyName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
return ($objColumn->ObjectDescriptionPlural);
}
- 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 ModelConnectorControlClass uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return 'QCheckBoxList'; // for multi-selection
}
- 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 'QConvertNotation' in method 'CalculateObjectMemberVariable'. Open
QConvertNotation::PrefixFromType(QType::Object),
- 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 'QCodeGen' in method 'Run'. Open
QCodeGen::$DefaultButtonClass = QCodeGen::LookupSetting(QCodeGen::$SettingsXml, 'formgen', 'buttonClass');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QType' in method 'GenerateFile'. Open
$strDirectorySuffix = QType::Cast($templateSettings['DirectorySuffix'], QType::String);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QString' in method 'TypeTokenFromTypeName'. Open
if (is_numeric(QString::FirstCharacter($strToReturn)))
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method ModelConnectorPropertyName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
throw new Exception ('Unknown column type.');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'QLabel_CodeGenerator' in method 'GetControlCodeGenerator'. Open
case 'QLabel': return QLabel_CodeGenerator::Instance();
- 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 'QCodeGen' in method 'Run'. Open
QCodeGen::$ApplicationName = QCodeGen::LookupSetting(QCodeGen::$SettingsXml, 'name', 'application');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QType' in method 'LookupSetting'. Open
$blnToReturn = QType::Cast($objNode[$strAttributeName], QType::Boolean);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QDatabaseCodeGen' in method 'GenerateAggregate'. Open
array_merge($strToReturn, QDatabaseCodeGen::GenerateAggregateHelper($objDbOrmCodeGen));
- 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 'setGeneratedFilePermissions'. Open
QApplication::RestoreErrorHandler();
- 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 ModelReferenceColumnName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Otherwise, let's add "_object" so that we don't confuse this variable name
// from the variable that was mapped from the physical database
// E.g., if it's a numeric FK, and the column is defined as "person INT",
// there will end up being two variables, one for the Person id integer, and
- 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 '813', column '8'). Open
protected function ModelConnectorControlClass($objColumn) {
// Is the class specified by the developer?
if ($o = $objColumn->Options) {
if (isset ($o['FormGen']) && $o['FormGen'] == QFormGen::LabelOnly) {
- 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 'setGeneratedFilePermissions'. Open
QApplication::SetErrorHandler(null);
- 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 'QConvertNotation' in method 'ModelColumnVariableName'. Open
QConvertNotation::CamelCaseFromUnderscore($objColumn->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
Avoid using static access to class 'QConvertNotation' in method 'ModelReferenceVariableName'. Open
return QConvertNotation::PrefixFromType(QType::Object) .
- 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 LookupSetting uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$strToReturn = trim(QType::Cast($objNode, QType::String));
return $strToReturn;
}
- 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 ModelConnectorPropertyName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return $objColumn->PropertyName;
}
- 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 'QCodeGen' in method 'Run'. Open
QCodeGen::$CreateMethod = QCodeGen::LookupSetting(QCodeGen::$SettingsXml, 'formgen', 'createMethod');
- 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 'QConvertNotation' in method 'ModelReferencePropertyName'. Open
return QConvertNotation::CamelCaseFromUnderscore($strColumnName);
- 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 'QString' in method 'buildTemplateArray'. Open
if ((QString::FirstCharacter($strFilename) == '_') &&
- 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 'QConvertNotation' in method 'TypeColumnPropertyName'. Open
return QConvertNotation::CamelCaseFromUnderscore($strColumnName);
- 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 'Run'. Open
QApplication::RestoreErrorHandler();
- 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 'QConvertNotation' in method 'ModelVariableName'. Open
return QConvertNotation::PrefixFromType(QType::Object) .
- 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 'QConvertNotation' in method 'DataListControlName'. Open
return QConvertNotation::WordsFromCamelCase($objTable->ClassNamePlural);
- 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 'Run'. Open
QApplication::SetErrorHandler('QcubedHandleCodeGenParseError', E_ALL);
- 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 'GenerateFile'. Open
if (!QApplication::MakeDirectory($strTargetDirectory, 0777))
- 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 'QConvertNotation' in method 'ModelClassName'. Open
QConvertNotation::CamelCaseFromUnderscore($strTableName),
- 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 'QCodeGen' in method 'ModelConnectorControlName'. Open
return QConvertNotation::WordsFromCamelCase(QCodeGen::ModelConnectorPropertyName($objColumn));
- 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 'QConvertNotation' in method 'DataListItemName'. Open
return QConvertNotation::WordsFromCamelCase($objTable->ClassName);
- 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 'QCodeGen' in method 'Run'. Open
QCodeGen::$PreferredRenderMethod = QCodeGen::LookupSetting(QCodeGen::$SettingsXml, 'formgen', 'preferredRenderMethod');
- 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 '880', column '9'). Open
public static function DataListControlName (QSqlTable $objTable) {
if (($o = $objTable->Options) && isset ($o['Name'])) { // Did developer default?
return $o['Name'];
}
return QConvertNotation::WordsFromCamelCase($objTable->ClassNamePlural);
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'QType' in method 'GenerateFile'. Open
$strTargetDirectory = QType::Cast($templateSettings['TargetDirectory'], QType::String);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QType' in method 'GenerateFile'. Open
$strTargetFileName = QType::Cast($templateSettings['TargetFileName'], QType::String);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QConvertNotation' in method 'ModelColumnVariableName'. Open
return QConvertNotation::PrefixFromType($objColumn->VariableType) .
- 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 'QConvertNotation' in method 'ModelReferenceVariableName'. Open
QConvertNotation::CamelCaseFromUnderscore($strColumnName);
- 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 '740', column '9'). Open
public static function ModelConnectorControlName ($objColumn) {
if (($o = $objColumn->Options) && isset ($o['Name'])) { // Did developer default?
return $o['Name'];
}
return QConvertNotation::WordsFromCamelCase(QCodeGen::ModelConnectorPropertyName($objColumn));
- 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 'QConvertNotation' in method 'ModelColumnPropertyName'. Open
return QConvertNotation::CamelCaseFromUnderscore($strColumnName);
- 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 '862', column '8'). Open
public function DataListControlClass (QSqlTable $objTable) {
// Is the class specified by the developer?
if ($o = $objTable->Options) {
if (isset($o['ControlClass'])) {
return $o['ControlClass'];
- 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 'QConvertNotation' in method 'ModelConnectorControlName'. Open
return QConvertNotation::WordsFromCamelCase(QCodeGen::ModelConnectorPropertyName($objColumn));
- 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 '894', column '9'). Open
public static function DataListItemName (QSqlTable $objTable) {
if (($o = $objTable->Options) && isset ($o['ItemName'])) { // Did developer override?
return $o['ItemName'];
}
return QConvertNotation::WordsFromCamelCase($objTable->ClassName);
- 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 'QConvertNotation' in method 'ModelVariableName'. Open
QConvertNotation::CamelCaseFromUnderscore($strTableName);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QType' in method 'GenerateFile'. Open
$blnDocrootFlag = QType::Cast($templateSettings['DocrootFlag'], QType::Boolean);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QConvertNotation' in method 'CalculateObjectDescription'. Open
$strColumnName = QConvertNotation::CamelCaseFromUnderscore($strColumnName);
- 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 'QConvertNotation' in method 'CalculateObjectDescription'. Open
QConvertNotation::CamelCaseFromUnderscore($strColumnName));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QType' in method '__set'. Open
return ($this->strErrors = QType::Cast($mixValue, QType::String));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method CalculateGraphPrefixArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Use Default Prefixing for Graphs
$strGraphPrefixArray[0] = 'Parent';
$strGraphPrefixArray[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 'QType' in method '__set'. Open
return ($this->strWarnings = QType::Cast($mixValue, QType::String));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'QConvertNotation' in method 'CalculateObjectDescriptionForAssociation'. Open
$strToReturn = QConvertNotation::CamelCaseFromUnderscore($strReferencedTableName);
- 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 'QConvertNotation' in method 'CalculateObjectDescription'. Open
$strToReturn = QConvertNotation::CamelCaseFromUnderscore($strTableName);
- 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 'QConvertNotation' in method 'CalculateObjectDescriptionForAssociation'. Open
QConvertNotation::CamelCaseFromUnderscore($strAssociationTableName),
- 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 CalculateObjectDescription uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// If Column Name is only the name of the referenced table, or the name of the referenced table with "_id",
// then the object description is simply based off the table name.
if (($strColumnName == $strReferencedTableName) ||
($strColumnName == $strReferencedTableName . '_id'))
- 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 unused parameters such as '$__exc_errline'. Open
function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$__exc_errfile'. Open
function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$__exc_errno'. Open
function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused local variables such as '$strEscapeIdentifierEnd'. Open
$strEscapeIdentifierEnd = QApplication::$Database[$this->intDatabaseIndex]->EscapeIdentifierEnd;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid using empty try-catch blocks in getTemplateSettings. Open
} catch (Exception $objExc) {}
- Read upRead up
- Exclude checks
EmptyCatchBlock
Since: 2.7.0
Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.
Example
class Foo {
public function bar()
{
try {
// ...
} catch (Exception $e) {} // empty catch block
}
}
Source https://phpmd.org/rules/design.html#emptycatchblock
Avoid unused local variables such as '$strEscapeIdentifierBegin'. Open
$strEscapeIdentifierBegin = QApplication::$Database[$this->intDatabaseIndex]->EscapeIdentifierBegin;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$strFilename'. Open
foreach ($strFileArray as $strFilename => $strPath) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$objCodeGen'. Open
$objCodeGen = $this;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
TODO found Open
// TODO: These functions need to be documented heavily with information from "lexical analysis on fk names.txt"
- Exclude checks
Avoid excessively long variable names like $DirectoriesToExcludeArray. Keep variable name length under 20. Open
protected static $DirectoriesToExcludeArray = array('.','..','.svn','svn','cvs','.git');
- 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 $PreferredRenderMethod. Keep variable name length under 20. Open
public static $PreferredRenderMethod;
- 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 $strEscapeIdentifierBegin. Keep variable name length under 20. Open
$strEscapeIdentifierBegin = QApplication::$Database[$this->intDatabaseIndex]->EscapeIdentifierBegin;
- 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 $strEscapeIdentifierEnd. Keep variable name length under 20. Open
$strEscapeIdentifierEnd = QApplication::$Database[$this->intDatabaseIndex]->EscapeIdentifierEnd;
- 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 $strReferencedTableName. Keep variable name length under 20. Open
protected function CalculateObjectPropertyName($strTableName, $strColumnName, $strReferencedTableName) {
- 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 $strControlCodeGeneratorClass. Keep variable name length under 20. Open
$strControlCodeGeneratorClass = $strControlClass .'_CodeGenerator';
- 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 $strSettingsXmlFilePath. Keep variable name length under 20. Open
public static function Run($strSettingsXmlFilePath) {
- 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 $objRestServiceCodeGen. Keep variable name length under 20. Open
$objRestServiceCodeGen = 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 $strReferencedTableName. Keep variable name length under 20. Open
protected function CalculateObjectMemberVariable($strTableName, $strColumnName, $strReferencedTableName) {
- 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 $strReferencedTableName. Keep variable name length under 20. Open
protected function CalculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, $blnPluralize) {
- 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 $strAssociationTableName. Keep variable name length under 20. Open
protected function CalculateObjectDescriptionForAssociation($strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize) {
- 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 $strReferencedTableName. Keep variable name length under 20. Open
protected function CalculateObjectDescriptionForAssociation($strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize) {
- 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 $strReferencedTableName2. Keep variable name length under 20. Open
$strReferencedTableName2 = str_replace('_', '', $strReferencedTableName); // remove underscores if they are there
- 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
The parameter $__exc_errline is not named in camelCase. Open
function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
$strErrorString = str_replace("SimpleXMLElement::__construct() [<a href='function.SimpleXMLElement---construct'>function.SimpleXMLElement---construct</a>]: ", '', $__exc_errstr);
QCodeGen::$RootErrors .= sprintf("%s\r\n", $strErrorString);
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $__exc_errno is not named in camelCase. Open
function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
$strErrorString = str_replace("SimpleXMLElement::__construct() [<a href='function.SimpleXMLElement---construct'>function.SimpleXMLElement---construct</a>]: ", '', $__exc_errstr);
QCodeGen::$RootErrors .= sprintf("%s\r\n", $strErrorString);
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $__exc_errfile is not named in camelCase. Open
function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
$strErrorString = str_replace("SimpleXMLElement::__construct() [<a href='function.SimpleXMLElement---construct'>function.SimpleXMLElement---construct</a>]: ", '', $__exc_errstr);
QCodeGen::$RootErrors .= sprintf("%s\r\n", $strErrorString);
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $__exc_errstr is not named in camelCase. Open
function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
$strErrorString = str_replace("SimpleXMLElement::__construct() [<a href='function.SimpleXMLElement---construct'>function.SimpleXMLElement---construct</a>]: ", '', $__exc_errstr);
QCodeGen::$RootErrors .= sprintf("%s\r\n", $strErrorString);
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Avoid variables with short names like $o. Configured minimum length is 3. Open
if ($o = $objTable->Options) {
- 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 $o. Configured minimum length is 3. Open
if (($o = $objTable->Options) && isset ($o['Name'])) { // Did developer default?
- 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 $o. Configured minimum length is 3. Open
if (($o = $objTable->Options) && isset ($o['ItemName'])) { // Did developer override?
- 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 $o. Configured minimum length is 3. Open
if ($o = $objColumn->Options) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $a. Configured minimum length is 3. Open
$a = array();
- 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 $o. Configured minimum length is 3. Open
if (($o = $objColumn->Options) && isset ($o['Name'])) { // Did developer default?
- 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 DebugMode should be defined in uppercase Open
const DebugMode = false;
- 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 PhpReservedWords should be defined in uppercase Open
const PhpReservedWords = 'new, null, break, return, switch, self, case, const, clone, continue, declare, default, echo, else, elseif, empty, exit, eval, if, try, throw, catch, public, private, protected, function, extends, foreach, for, while, do, var, class, static, abstract, isset, unset, implements, interface, instanceof, include, include_once, require, require_once, abstract, and, or, xor, array, list, false, true, global, parent, print, exception, namespace, goto, final, endif, endswitch, enddeclare, endwhile, use, as, endfor, endforeach, this';
- 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 $content_so_far is not named in camelCase. Open
function GO_BACK($intNumChars) {
$content_so_far = ob_get_contents();
ob_end_clean();
$content_so_far = substr($content_so_far, 0, strlen($content_so_far) - $intNumChars);
ob_start();
- 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 $content_so_far is not named in camelCase. Open
function GO_BACK($intNumChars) {
$content_so_far = ob_get_contents();
ob_end_clean();
$content_so_far = substr($content_so_far, 0, strlen($content_so_far) - $intNumChars);
ob_start();
- 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 $content_so_far is not named in camelCase. Open
function GO_BACK($intNumChars) {
$content_so_far = ob_get_contents();
ob_end_clean();
$content_so_far = substr($content_so_far, 0, strlen($content_so_far) - $intNumChars);
ob_start();
- 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 $content_so_far is not named in camelCase. Open
function GO_BACK($intNumChars) {
$content_so_far = ob_get_contents();
ob_end_clean();
$content_so_far = substr($content_so_far, 0, strlen($content_so_far) - $intNumChars);
ob_start();
- 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 $__exc_errstr is not named in camelCase. Open
function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
$strErrorString = str_replace("SimpleXMLElement::__construct() [<a href='function.SimpleXMLElement---construct'>function.SimpleXMLElement---construct</a>]: ", '', $__exc_errstr);
QCodeGen::$RootErrors .= sprintf("%s\r\n", $strErrorString);
}
- 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 $content_so_far is not named in camelCase. Open
function GO_BACK($intNumChars) {
$content_so_far = ob_get_contents();
ob_end_clean();
$content_so_far = substr($content_so_far, 0, strlen($content_so_far) - $intNumChars);
ob_start();
- 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 $_TEMPLATE_SETTINGS is not named in camelCase. Open
protected function EvaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null) {
// Get all the arguments and set them locally
if ($mixArgumentArray) foreach ($mixArgumentArray as $strName=>$mixValue) {
$$strName = $mixValue;
}
- 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 $_TEMPLATE_SETTINGS is not named in camelCase. Open
protected function EvaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null) {
// Get all the arguments and set them locally
if ($mixArgumentArray) foreach ($mixArgumentArray as $strName=>$mixValue) {
$$strName = $mixValue;
}
- 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 $_TEMPLATE_SETTINGS is not named in camelCase. Open
protected function EvaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null) {
// Get all the arguments and set them locally
if ($mixArgumentArray) foreach ($mixArgumentArray as $strName=>$mixValue) {
$$strName = $mixValue;
}
- 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 $CodeGenArray is not named in camelCase. Open
public static function Run($strSettingsXmlFilePath) {
define ('__CODE_GENERATING__', true);
QCodeGen::$CodeGenArray = array();
QCodeGen::$SettingsFilePath = $strSettingsXmlFilePath;
- 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
protected function EvaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null) {
// Get all the arguments and set them locally
if ($mixArgumentArray) foreach ($mixArgumentArray as $strName=>$mixValue) {
$$strName = $mixValue;
}
- 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
protected function EvaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null) {
// Get all the arguments and set them locally
if ($mixArgumentArray) foreach ($mixArgumentArray as $strName=>$mixValue) {
$$strName = $mixValue;
}
- 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 $_TEMPLATE_SETTINGS is not named in camelCase. Open
protected function EvaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null) {
// Get all the arguments and set them locally
if ($mixArgumentArray) foreach ($mixArgumentArray as $strName=>$mixValue) {
$$strName = $mixValue;
}
- 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 $_TEMPLATE_SETTINGS is not named in camelCase. Open
protected function EvaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null) {
// Get all the arguments and set them locally
if ($mixArgumentArray) foreach ($mixArgumentArray as $strName=>$mixValue) {
$$strName = $mixValue;
}
- 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 $CodeGenArray is not named in camelCase. Open
public static function Run($strSettingsXmlFilePath) {
define ('__CODE_GENERATING__', true);
QCodeGen::$CodeGenArray = array();
QCodeGen::$SettingsFilePath = $strSettingsXmlFilePath;
- 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 GetSettingsXml is not named in camelCase. Open
public static function GetSettingsXml() {
$strCrLf = "\r\n";
$strToReturn = sprintf('<codegen>%s', $strCrLf);
$strToReturn .= sprintf(' <name application="%s"/>%s', QCodeGen::$ApplicationName, $strCrLf);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Run is not named in camelCase. Open
public static function Run($strSettingsXmlFilePath) {
define ('__CODE_GENERATING__', true);
QCodeGen::$CodeGenArray = array();
QCodeGen::$SettingsFilePath = $strSettingsXmlFilePath;
- 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 ModelColumnVariableName is not named in camelCase. Open
protected function ModelColumnVariableName(QSqlColumn $objColumn) {
return QConvertNotation::PrefixFromType($objColumn->VariableType) .
QConvertNotation::CamelCaseFromUnderscore($objColumn->Name);
}
- 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 TypeColumnPropertyName is not named in camelCase. Open
protected function TypeColumnPropertyName($strColumnName) {
return QConvertNotation::CamelCaseFromUnderscore($strColumnName);
}
- 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 ModelConnectorPropertyName is not named in camelCase. Open
public static function ModelConnectorPropertyName ($objColumn) {
if ($objColumn instanceof QSqlColumn) {
if ($objColumn->Reference) {
return $objColumn->Reference->PropertyName;
} 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 ModelConnectorControlClass is not named in camelCase. Open
protected function ModelConnectorControlClass($objColumn) {
// Is the class specified by the developer?
if ($o = $objColumn->Options) {
if (isset ($o['FormGen']) && $o['FormGen'] == QFormGen::LabelOnly) {
- 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 GetDataListCodeGenerator is not named in camelCase. Open
public function GetDataListCodeGenerator($objTable) {
$strControlClass = $this->DataListControlClass($objTable);
if (method_exists($strControlClass, 'GetCodeGenerator')) {
return call_user_func($strControlClass.'::GetCodeGenerator');
- 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 ImplodeObjectArray is not named in camelCase. Open
protected function ImplodeObjectArray($strGlue, $strPrefix, $strSuffix, $strProperty, $objArrayToImplode) {
$strArrayToReturn = array();
if ($objArrayToImplode) foreach ($objArrayToImplode as $objObject) {
array_push($strArrayToReturn, sprintf('%s%s%s', $strPrefix, $objObject->__get($strProperty), $strSuffix));
}
- 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 TypeTokenFromTypeName is not named in camelCase. Open
protected function TypeTokenFromTypeName($strName) {
$strToReturn = '';
for($intIndex = 0; $intIndex < strlen($strName); $intIndex++)
if (((ord($strName[$intIndex]) >= ord('a')) &&
(ord($strName[$intIndex]) <= ord('z'))) ||
- 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 ModelConnectorVariableName is not named in camelCase. Open
public function ModelConnectorVariableName($objColumn) {
$strPropName = static::ModelConnectorPropertyName($objColumn);
$objControlHelper = $this->GetControlCodeGenerator($objColumn);
return $objControlHelper->VarName ($strPropName);
}
- 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 CalculateObjectPropertyName is not named in camelCase. Open
protected function CalculateObjectPropertyName($strTableName, $strColumnName, $strReferencedTableName) {
return sprintf('%s%s%s',
$this->strAssociatedObjectPrefix,
$this->CalculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, false),
$this->strAssociatedObjectSuffix);
- 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 ModelReferenceColumnName is not named in camelCase. Open
protected function ModelReferenceColumnName($strColumnName) {
$intNameLength = strlen($strColumnName);
// Does the column name for this reference column end in "_id"?
if (($intNameLength > 3) && (strtolower(substr($strColumnName, $intNameLength - 3)) == "_id")) {
- 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 LookupSetting is not named in camelCase. Open
static public function LookupSetting($objNode, $strTagName, $strAttributeName = null, $strType = QType::String) {
if ($strTagName)
$objNode = $objNode->$strTagName;
if ($strAttributeName) {
- 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 ModelReverseReferenceVariableType is not named in camelCase. Open
protected function ModelReverseReferenceVariableType($strTableName) {
$strTableName = $this->StripPrefixFromTable($strTableName);
return $this->ModelClassName($strTableName);
}
- 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 DataListVarName is not named in camelCase. Open
public function DataListVarName (QSqlTable $objTable) {
$strPropName = self::DataListPropertyNamePlural($objTable);
$objControlHelper = $this->GetDataListCodeGenerator($objTable);
return $objControlHelper->VarName($strPropName);
}
- 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 CalculateObjectMemberVariable is not named in camelCase. Open
protected function CalculateObjectMemberVariable($strTableName, $strColumnName, $strReferencedTableName) {
return sprintf('%s%s%s%s',
QConvertNotation::PrefixFromType(QType::Object),
$this->strAssociatedObjectPrefix,
$this->CalculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, 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 EvaluatePHP is not named in camelCase. Open
protected function EvaluatePHP($strFilename, $mixArgumentArray, &$templateSettings = null) {
// Get all the arguments and set them locally
if ($mixArgumentArray) foreach ($mixArgumentArray as $strName=>$mixValue) {
$$strName = $mixValue;
}
- 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 ModelReferencePropertyName is not named in camelCase. Open
protected function ModelReferencePropertyName($strColumnName) {
$strColumnName = $this->ModelReferenceColumnName($strColumnName);
return QConvertNotation::CamelCaseFromUnderscore($strColumnName);
}
- 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 ModelReverseReferenceVariableName is not named in camelCase. Open
protected function ModelReverseReferenceVariableName($strTableName) {
$strTableName = $this->StripPrefixFromTable($strTableName);
return $this->ModelVariableName($strTableName);
}
- 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 ParameterCleanupFromColumn is not named in camelCase. Open
protected function ParameterCleanupFromColumn(QSqlColumn $objColumn, $blnIncludeEquality = false) {
if ($blnIncludeEquality)
return sprintf('$%s = $objDatabase->SqlVariable($%s, true);',
$objColumn->VariableName, $objColumn->VariableName);
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 ModelClassName is not named in camelCase. Open
protected function ModelClassName($strTableName) {
$strTableName = $this->StripPrefixFromTable($strTableName);
return sprintf('%s%s%s',
$this->strClassPrefix,
QConvertNotation::CamelCaseFromUnderscore($strTableName),
- 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 ModelConnectorControlName is not named in camelCase. Open
public static function ModelConnectorControlName ($objColumn) {
if (($o = $objColumn->Options) && isset ($o['Name'])) { // Did developer default?
return $o['Name'];
}
return QConvertNotation::WordsFromCamelCase(QCodeGen::ModelConnectorPropertyName($objColumn));
- 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 DataListPropertyNamePlural is not named in camelCase. Open
public static function DataListPropertyNamePlural (QSqlTable $objTable) {
return $objTable->ClassNamePlural;
}
- 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 ModelReferenceVariableName is not named in camelCase. Open
protected function ModelReferenceVariableName($strColumnName) {
$strColumnName = $this->ModelReferenceColumnName($strColumnName);
return QConvertNotation::PrefixFromType(QType::Object) .
QConvertNotation::CamelCaseFromUnderscore($strColumnName);
}
- 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 GenerateFiles is not named in camelCase. Open
public function GenerateFiles($strTemplatePrefix, $mixArgumentArray) {
// If you are editing core templates, and getting EOF errors only on the travis build, this may be your problem. Scan your files and remove short tags.
if (QCodeGen::DebugMode && ini_get ('short_open_tag')) _p("Warning: PHP directive short_open_tag is on. Using short tags will cause unexpected EOF on travis build.\n", false);
// Default the template paths
- 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 DataListControlName is not named in camelCase. Open
public static function DataListControlName (QSqlTable $objTable) {
if (($o = $objTable->Options) && isset ($o['Name'])) { // Did developer default?
return $o['Name'];
}
return QConvertNotation::WordsFromCamelCase($objTable->ClassNamePlural);
- 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 GenerateAggregate is not named in camelCase. Open
public static function GenerateAggregate() {
$objDbOrmCodeGen = array();
$objRestServiceCodeGen = array();
foreach (QCodeGen::$CodeGenArray as $objCodeGen) {
- 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 ModelConnectorLabelVariableName is not named in camelCase. Open
public function ModelConnectorLabelVariableName($objColumn) {
$strPropName = static::ModelConnectorPropertyName($objColumn);
return QLabel_CodeGenerator::Instance()->VarName($strPropName);
}
- 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 ModelColumnPropertyName is not named in camelCase. Open
protected function ModelColumnPropertyName($strColumnName) {
return QConvertNotation::CamelCaseFromUnderscore($strColumnName);
}
- 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 GetControlCodeGenerator is not named in camelCase. Open
public function GetControlCodeGenerator($objColumn) {
$strControlClass = $this->ModelConnectorControlClass($objColumn);
if (method_exists($strControlClass, 'GetCodeGenerator')) {
return call_user_func($strControlClass.'::GetCodeGenerator');
- 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 DataListItemName is not named in camelCase. Open
public static function DataListItemName (QSqlTable $objTable) {
if (($o = $objTable->Options) && isset ($o['ItemName'])) { // Did developer override?
return $o['ItemName'];
}
return QConvertNotation::WordsFromCamelCase($objTable->ClassName);
- 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 GenerateFile is not named in camelCase. Open
public function GenerateFile($strModuleSubPath, $strTemplateFilePath, $mixArgumentArray, $blnSave = true) {
// Setup Debug/Exception Message
if (QCodeGen::DebugMode) _p("Evaluating $strTemplateFilePath<br/>", false);
// Check to see if the template file exists, and if it does, Load It
- 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 ModelVariableName is not named in camelCase. Open
public function ModelVariableName($strTableName) {
$strTableName = $this->StripPrefixFromTable($strTableName);
return QConvertNotation::PrefixFromType(QType::Object) .
QConvertNotation::CamelCaseFromUnderscore($strTableName);
}
- 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 ParameterListFromColumnArray is not named in camelCase. Open
protected function ParameterListFromColumnArray($objColumnArray) {
return $this->ImplodeObjectArray(', ', '$', '', 'VariableName', $objColumnArray);
}
- 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 DataListControlClass is not named in camelCase. Open
public function DataListControlClass (QSqlTable $objTable) {
// Is the class specified by the developer?
if ($o = $objTable->Options) {
if (isset($o['ControlClass'])) {
return $o['ControlClass'];
- 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 DataListPropertyName is not named in camelCase. Open
public static function DataListPropertyName (QSqlTable $objTable) {
return $objTable->ClassName;
}
- 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 CalculateObjectDescription is not named in camelCase. Open
protected function CalculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, $blnPluralize) {
// Strip Prefixes (if applicable)
$strTableName = $this->StripPrefixFromTable($strTableName);
$strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
- 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 ReportError is not named in camelCase. Open
public function ReportError ($strError) {
$this->strErrors .= $strError . "\r\n";
}
- 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 Pluralize is not named in camelCase. Open
protected function Pluralize($strName) {
// Special Rules go Here
switch (true) {
case (strtolower($strName) == 'play'):
return $strName . 's';
- 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 CalculateObjectDescriptionForAssociation is not named in camelCase. Open
protected function CalculateObjectDescriptionForAssociation($strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize) {
// Strip Prefixes (if applicable)
$strTableName = $this->StripPrefixFromTable($strTableName);
$strAssociationTableName = $this->StripPrefixFromTable($strAssociationTableName);
$strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
- 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 CalculateGraphPrefixArray is not named in camelCase. Open
protected function CalculateGraphPrefixArray($objForeignKeyArray) {
// Analyze Column Names to determine GraphPrefixArray
if ((strpos(strtolower($objForeignKeyArray[0]->ColumnNameArray[0]), 'parent') !== false) ||
(strpos(strtolower($objForeignKeyArray[1]->ColumnNameArray[0]), 'child') !== false)) {
$strGraphPrefixArray[0] = '';
- 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 VariableTypeFromDbType is not named in camelCase. Open
protected function VariableTypeFromDbType($strDbType) {
switch ($strDbType) {
case QDatabaseFieldType::Bit:
return QType::Boolean;
case QDatabaseFieldType::Blob:
- 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() {
}
}