GenerateCode accesses the super-global variable $_SESSION. Open
public function GenerateCode()
{
// reset code
$this->sCode = '';
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Validate accesses the super-global variable $_SESSION. Open
public static function Validate($sUserCode, $bCaseInsensitive = true)
{
if ($bCaseInsensitive) {
$sUserCode = mb_strtoupper($sUserCode);
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Validate accesses the super-global variable $_SESSION. Open
public static function Validate($sUserCode, $bCaseInsensitive = true)
{
if ($bCaseInsensitive) {
$sUserCode = mb_strtoupper($sUserCode);
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Validate accesses the super-global variable $_SESSION. Open
public static function Validate($sUserCode, $bCaseInsensitive = true)
{
if ($bCaseInsensitive) {
$sUserCode = mb_strtoupper($sUserCode);
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
GenerateCode accesses the super-global variable $_SESSION. Open
public function GenerateCode()
{
// reset code
$this->sCode = '';
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
The class PhpCaptcha has an overall complexity of 60 which is very high. The configured complexity threshold is 50. Open
class PhpCaptcha
{
public $oImage;
public $aFonts;
public $iWidth;
- Exclude checks
The class PhpCaptcha has 12 public methods. Consider refactoring PhpCaptcha to keep number of public methods under 10. Open
class PhpCaptcha
{
public $oImage;
public $aFonts;
public $iWidth;
- 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
File PhpCaptcha.php
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace XoopsModules\Extgallery;
/***************************************************************/
Function SetCharSet
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function SetCharSet($vCharSet)
{
// check for input type
if (\is_array($vCharSet)) {
$this->aCharSet = $vCharSet;
- 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
PhpCaptcha
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class PhpCaptcha
{
public $oImage;
public $aFonts;
public $iWidth;
The class PhpCaptcha has 17 fields. Consider redesigning PhpCaptcha to keep the number of fields under 15. Open
class PhpCaptcha
{
public $oImage;
public $aFonts;
public $iWidth;
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Function Create
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function Create($sFilename = '')
{
// check for required gd functions
if (!\function_exists('imagecreate') || !\function_exists("image$this->sFileType")
|| ('' != $this->vBackgroundImages && !\function_exists('imagecreatetruecolor'))) {
- 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 DrawCharacters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function DrawCharacters()
{
$iShadowColour = '';
// loop through and write out selected number of characters
for ($i = 0, $iMax = mb_strlen($this->sCode); $i < $iMax; ++$i) {
- 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 DrawCharacters
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function DrawCharacters()
{
$iShadowColour = '';
// loop through and write out selected number of characters
for ($i = 0, $iMax = mb_strlen($this->sCode); $i < $iMax; ++$i) {
Method Create
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Create($sFilename = '')
{
// check for required gd functions
if (!\function_exists('imagecreate') || !\function_exists("image$this->sFileType")
|| ('' != $this->vBackgroundImages && !\function_exists('imagecreatetruecolor'))) {
Function GenerateCode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function GenerateCode()
{
// reset code
$this->sCode = '';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method Create() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
public function Create($sFilename = '')
{
// check for required gd functions
if (!\function_exists('imagecreate') || !\function_exists("image$this->sFileType")
|| ('' != $this->vBackgroundImages && !\function_exists('imagecreatetruecolor'))) {
- 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 Validate has a boolean flag argument $bCaseInsensitive, which is a certain sign of a Single Responsibility Principle violation. Open
public static function Validate($sUserCode, $bCaseInsensitive = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method SetCharSet uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->aCharSet[] = $sCurrentItem;
}
- 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 SetCharSet uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if ('' != $vCharSet) {
// split items on commas
$aCharSet = \explode(',', $vCharSet);
- 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 GenerateCode uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// select random character and add to code string
$this->sCode .= \chr(\mt_rand(65, 90));
}
- 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 DrawCharacters uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$iRandColour = \mt_rand(0, 100);
$iTextColour = \imagecolorallocate($this->oImage, $iRandColour, $iRandColour, $iRandColour);
if ($this->bCharShadow) {
- 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 GenerateCode uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$_SESSION[CAPTCHA_SESSION_ID] = $this->sCode;
}
- 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 Create uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// create new image
$this->oImage = \imagecreate($this->iWidth, $this->iHeight);
}
- 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 DrawLines uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$iRandColour = \mt_rand(100, 250);
$iLineColour = \imagecolorallocate($this->oImage, $iRandColour, $iRandColour, $iRandColour);
}
- 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 SetFileType uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->sFileType = 'jpeg';
}
- 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 Create uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$oBackgroundImage = \imagecreatefromjpeg($this->vBackgroundImages);
}
- 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 variables with short names like $iX. Configured minimum length is 3. Open
$iX = $this->iSpacing / 4 + $i * $this->iSpacing;
- 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 $iY. Configured minimum length is 3. Open
$iY = $this->iHeight / 2 + $iCharHeight / 4;
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 57 and the first side effect is on line 57. Open
<?php
- Exclude checks
Multi-line function declarations must define one parameter per line Open
$aFonts, // array of TrueType fonts to use - specify full path
- Exclude checks
Method name "PhpCaptcha::SetBackgroundImages" is not in camel caps format Open
public function SetBackgroundImages($vBackgroundImages)
- Exclude checks
Method name "PhpCaptcha::GenerateCode" is not in camel caps format Open
public function GenerateCode()
- Exclude checks
Method name "PhpCaptcha::SetMinFontSize" is not in camel caps format Open
public function SetMinFontSize($iMinFontSize)
- Exclude checks
Method name "PhpCaptcha::SetMaxFontSize" is not in camel caps format Open
public function SetMaxFontSize($iMaxFontSize)
- Exclude checks
Method name "PhpCaptcha::SetWidth" is not in camel caps format Open
public function SetWidth($iWidth)
- Exclude checks
Method name "PhpCaptcha::SetNumLines" is not in camel caps format Open
public function SetNumLines($iNumLines)
- Exclude checks
Method name "PhpCaptcha::WriteFile" is not in camel caps format Open
public function WriteFile($sFilename)
- Exclude checks
Method name "PhpCaptcha::Validate" is not in camel caps format Open
public static function Validate($sUserCode, $bCaseInsensitive = true)
- Exclude checks
Method name "PhpCaptcha::UseColour" is not in camel caps format Open
public function UseColour($bUseColour)
- Exclude checks
Method name "PhpCaptcha::SetHeight" is not in camel caps format Open
public function SetHeight($iHeight)
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
{
- Exclude checks
Method name "PhpCaptcha::DisplayShadow" is not in camel caps format Open
public function DisplayShadow($bCharShadow)
- Exclude checks
Method name "PhpCaptcha::SetOwnerText" is not in camel caps format Open
public function SetOwnerText($sOwnerText)
- Exclude checks
Method name "PhpCaptcha::DrawCharacters" is not in camel caps format Open
public function DrawCharacters()
- Exclude checks
Method name "PhpCaptcha::SetFileType" is not in camel caps format Open
public function SetFileType($sFileType)
- Exclude checks
The CASE body must start on the line following the statement Open
case 'gif':
- Exclude checks
Multi-line function declarations must define one parameter per line Open
$iWidth = CAPTCHA_WIDTH, // width of image
- Exclude checks
Method name "PhpCaptcha::CaseInsensitive" is not in camel caps format Open
public function CaseInsensitive($bCaseInsensitive)
- Exclude checks
Method name "PhpCaptcha::DrawOwnerText" is not in camel caps format Open
public function DrawOwnerText()
- Exclude checks
The DEFAULT body must start on the line following the statement Open
default:
- Exclude checks
Method name "PhpCaptcha::DrawLines" is not in camel caps format Open
public function DrawLines()
- Exclude checks
Method name "PhpCaptcha::SetNumChars" is not in camel caps format Open
public function SetNumChars($iNumChars)
- Exclude checks
The CASE body must start on the line following the statement Open
case 'png':
- Exclude checks
Method name "PhpCaptcha::CalculateSpacing" is not in camel caps format Open
public function CalculateSpacing()
- Exclude checks
Method name "PhpCaptcha::SetCharSet" is not in camel caps format Open
public function SetCharSet($vCharSet)
- Exclude checks
Method name "PhpCaptcha::Create" is not in camel caps format Open
public function Create($sFilename = '')
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$iLineColour = \imagecolorallocate($this->oImage, \mt_rand(100, 250), \mt_rand(100, 250), \mt_rand(100, 250));
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
\imagefttext($this->oImage, $iFontSize, $iAngle, $iX, $iY, $iTextColour, $sCurrentFont, $this->sCode[$i], []);
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$iShadowColour = \imagecolorallocate($this->oImage, \mt_rand(0, 100), \mt_rand(0, 100), \mt_rand(0, 100));
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
\imagefttext($this->oImage, $iFontSize, $iOffsetAngle, $iX + $iRandOffsetX, $iY + $iRandOffsetY, $iShadowColour, $sCurrentFont, $this->sCode[$i], []);
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
\imageline($this->oImage, \mt_rand(0, $this->iWidth), \mt_rand(0, $this->iHeight), \mt_rand(0, $this->iWidth), \mt_rand(0, $this->iHeight), $iLineColour);
- Exclude checks
The method DrawCharacters is not named in camelCase. Open
public function DrawCharacters()
{
$iShadowColour = '';
// loop through and write out selected number of characters
for ($i = 0, $iMax = mb_strlen($this->sCode); $i < $iMax; ++$i) {
- 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 SetHeight is not named in camelCase. Open
public function SetHeight($iHeight)
{
$this->iHeight = $iHeight;
if ($this->iHeight > 200) {
$this->iHeight = 200;
- 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 SetNumLines is not named in camelCase. Open
public function SetNumLines($iNumLines)
{
$this->iNumLines = $iNumLines;
}
- 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 CaseInsensitive is not named in camelCase. Open
public function CaseInsensitive($bCaseInsensitive)
{
$this->bCaseInsensitive = $bCaseInsensitive;
}
- 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 UseColour is not named in camelCase. Open
public function UseColour($bUseColour)
{
$this->bUseColour = $bUseColour;
}
- 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 Create is not named in camelCase. Open
public function Create($sFilename = '')
{
// check for required gd functions
if (!\function_exists('imagecreate') || !\function_exists("image$this->sFileType")
|| ('' != $this->vBackgroundImages && !\function_exists('imagecreatetruecolor'))) {
- 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 SetWidth is not named in camelCase. Open
public function SetWidth($iWidth)
{
$this->iWidth = $iWidth;
if ($this->iWidth > 500) {
$this->iWidth = 500;
- 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 SetOwnerText is not named in camelCase. Open
public function SetOwnerText($sOwnerText)
{
$this->sOwnerText = $sOwnerText;
}
- 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 SetCharSet is not named in camelCase. Open
public function SetCharSet($vCharSet)
{
// check for input type
if (\is_array($vCharSet)) {
$this->aCharSet = $vCharSet;
- 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 SetMinFontSize is not named in camelCase. Open
public function SetMinFontSize($iMinFontSize)
{
$this->iMinFontSize = $iMinFontSize;
}
- 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 SetFileType is not named in camelCase. Open
public function SetFileType($sFileType)
{
// check for valid file type
if (\in_array($sFileType, ['gif', 'png', 'jpeg'])) {
$this->sFileType = $sFileType;
- 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 DrawLines is not named in camelCase. Open
public function DrawLines()
{
for ($i = 0; $i < $this->iNumLines; ++$i) {
// allocate colour
if ($this->bUseColour) {
- 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 SetMaxFontSize is not named in camelCase. Open
public function SetMaxFontSize($iMaxFontSize)
{
$this->iMaxFontSize = $iMaxFontSize;
}
- 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 GenerateCode is not named in camelCase. Open
public function GenerateCode()
{
// reset code
$this->sCode = '';
- 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 DisplayShadow is not named in camelCase. Open
public function DisplayShadow($bCharShadow)
{
$this->bCharShadow = $bCharShadow;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Validate is not named in camelCase. Open
public static function Validate($sUserCode, $bCaseInsensitive = true)
{
if ($bCaseInsensitive) {
$sUserCode = mb_strtoupper($sUserCode);
}
- 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 CalculateSpacing is not named in camelCase. Open
public function CalculateSpacing()
{
$this->iSpacing = (int)($this->iWidth / $this->iNumChars);
}
- 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 SetNumChars is not named in camelCase. Open
public function SetNumChars($iNumChars)
{
$this->iNumChars = $iNumChars;
$this->CalculateSpacing();
}
- 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 SetBackgroundImages is not named in camelCase. Open
public function SetBackgroundImages($vBackgroundImages)
{
$this->vBackgroundImages = $vBackgroundImages;
}
- 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 DrawOwnerText is not named in camelCase. Open
public function DrawOwnerText()
{
// allocate owner text colour
$iBlack = \imagecolorallocate($this->oImage, 0, 0, 0);
// get height of selected font
- 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 WriteFile is not named in camelCase. Open
public function WriteFile($sFilename)
{
if ('' == $sFilename) {
// tell browser that data is jpeg
\header("Content-type: image/$this->sFileType");
- 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() {
}
}