jidaikobo-shibata/a11yc

View on GitHub
classes/Validate/Check/SuspiciousAttributes.php

Summary

Maintainability
A
1 hr
Test Coverage

Method check has 40 lines of code (exceeds 25 allowed). Consider refactoring.
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);
Severity: Minor
Found in classes/Validate/Check/SuspiciousAttributes.php - About 1 hr to fix

    Avoid using undefined variables such as '::$error_ids' which will lead to PHP notices.
    Open

            static::addErrorToHtml($url, 'duplicated_attributes', static::$error_ids[$url], 'ignores');

    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

            static::addErrorToHtml($url, 'suspicious_attributes', static::$error_ids[$url], 'ignores');

    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

    There are no issues that match your filters.

    Category
    Status