Showing 426 of 426 total issues
Method each
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function each($url, $base_url = '', $is_assign = false, $is_center = false)
{
$page = Model\Page::fetch($url);
if ( ! $page || ! $page['done'] || $page['trash'])
Method settings
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function settings()
{
$sql = 'SELECT * FROM '.A11YC_TABLE_SETUP_OLD.';';
$settings = Db::fetchAll($sql);
if (empty($settings[0])) return;
Method revertHtml
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function revertHtml($html)
{
if (is_array($html)) Util::error('invalid HTML was given');
$retval = str_replace(
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);
Method check
has 40 lines of code (exceeds 25 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);
Function getText
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function getText($url, $code_str, $place, $key, $num_of_err)
{
$yml = Yaml::fetch();
$current_err = Validate::setCurrentErr($url, $code_str);
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'img_input_has_alt', 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 scopeless
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private static function scopeless($n, $m, $url, $tstr)
{
// return because simple table
if (substr_count($m, '<th') == substr_count($m, '<td')) return;
- 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 addIclLines
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private static function addIclLines($csv, $pages)
{
$resultspts = Values::resultsOptions();
$criterions = Yaml::each('criterions');
$icls = Model\Icl::fetchAll();
- 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 issue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function issue()
{
$issues = Model\Issue::fetchByStatus(0);
$settings = Model\Setting::fetchAll();
$pages = Model\Page::fetchAll();
- 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 fetchByStatus
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function fetchByStatus($status, $force = false)
{
$vals = static::fetchAll($force);
$retvals = 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
Method check
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'not_label_but_title', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
$ms = Element\Get::elementsByRe($str, 'ignores', 'tags');
Method assignLinks
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function assignLinks($base_url = '')
{
$removes = array('a11yc_policy', 'a11yc_report', 'a11yc_page', 'url');
if ( ! array_key_exists(Input::get('a11yc_version'), Model\Version::fetchAll()))
{
Method check
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'duplicated_ids', self::$unspec, 1);
Validate\Set::log($url, 'duplicated_accesskeys', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
Method explodeStrings
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function explodeStrings($str)
{
$attrs = array();
foreach (explode(' ', $str) as $k => $v)
{
Method migratePages
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function migratePages($pages_old_tbl)
{
$sql = 'SELECT * FROM '.$pages_old_tbl.';';
$pages = Db::fetchAll($sql);
The class Element has 16 fields. Consider redesigning Element to keep the number of fields under 15. Open
class Element
{
public static $ignores = array(
"/\<script.+?\<\/script\>/si",
"/\<style.+?\<\/style\>/si",
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Method check
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'notice_non_html_exists', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
Method check
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'css_is_meanfull_content', self::$unspec, 5);
if ( ! static::$do_css_check) return;
Validate\Set::log($url, 'css_is_meanfull_content', self::$unspec, 1);
Method resultStr
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function resultStr($level, $target_level, $is_str = TRUE)
{
$level = intval($level);
if ($target_level == 2 && $level == 1)
{