File Validate.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* A11yc\Validate
*
* @package part of A11yc
Function addErrorToHtml
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function addErrorToHtml(
$url,
$error_id,
$s_errors,
$ignore_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
Method addErrorToHtml
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function addErrorToHtml(
$url,
$error_id,
$s_errors,
$ignore_vals = '',
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(
Function ignoreElementsOrComments
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function ignoreElementsOrComments($ignore_vals, $html)
{
$replaces_ignores = array();
if ($ignore_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
Method html
has 26 lines of code (exceeds 25 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;
Method addErrorToHtml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$url,
$error_id,
$s_errors,
$ignore_vals = '',
$issue_html = ''
Method replaceSafeStrings
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static function replaceSafeStrings($replaces, $k, $lv, $error_id, $current_err)
Method html
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function html($url, $html, $codes = array(), $ua = 'using', $force = false)
Function setMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function setMessage($url)
{
$yml = Yaml::fetch();
$all_errs = array(
'notices' => 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 setCurrentErr
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function setCurrentErr($url, $error_id, $issue_html = '')
{
$yml = Yaml::fetch();
$current_err = 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 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;
- 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"