Showing 426 of 426 total issues
Function getInput
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function getInput($n, $str, $retvals)
{
$force = true;
$ms = Element\Get::elementsByRe($str, 'ignores', 'tags', $force);
- 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 setCommonIssue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function setCommonIssue($issues, $commons)
{
foreach ($commons as $v)
{
foreach ($v as $vv)
- 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 importIssue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function importIssue($results)
{
if ( ! isset($results['issue'])) return;
foreach ($results['issue'] as $url => $vals)
- 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 getUrls
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function getUrls($url)
{
// fetch attributes
$ua = 'using';
$html = Model\Html::fetch($url, $ua);
- 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 makeArray
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function makeArray($css)
{
// remove comments, import or so
$css = preg_replace('/\/\*.+?\*\//is', '', $css);
$css = preg_replace('/^@import.+?$/mis', '', $css);
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'same_alt_and_filename_of_img', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
$ms = Element\Get::elementsByRe($str, 'ignores', 'imgs');
Method sqlite
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function sqlite ($path, $file, $is_force = FALSE)
{
if (defined('A11YC_DB_TYPE') && A11YC_DB_TYPE == 'mysql') return;
if ( ! file_exists($path.$file))
Method check
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'too_much_opens', self::$unspec, 1);
Validate\Set::log($url, 'too_much_ends', self::$unspec, 1);
Validate\Set::log($url, 'suspicious_ends', self::$unspec, 1);
Method check
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function check($url)
{
Validate\Set::log($url, 'empty_link_element', self::$unspec, 1);
$str = Element\Get::ignoredHtml($url);
Method edit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function edit()
{
$url_path = base64_encode(Input::get('url'));
$url = Util::urldec(Input::get('url'));
Method divideEachProperties
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function divideEachProperties($each_properties)
{
$props = array();
foreach ($each_properties as $prop_and_val)
{
Method fetchAll
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetchAll($force = false)
{
if ( ! is_null(static::$vals) && ! $force) return static::$vals;
$vals = array();
$commons = array();
Method routing
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function routing()
{
// vals
$a = Input::get('a', '');
$controller = '\A11yc\Controller\Post';
Method updateChecks
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function updateChecks($url)
{
$bulk = Input::postArr('chk');
$vals = array();
$loops = array(
Method filter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function filter($vals, $fields)
{
foreach ($fields as $k => $v)
{
$vals[$k] = Arr::get($vals, $k, $v);
Method report
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function report($base_url, $is_index = false)
{
$settings = Model\Setting::fetchAll();
View::assign('title', A11YC_LANG_POLICY);
Method actionImport
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function actionImport()
{
$is_waic_imported = Model\Setting::fetch('is_waic_imported');
if ($is_waic_imported) Util::redirect(A11YC_URL);
Method getCssFileFromLink
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getCssFileFromLink($html, $ua)
{
$css = '';
$ua = $ua == 'using' ? Input::userAgent() : $ua;
if (preg_match_all("/\<link [^\>]*\>/si", $html, $ms))
Method uas
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function uas()
{
return array(
'using' => array(
'name' => A11YC_LANG_UA_USING,
Method set
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function set(&$array, $key, $value = null)
{
if (is_null($key))
{
$array = $value;