Showing 280 of 426 total issues
Function doEvaluate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private static function doEvaluate($cs, $ngs, $yml)
{
// passed
$passed = self::passed($cs, $yml);
- 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 addErrorToHtml
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function addErrorToHtml(
$url,
$error_id,
$s_errors,
$ignore_vals = '',
Function check
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'meanless_element', self::$unspec, 1);
Validate\Set::log($url, 'meanless_element_timing', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
- 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 check
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'meta_refresh', self::$unspec, 5);
if (Validate::$is_partial === true) return;
Validate\Set::log($url, 'meta_refresh', self::$unspec, 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
Function filter
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function filter($vals, $fields)
{
foreach ($fields as $k => $v)
{
$vals[$k] = Arr::get($vals, $k, $v);
- 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 prepareStrings
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function prepareStrings($str)
{
// escaped quote
$str = str_replace(
array("\\'", '\\"'),
File AddData.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* A11yc\Update\AddData
*
* @package part of A11yc
Method check
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'tell_user_file_type', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
$ms = Element\Get::elementsByRe($str, 'ignores', 'anchors_and_values');
Method pages
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function pages($pages_old_tbl, $checks_old_tbl)
{
// migrate pages
self::migratePages($pages_old_tbl);
Function check
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'langless', self::$unspec, 5);
if (Validate::$is_partial === true) return;
Validate\Set::log($url, 'langless', self::$unspec, 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 check
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'empty_alt_attr_of_img_inside_a', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
- 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 recognitionCharset
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private static function recognitionCharset($html)
{
$str = Element::ignoreElementsByStr($html);
// Do not use Element\Get::elementsByRe() because crashed character cause bad cache
preg_match_all("/\<([a-zA-Z1-6]+?) +?([^\>]*?)[\/]*?\>|\<([a-zA-Z1-6]+?)[ \/]*?\>/i", $str, $ms);
- 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
Consider simplifying this complex logical expression. Open
if (
($list == 'all' && $page['trash'] == 0) ||
($list == 'yet' && $page['trash'] == 0 && $page['done'] == 0) ||
($list == 'done' && $page['trash'] == 0 && $page['done'] == 1) ||
($list == 'trash' && $page['trash'] == 1)
Method addPages
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function addPages($is_force = false, $pages = array())
{
$pages = $pages ?: explode("\n", trim(Input::post('pages')));
// add without check
Function countTags
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function countTags($tags, $ignores)
{
$tags = is_null($tags) ? array() : $tags;
$opens = 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
Function yml
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private static function yml()
{
include A11YC_LIB_PATH.'/spyc/Spyc.php';
if ( ! class_exists('Spyc')) Util::error('Spyc is not found');
$chekcs_text = file_get_contents(__DIR__.'/resources/old_checks.yml');
- 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 divideEachProperties
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private static function divideEachProperties($each_properties)
{
$props = array();
foreach ($each_properties as $prop_and_val)
{
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'langless', self::$unspec, 5);
if (Validate::$is_partial === true) return;
Validate\Set::log($url, 'langless', self::$unspec, 1);
Method check
has 46 lines of code (exceeds 25 allowed). Consider refactoring. 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);