File class.JavaScriptPacker.inc.php
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* 25 October 2011. version 1.1-FF4
*
* This is the php version of the Dean Edwards JavaScript's Packer,
* Based on :
The class JavaScriptPacker has an overall complexity of 59 which is very high. The configured complexity threshold is 50. Open
class JavaScriptPacker
{
// constants
const IGNORE = '$1';
- Exclude checks
JavaScriptPacker
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class JavaScriptPacker
{
// constants
const IGNORE = '$1';
Method _bootStrap
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _bootStrap($packed, $keywords)
{
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
Function _replacement
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function _replacement($arguments)
{
if (empty($arguments)) return '';
$i = 1; $j = 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 _bootStrap
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function _bootStrap($packed, $keywords)
{
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
- 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 _analyze
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
Function add
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function add($expression, $replacement = '')
{
// count the number of sub-expressions
// - add one because each pattern is itself a sub-expression
$length = 1 + preg_match_all($this->GROUPS, $this->_internalEscape((string) $expression), $out);
- 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 _analyze
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method _bootStrap() has an NPath complexity of 3584. The configured NPath complexity threshold is 200. Open
private function _bootStrap($packed, $keywords)
{
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
- 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 _bootStrap() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10. Open
private function _bootStrap($packed, $keywords)
{
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
- 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 _replacement() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
private function _replacement($arguments)
{
if (empty($arguments)) return '';
$i = 1; $j = 0;
- 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 '$values' which will lead to PHP notices. Open
$values[$j] = call_user_func(array(&$this, $encode), $j);
- 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 '$values' which will lead to PHP notices. Open
$protected['$' . $values[$j]] = $j++;
- 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 '$values' which will lead to PHP notices. Open
$_encoded[$_sorted[$i]] = $values[$i];
- 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
Missing class import via use statement (line '160', column '23'). Open
$parser = new ParseMaster();
- 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 '130', column '23'). Open
$parser = new ParseMaster();
- 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 '358', column '29'). Open
$unpackPacker = new JavaScriptPacker($unpack, 0, false, true);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '188', column '23'). Open
$parser = new ParseMaster();
- 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 __construct has a boolean flag argument $_fastDecode, which is a certain sign of a Single Responsibility Principle violation. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = 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
The method __construct has a boolean flag argument $_specialChars, which is a certain sign of a Single Responsibility Principle violation. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = 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
The method _replacement uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$i += $pattern[self::LENGTH];
}
- 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 _encodeKeywords uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
else {
//$res = $parser->exec($script);
//$res = $this->_bootStrap($res, $keywords);
//return $res;
return $this->_bootStrap($parser->exec($script), $keywords);
- 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 _escape uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return $string;
}
- 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 _unescape uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return $string;
}
- 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 _unescapeBis uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$temp = '';
}
- 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 _bootStrap uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// perform the encoding inline
$unpack = preg_replace($ENCODE, $inline, $unpack);
}
- 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 add uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else { // a complicated lookup (e.g. "Hello $2 $1")
// build a function to do the lookup
$quote = preg_match($this->QUOTE, $this->_internalEscape($replacement))
? '"' : "'";
$replacement = array(
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid unused private methods such as '_basicCompression'. Open
private function _basicCompression($script)
{
$parser = new ParseMaster();
// make safe
$parser->escapeChar = '\\';
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused local variables such as '$value'. Open
$value = array(); // dictionary of charCode->encoding (eg. 256->ff)
- 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 private methods such as '_encodePrivate'. Open
private function _encodePrivate($charCode)
{
return "_" . $charCode;
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as '_escapeBis'. Open
private function _escapeBis($match)
{
$this->_escaped[] = $match[1];
return $this->buffer;
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused parameters such as '$match'. Open
private function _insertFastDecode($match)
- 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 private methods such as '_insertFastEncode'. Open
private function _insertFastEncode($match)
{
return '{$encode=' . $this->buffer . ';';
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as '_escape95Bis'. Open
private function _escape95Bis($match)
{
return '\x'.((string) dechex(ord($match)));
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private fields such as '$TRIM'. Open
private $TRIM = '/([\'"])\\1\\.(.*)\\.\\1\\1$/';
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Avoid unused private methods such as '_replace_name'. Open
private function _replace_name($match, $offset)
{
$length = strlen($match[$offset + 2]);
$start = $length - max($length - strlen($match[$offset + 3]), 0);
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused local variables such as '$value'. Open
foreach ($keywords['protected'] as $i=>$value) {
- 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 private methods such as '_encodeSpecialChars'. Open
private function _encodeSpecialChars($script)
{
$parser = new ParseMaster();
// replace: $name -> n, $$name -> na
$parser->add('/((\\x24+)([a-zA-Z$_]+))(\\d*)/',
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as '_insertFastDecode'. Open
private function _insertFastDecode($match)
{
return '{' . $this->buffer . ';';
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as '_replace_encoded'. Open
private function _replace_encoded($match, $offset)
{
return $this->buffer[$match[$offset]];
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as '_unescapeBis'. Open
private function _unescapeBis()
{
if (isset($this->_escaped[$this->buffer['i']])
&& $this->_escaped[$this->buffer['i']] != '')
{
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused parameters such as '$match'. Open
private function _insertFastEncode($match)
- 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 '$out'. Open
$length = 1 + preg_match_all($this->GROUPS, $this->_internalEscape((string) $expression), $out);
- 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 private methods such as '_backReferences'. Open
private function _backReferences($match, $offset)
{
$replacement = $this->buffer['replacement'];
$quote = $this->buffer['quote'];
$i = $this->buffer['length'];
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as '_sortWords'. Open
private function _sortWords($match1, $match2)
{
return $this->_count[$match2] - $this->_count[$match1];
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as '_encode36'. Open
private function _encode36($charCode)
{
return base_convert($charCode, 10, 36);
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as '_encodeKeywords'. Open
private function _encodeKeywords($script)
{
// escape high-ascii values already in the script (i.e. in strings)
if ($this->_encoding > 62)
$script = $this->_escape95($script);
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as '_replacement'. Open
private function _replacement($arguments)
{
if (empty($arguments)) return '';
$i = 1; $j = 0;
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused local variables such as '$quote'. Open
$quote = $this->buffer['quote'];
- 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 private methods such as '_encode10'. Open
private function _encode10($charCode)
{
return $charCode;
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid using count() function in do loops. Open
do {
if (!isset($_sorted[$i]))
$_sorted[$i] = substr($unsorted[$j++], 1);
$_encoded[$_sorted[$i]] = $values[$i];
} while (++$i < count($unsorted));
- Read upRead up
- Exclude checks
CountInLoopExpression
Since: 2.7.0
Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.
Example
class Foo {
public function bar()
{
$array = array();
for ($i = 0; count($array); $i++) {
// ...
}
}
}
Source https://phpmd.org/rules/design.html#countinloopexpression
BUG found Open
* KNOWN BUG: erroneous behavior when using escapeChar with a replacement
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class ParseMaster
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class JavaScriptPacker
- Exclude checks
The parameter $_script is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 property $_patterns is not named in camelCase. Open
class ParseMaster
{
public $ignoreCase = false;
public $escapeChar = '';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The parameter $_specialChars is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 property $_encoding is not named in camelCase. Open
class JavaScriptPacker
{
// constants
const IGNORE = '$1';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Avoid variables with short names like $j. Configured minimum length is 3. Open
$i = 1; $j = 0;
- 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
The property $_specialChars is not named in camelCase. Open
class JavaScriptPacker
{
// constants
const IGNORE = '$1';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $SUB_REPLACE is not named in camelCase. Open
class ParseMaster
{
public $ignoreCase = false;
public $escapeChar = '';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_escaped is not named in camelCase. Open
class ParseMaster
{
public $ignoreCase = false;
public $escapeChar = '';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Avoid variables with short names like $i. Configured minimum length is 3. Open
$i = count($all); $j = 0; //$word = null;
- 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
The property $_fastDecode is not named in camelCase. Open
class JavaScriptPacker
{
// constants
const IGNORE = '$1';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_count is not named in camelCase. Open
class JavaScriptPacker
{
// constants
const IGNORE = '$1';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_parsers is not named in camelCase. Open
class JavaScriptPacker
{
// constants
const IGNORE = '$1';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $LITERAL_ENCODING is not named in camelCase. Open
class JavaScriptPacker
{
// constants
const IGNORE = '$1';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Avoid variables with short names like $j. Configured minimum length is 3. Open
$i = count($all); $j = 0; //$word = null;
- 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
The property $_script is not named in camelCase. Open
class JavaScriptPacker
{
// constants
const IGNORE = '$1';
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The parameter $_fastDecode is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 $_encoding is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 $i. Configured minimum length is 3. Open
$i = $this->buffer['length'];
- 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 $i. Configured minimum length is 3. Open
$i = 1; $j = 0;
- 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
Each class must be in a file by itself Open
class ParseMaster
- Exclude checks
Method name "_addParser" should not be prefixed with an underscore to indicate visibility Open
private function _addParser($parser)
- Exclude checks
Class constants must be uppercase; expected JSFUNCTION_UNPACK but found JSFUNCTION_unpack Open
const JSFUNCTION_unpack =
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Method name "ParseMaster::_replace_encoded" is not in camel caps format Open
private function _replace_encoded($match, $offset)
- Exclude checks
Method name "_bootStrap" should not be prefixed with an underscore to indicate visibility Open
private function _bootStrap($packed, $keywords)
- Exclude checks
Expected 1 space before "=>"; 0 found Open
foreach ($keywords['protected'] as $i=>$value) {
- Exclude checks
Method name "_add" should not be prefixed with an underscore to indicate visibility Open
private function _add()
- Exclude checks
Method name "_escapeBis" should not be prefixed with an underscore to indicate visibility Open
private function _escapeBis($match)
- Exclude checks
Property name "$_specialChars" should not be prefixed with an underscore to indicate visibility Open
private $_specialChars = false;
- Exclude checks
Method name "_encode10" should not be prefixed with an underscore to indicate visibility Open
private function _encode10($charCode)
- Exclude checks
Method name "_backReferences" should not be prefixed with an underscore to indicate visibility Open
private function _backReferences($match, $offset)
- Exclude checks
Method name "_unescape" should not be prefixed with an underscore to indicate visibility Open
private function _unescape($string, $escapeChar)
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Method name "_encode62" should not be prefixed with an underscore to indicate visibility Open
private function _encode62($charCode)
- Exclude checks
Class constants must be uppercase; expected JSFUNCTION_ENCODE36 but found JSFUNCTION_encode36 Open
const JSFUNCTION_encode36 =
- Exclude checks
Method name "_getEncoder" should not be prefixed with an underscore to indicate visibility Open
private function _getEncoder($ascii)
- Exclude checks
Method name "_replacement" should not be prefixed with an underscore to indicate visibility Open
private function _replacement($arguments)
- Exclude checks
Property name "$_parsers" should not be prefixed with an underscore to indicate visibility Open
private $_parsers = array();
- Exclude checks
Method name "_safeRegExp" should not be prefixed with an underscore to indicate visibility Open
private function _safeRegExp($string)
- Exclude checks
Class constants must be uppercase; expected JSFUNCTION_ENCODE95 but found JSFUNCTION_encode95 Open
const JSFUNCTION_encode95 =
- Exclude checks
Method name "_encodePrivate" should not be prefixed with an underscore to indicate visibility Open
private function _encodePrivate($charCode)
- Exclude checks
Property name "$_patterns" should not be prefixed with an underscore to indicate visibility Open
private $_patterns = array(); // patterns stored by index
- Exclude checks
Method name "_escape" should not be prefixed with an underscore to indicate visibility Open
private function _escape($script)
- Exclude checks
Property name "$_encoding" should not be prefixed with an underscore to indicate visibility Open
private $_encoding = 62;
- Exclude checks
Method name "_escape" should not be prefixed with an underscore to indicate visibility Open
private function _escape($string, $escapeChar)
- Exclude checks
Expected 1 space after "=>"; 0 found Open
foreach ($keywords['protected'] as $i=>$value) {
- Exclude checks
Method name "_encode95" should not be prefixed with an underscore to indicate visibility Open
private function _encode95($charCode)
- Exclude checks
Method name "_getJSFunction" should not be prefixed with an underscore to indicate visibility Open
private function _getJSFunction($aName)
- Exclude checks
Each PHP statement must be on a line by itself Open
$i = 1; $j = 0;
- Exclude checks
Method name "_replace_name" should not be prefixed with an underscore to indicate visibility Open
private function _replace_name($match, $offset)
- Exclude checks
Method name "_replace_encoded" should not be prefixed with an underscore to indicate visibility Open
private function _replace_encoded($match, $offset)
- Exclude checks
Method name "_pack" should not be prefixed with an underscore to indicate visibility Open
private function _pack($script)
- Exclude checks
Method name "_escape95Bis" should not be prefixed with an underscore to indicate visibility Open
private function _escape95Bis($match)
- Exclude checks
The closing brace for the class must go on the next line after the body Open
}
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Method name "_basicCompression" should not be prefixed with an underscore to indicate visibility Open
private function _basicCompression($script)
- Exclude checks
Method name "_encodeKeywords" should not be prefixed with an underscore to indicate visibility Open
private function _encodeKeywords($script)
- Exclude checks
Method name "_insertFastEncode" should not be prefixed with an underscore to indicate visibility Open
private function _insertFastEncode($match)
- Exclude checks
Method name "_analyze" should not be prefixed with an underscore to indicate visibility Open
private function _analyze($script, $regexp, $encode)
- Exclude checks
Method name "_insertFastDecode" should not be prefixed with an underscore to indicate visibility Open
private function _insertFastDecode($match)
- Exclude checks
Method name "_encode36" should not be prefixed with an underscore to indicate visibility Open
private function _encode36($charCode)
- Exclude checks
Method name "_internalEscape" should not be prefixed with an underscore to indicate visibility Open
private function _internalEscape($string)
- Exclude checks
Property name "$_count" should not be prefixed with an underscore to indicate visibility Open
private $_count = array();
- Exclude checks
Class constants must be uppercase; expected JSFUNCTION_DECODEBODY but found JSFUNCTION_decodeBody Open
const JSFUNCTION_decodeBody =
- Exclude checks
Class constants must be uppercase; expected JSFUNCTION_ENCODE10 but found JSFUNCTION_encode10 Open
const JSFUNCTION_encode10 =
- Exclude checks
Class constants must be uppercase; expected JSFUNCTION_ENCODE62 but found JSFUNCTION_encode62 Open
const JSFUNCTION_encode62 =
- Exclude checks
Blank line found at start of control structure Open
if (is_array($replacement) && isset($replacement['fn'])) {
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Property name "$_script" should not be prefixed with an underscore to indicate visibility Open
private $_script = '';
- Exclude checks
Each PHP statement must be on a line by itself Open
$i = count($all); $j = 0; //$word = null;
- Exclude checks
Method name "_encodeSpecialChars" should not be prefixed with an underscore to indicate visibility Open
private function _encodeSpecialChars($script)
- Exclude checks
Method name "_sortWords" should not be prefixed with an underscore to indicate visibility Open
private function _sortWords($match1, $match2)
- Exclude checks
Method name "_escape95" should not be prefixed with an underscore to indicate visibility Open
private function _escape95($script)
- Exclude checks
Property name "$_escaped" should not be prefixed with an underscore to indicate visibility Open
private $_escaped = array(); // escaped characters
- Exclude checks
Method name "ParseMaster::_replace_name" is not in camel caps format Open
private function _replace_name($match, $offset)
- Exclude checks
Method name "_unescapeBis" should not be prefixed with an underscore to indicate visibility Open
private function _unescapeBis()
- Exclude checks
Property name "$_fastDecode" should not be prefixed with an underscore to indicate visibility Open
private $_fastDecode = true;
- Exclude checks
Constant JSFUNCTION_encode36 should be defined in uppercase Open
const JSFUNCTION_encode36 =
'function ($charCode) {
return $charCode.toString(36);
}';//;';
- 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 JSFUNCTION_decodeBody should be defined in uppercase Open
const JSFUNCTION_decodeBody =
//_decode = function () {
// does the browser support String.replace where the
// replacement value is a function?
- 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 JSFUNCTION_encode95 should be defined in uppercase Open
const JSFUNCTION_encode95 =
'function ($charCode) {
return ($charCode < _encoding ? \'\' : arguments.callee($charCode / _encoding)) +
String.fromCharCode($charCode % _encoding + 161);
}';
- 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 JSFUNCTION_encode62 should be defined in uppercase Open
const JSFUNCTION_encode62 =
'function ($charCode) {
return ($charCode < _encoding ? \'\' : arguments.callee(parseInt($charCode / _encoding))) +
(($charCode = $charCode % _encoding) > 35 ? String.fromCharCode($charCode + 29) : $charCode.toString(36));
}';
- 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 JSFUNCTION_encode10 should be defined in uppercase Open
const JSFUNCTION_encode10 =
'function ($charCode) {
return $charCode;
}';//;';
- 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 JSFUNCTION_unpack should be defined in uppercase Open
const JSFUNCTION_unpack =
'function ($packed, $ascii, $count, $keywords, $encode, $decode) {
while ($count--) {
if ($keywords[$count]) {
- 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
Inline control structures are not allowed Open
else $this->_add('/^$/', $replacement, $length);
- Exclude checks
Inline control structures are not allowed Open
if (isset($replacement['data'])) $this->buffer = $replacement['data'];
- Exclude checks
Inline control structures are not allowed Open
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
- Exclude checks
Inline control structures are not allowed Open
if ($this->_encoding > 62)
- Exclude checks
Inline control structures are not allowed Open
elseif ($ascii < 36)
- Exclude checks
Inline control structures are not allowed Open
if (!isset($_sorted[$i]))
- Exclude checks
Inline control structures are not allowed Open
if ($charCode > 35)
- Exclude checks
Inline control structures are not allowed Open
else
- Exclude checks
Inline control structures are not allowed Open
if ($charCode >= $this->_encoding)
- Exclude checks
Inline control structures are not allowed Open
if ($ascii == 0) $ascii = 1;
- Exclude checks
Inline control structures are not allowed Open
if ($this->_encoding > 62)
- Exclude checks
Inline control structures are not allowed Open
if ($this->_specialChars) $parser->add('/;;;[^\\n\\r]+[\\n\\r]/');
- Exclude checks
Inline control structures are not allowed Open
if (empty($script)) return $script;
- Exclude checks
Inline control structures are not allowed Open
if (empty($arguments)) return '';
- Exclude checks
Inline control structures are not allowed Open
if ($this->_specialChars)
- Exclude checks
Inline control structures are not allowed Open
if ($this->_encoding)
- Exclude checks
Inline control structures are not allowed Open
if ($count == 0)
- Exclude checks
Inline control structures are not allowed Open
if (defined('self::JSFUNCTION'.$aName))
- Exclude checks
Inline control structures are not allowed Open
else
- Exclude checks
Inline control structures are not allowed Open
if (!empty($expression)) $this->_add($expression, $replacement, $length);
- Exclude checks
Expected 1 space after ELSE keyword; newline found Open
else
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
'function ($charCode) {
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$parser->add('/((\\x24+)([a-zA-Z$_]+))(\\d*)/',
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
'function ($charCode) {
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$parser->add($regexp,
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
'function ($packed, $ascii, $count, $keywords, $encode, $decode) {
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$parser->add($regexp,
- Exclude checks
Expected 1 space after ELSE keyword; newline found Open
else
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
'function ($charCode) {
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 21 Open
array('fn' => '_replace_name')
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
' if (!\'\'.replace(/^/, String)) {
- Exclude checks
Expected 1 space after closing parenthesis; found 9 Open
&& $this->_escaped[$this->buffer['i']] != '')
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 0 Open
'function ($charCode) {
- Exclude checks
The variable $_protected is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_sorted is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_sorted is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_specialChars is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 $_fastDecode is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 $_encoding is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 $_sorted is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $ENCODE is not named in camelCase. Open
private function _bootStrap($packed, $keywords)
{
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
- 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 $_encoding is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 $ENCODE is not named in camelCase. Open
private function _bootStrap($packed, $keywords)
{
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
- 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 $ENCODE is not named in camelCase. Open
private function _bootStrap($packed, $keywords)
{
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
- 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 $_sorted is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_encoding is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 $_script is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 $_encoded is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_encoding is not named in camelCase. Open
public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
{
$this->_script = $_script . "\n";
if (array_key_exists($_encoding, $this->LITERAL_ENCODING))
$_encoding = $this->LITERAL_ENCODING[$_encoding];
- 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 $_encoded is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_encoded is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_sorted is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_sorted is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_protected is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 $_protected is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- 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 _addParser is not named in camelCase. Open
private function _addParser($parser)
{
$this->_parsers[] = $parser;
}
- 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 _insertFastEncode is not named in camelCase. Open
private function _insertFastEncode($match)
{
return '{$encode=' . $this->buffer . ';';
}
- 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 _unescape is not named in camelCase. Open
private function _unescape($string, $escapeChar)
{
if ($escapeChar) {
$regexp = '/'.'\\'.$escapeChar.'/';
$this->buffer = array('escapeChar'=> $escapeChar, 'i' => 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 _analyze is not named in camelCase. Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _encode62 is not named in camelCase. Open
private function _encode62($charCode)
{
$res = '';
if ($charCode >= $this->_encoding) {
$res = $this->_encode62((int) ($charCode / $this->_encoding));
- 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 _sortWords is not named in camelCase. Open
private function _sortWords($match1, $match2)
{
return $this->_count[$match2] - $this->_count[$match1];
}
- 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 _getEncoder is not named in camelCase. Open
private function _getEncoder($ascii)
{
return $ascii > 10 ? $ascii > 36 ? $ascii > 62 ?
'_encode95' : '_encode62' : '_encode36' : '_encode10';
}
- 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 _replacement is not named in camelCase. Open
private function _replacement($arguments)
{
if (empty($arguments)) return '';
$i = 1; $j = 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 _encode10 is not named in camelCase. Open
private function _encode10($charCode)
{
return $charCode;
}
- 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 _escape is not named in camelCase. Open
private function _escape($string, $escapeChar)
{
if ($escapeChar) {
$this->buffer = $escapeChar;
- 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 _pack is not named in camelCase. Open
private function _pack($script)
{
for ($i = 0; isset($this->_parsers[$i]); $i++) {
$script = call_user_func(array(&$this, $this->_parsers[$i]), $script);
}
- 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 _bootStrap is not named in camelCase. Open
private function _bootStrap($packed, $keywords)
{
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
- 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 _replace_encoded is not named in camelCase. Open
private function _replace_encoded($match, $offset)
{
return $this->buffer[$match[$offset]];
}
- 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 _basicCompression is not named in camelCase. Open
private function _basicCompression($script)
{
$parser = new ParseMaster();
// make safe
$parser->escapeChar = '\\';
- 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 _encodeSpecialChars is not named in camelCase. Open
private function _encodeSpecialChars($script)
{
$parser = new ParseMaster();
// replace: $name -> n, $$name -> na
$parser->add('/((\\x24+)([a-zA-Z$_]+))(\\d*)/',
- 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 _encodePrivate is not named in camelCase. Open
private function _encodePrivate($charCode)
{
return "_" . $charCode;
}
- 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 _escapeBis is not named in camelCase. Open
private function _escapeBis($match)
{
$this->_escaped[] = $match[1];
return $this->buffer;
- 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 _internalEscape is not named in camelCase. Open
private function _internalEscape($string)
{
return preg_replace($this->ESCAPE, '', $string);
}
- 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 _escape is not named in camelCase. Open
private function _escape($script)
{
return preg_replace('/([\\\\\'])/', '\\\$1', $script);
}
- 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 _escape95 is not named in camelCase. Open
private function _escape95($script)
{
return preg_replace_callback(
'/[\\xa1-\\xff]/',
array(&$this, '_escape95Bis'),
- 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 _encodeKeywords is not named in camelCase. Open
private function _encodeKeywords($script)
{
// escape high-ascii values already in the script (i.e. in strings)
if ($this->_encoding > 62)
$script = $this->_escape95($script);
- 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 _safeRegExp is not named in camelCase. Open
private function _safeRegExp($string)
{
return '/'.preg_replace('/\$/', '\\\$', $string).'/';
}
- 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 _getJSFunction is not named in camelCase. Open
private function _getJSFunction($aName)
{
if (defined('self::JSFUNCTION'.$aName))
return constant('self::JSFUNCTION'.$aName);
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 _encode36 is not named in camelCase. Open
private function _encode36($charCode)
{
return base_convert($charCode, 10, 36);
}
- 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 _insertFastDecode is not named in camelCase. Open
private function _insertFastDecode($match)
{
return '{' . $this->buffer . ';';
}
- 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 _encode95 is not named in camelCase. Open
private function _encode95($charCode)
{
$res = '';
if ($charCode >= $this->_encoding)
$res = $this->_encode95($charCode / $this->_encoding);
- 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 _escape95Bis is not named in camelCase. Open
private function _escape95Bis($match)
{
return '\x'.((string) dechex(ord($match)));
}
- 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 _add is not named in camelCase. Open
private function _add()
{
$arguments = func_get_args();
$this->_patterns[] = $arguments;
}
- 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 _backReferences is not named in camelCase. Open
private function _backReferences($match, $offset)
{
$replacement = $this->buffer['replacement'];
$quote = $this->buffer['quote'];
$i = $this->buffer['length'];
- 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 _replace_name is not named in camelCase. Open
private function _replace_name($match, $offset)
{
$length = strlen($match[$offset + 2]);
$start = $length - max($length - strlen($match[$offset + 3]), 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 _unescapeBis is not named in camelCase. Open
private function _unescapeBis()
{
if (isset($this->_escaped[$this->buffer['i']])
&& $this->_escaped[$this->buffer['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() {
}
}