Showing 280 of 426 total issues
Function get
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function get($array, $key, $default = null)
{
if ( ! is_array($array) and ! $array instanceof \ArrayAccess)
{
// throw new \InvalidArgumentException('First parameter must be an array or ArrayAccess object.');
- 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 duplicatedNames
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static function duplicatedNames($k, $url, $whole_form, $v, $action)
{
preg_match_all("/\<(?:input|select|textarea) .+?\>/si", $whole_form, $names);
if (isset($names[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 check
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'empty_link_element', 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 setDeleteElement
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static function setDeleteElement($eles, $fors)
{
$del_eles = array();
foreach ($fors as $for)
{
- 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 updateChecks
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static function updateChecks($url)
{
$bulk = Input::postArr('chk');
$vals = array();
$loops = 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 fetchAll
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function fetchAll($force = false, $version = null, $group_id = null)
{
if ( ! is_null(static::$vals) && ! $force) return static::$vals;
$ret = static::fetchRaw($version, $group_id);
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public static function issue($users = array(), $current_user_id = NULL, $is_admin = false)
{
$id = intval(Input::get('id'));
$issue = Model\Issue::fetch($id);
if (empty($issue) || Arr::get($issue, 'trash') == 1) Util::error('issue not found');
- 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 forge
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function forge($controller = '\A11yc\Controller\Center', $action = 'actionIndex')
{
// vals
$c = Input::get('c', '');
$a = Input::get('a', '');
Method collectFormItems
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function collectFormItems($ms)
{
$form_items = array('<form ', '</form' ,'<label', '<input', '<select', '<texta', '<butto');
$forms = array();
$n = 0;
Method get
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get()
{
// don't call twice
if (isset($this->body) && $this->body) return true;
$url = $this->url;
Method get
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get($array, $key, $default = null)
{
if ( ! is_array($array) and ! $array instanceof \ArrayAccess)
{
// throw new \InvalidArgumentException('First parameter must be an array or ArrayAccess object.');
Method uniqueLabel
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function uniqueLabel($k, $url, $whole_form, $v)
{
preg_match_all("/\<label[^\>]*?\>(.+?)\<\/label\>/is", $whole_form, $ms);
if (isset($ms[1]))
Method update
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function update()
{
if ( ! Db::isTableExist(A11YC_TABLE_SETTINGS)) return;
self::serialize2json(); // trait AddDataUtil
Method index
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function index()
{
// fetch pages
$list = Input::get('list', 'all');
$words = Util::searchWords2Arr(Input::get('s', ''));
Method issue
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function issue()
{
$issues = Model\Issue::fetchByStatus(0);
$settings = Model\Setting::fetchAll();
$pages = Model\Page::fetchAll();
Method check
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'appropriate_heading_descending', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
Function a11yc_tooltip
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function a11yc_tooltip(){
// console.log('function:'+'a11yc_tooltip');
var $a11yc_tooltip = $(),
title_str = '',
position = 0,
Method setLabelAndElement
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function setLabelAndElement($ms)
{
$eles = array();
$fors = array();
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($config)
{
$dbtype = strtolower($config['dbtype']);
$dbh = false;
Method validate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function validate($url, $target_html, $ua, $do_css_check = false)
{
// check
$codes = Validate::$codes;
Validate::$do_css_check = $do_css_check;