classes/Validate/Check/SuspiciousAttributes.php
Method check
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function check($url)
{
Validate\Set::log($url, 'suspicious_attributes', self::$unspec, 1);
Validate\Set::log($url, 'duplicated_attributes', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
Avoid using undefined variables such as '::$error_ids' which will lead to PHP notices. Open
Open
static::addErrorToHtml($url, 'duplicated_attributes', 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;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '::$error_ids' which will lead to PHP notices. Open
Open
static::addErrorToHtml($url, 'suspicious_attributes', 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;
}
}