Function missMatchForAndId
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private static function missMatchForAndId($n, $url, $ms)
{
if (isset($ms[1]))
{
foreach ($ms[0] as $m)
- 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 uniqueLabel
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private static function uniqueLabel($k, $url, $whole_form, $v)
{
preg_match_all("/\<label[^\>]*?\>(.+?)\<\/label\>/is", $whole_form, $ms);
if (isset($ms[1]))
- 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 collectFormItems
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private static function collectFormItems($ms)
{
$form_items = array('<form ', '</form' ,'<label', '<input', '<select', '<texta', '<butto');
$forms = array();
$n = 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
Method check
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
$error_names = array(
'labelless',
'submitless',
Function duplicatedNames
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static function duplicatedNames($k, $url, $whole_form, $v, $action)
{
preg_match_all("/\<(?:input|select|textarea) .+?\>/si", $whole_form, $names);
if (isset($names[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
Method collectFormItems
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function collectFormItems($ms)
{
$form_items = array('<form ', '</form' ,'<label', '<input', '<select', '<texta', '<butto');
$forms = array();
$n = 0;
Method uniqueLabel
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function uniqueLabel($k, $url, $whole_form, $v)
{
preg_match_all("/\<label[^\>]*?\>(.+?)\<\/label\>/is", $whole_form, $ms);
if (isset($ms[1]))
Method submitless
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private static function submitless($n, $url, $v, $action, $uniqued_types, $uniqued_eles)
Function check
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function check($url)
{
$error_names = array(
'labelless',
'submitless',
- 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 duplicatedNames
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static function duplicatedNames($k, $url, $whole_form, $v, $action)
Avoid using undefined variables such as '::$error_ids' which will lead to PHP notices. Open
static::addErrorToHtml($url, $error_name, static::$error_ids[$url], 'ignores');
- 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;
}
}