jidaikobo-shibata/a11yc

View on GitHub

Showing 426 of 426 total issues

Remove error control operator '@' on line 173.
Open

    public static function form($url, $users = array(), $current_user_id = null)
    {
        // dbio
        if (Input::isPostExists())
        {
Severity: Minor
Found in classes/Controller/Checklist.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Missing class import via use statement (line '37', column '16').
Open

            $zip  = new \ZipArchive();
Severity: Minor
Found in classes/Controller/DownloadReport.php by phpmd

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

Remove error control operator '@' on line 73.
Open

    private static function validRe($keyword)
    {
        $delimiter = substr($keyword, 0, 1);
        if (strpos($keyword, $delimiter, 1) === false)
        {
Severity: Minor
Found in classes/Sitecheck/ContainKeyword.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 150.
Open

    public static function upperPath($str)
    {
        if (empty(static::$target_path)) Util::error('set set_target_path()');

        // count ups
Severity: Minor
Found in classes/Crawl.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Missing class import via use statement (line '31', column '16').
Open

            $zip  = new \ZipArchive();
Severity: Minor
Found in classes/Controller/DownloadHtml.php by phpmd

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 '43', column '18').
Open

        $storage = new \Upload\Storage\FileSystem($upload_path);
Severity: Minor
Found in classes/File.php by phpmd

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 '53', column '9').
Open

                new \Upload\Validation\Size('5M')
Severity: Minor
Found in classes/File.php by phpmd

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

Remove error control operator '@' on line 81.
Open

    public static function check($url)
    {
        Validate\Set::log($url, 'link_check', self::$unspec, 5);
        if ( ! static::$do_link_check) return;
        Validate\Set::log($url, 'link_check', self::$unspec, 1);
Severity: Minor
Found in classes/Validate/Check/LinkCheck.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Missing class import via use statement (line '183', column '18').
Open

        $request = new \GuzzleHttp\Psr7\Request('GET', $url, $cons);
Severity: Minor
Found in classes/Guzzle.php by phpmd

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 '52', column '9').
Open

                new \Upload\Validation\Mimetype(array('image/png', 'image/gif', 'image/jpg', 'image/jpeg')),
Severity: Minor
Found in classes/File.php by phpmd

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 '122', column '17').
Open

        $client = new \GuzzleHttp\Client(array(
Severity: Minor
Found in classes/Guzzle.php by phpmd

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 '70', column '16').
Open

                $dbh = new \PDO("sqlite:".$config['path']);
Severity: Minor
Found in libs/kontiki/classes/Db.php by phpmd

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 '44', column '15').
Open

        $file = new \Upload\File('file', $storage);
Severity: Minor
Found in classes/File.php by phpmd

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

Function targetCriterions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function targetCriterions()
    {
        $retvals = array();
        $target_level = (int) Model\Setting::fetch('target_level');
        if (empty($target_level)) return $retvals;
Severity: Minor
Found in classes/Values.php - About 25 mins to fix

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 html has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function html($url, $html, $codes = array(), $ua = 'using', $force = false)
    {
//        if ( ! is_string($html)) Util::error('invalid HTML was given');
        $html = ! is_string($html) ? '' : $html;

Severity: Minor
Found in classes/Validate.php - About 25 mins to fix

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 resultStr has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function resultStr($level, $target_level, $is_str = TRUE)
    {
        $level = intval($level);
        if ($target_level == 2 && $level == 1)
        {
Severity: Minor
Found in classes/Evaluate.php - About 25 mins to fix

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 garbageCollection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function garbageCollection ($path)
    {
        $path = dirname($path);
        foreach (glob($path.'/'.'*') as $file)
        {
Severity: Minor
Found in libs/kontiki/classes/Maintenance.php - About 25 mins to fix

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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function check($url)
    {
        Validate\Set::log($url, 'style_for_structure', self::$unspec, 1);
        $str = Element\Get::ignoredHtml($url);

Severity: Minor
Found in classes/Validate/Check/StyleForStructure.php - About 25 mins to fix

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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function check($url)
    {
        Validate\Set::log($url, 'titleless_frame', self::$unspec, 1);

        $str = Element\Get::ignoredHtml($url);
Severity: Minor
Found in classes/Validate/Check/TitlelessFrame.php - About 25 mins to fix

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 existCheck has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function existCheck($href)
    {
        $len = '';
        $is_exists = null;
        if (\A11yc\Guzzle::envCheck())
Severity: Minor
Found in classes/Validate/Check/TellUserFileType.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language