Method encoding
has 1060 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function encoding($charset)
{
// Normalization from UTS #22
switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset)))
{
File Misc.php
has 1777 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* SimplePie
*
* A PHP-Based RSS and Atom Feed Framework.
Function xml_encoding
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public static function xml_encoding($data, $registry)
{
// UTF-32 Big Endian BOM
if (substr($data, 0, 4) === "\x00\x00\xFE\xFF")
{
- 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
SimplePie_Misc
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class SimplePie_Misc
{
public static function time_hms($seconds)
{
$time = '';
Method xml_encoding
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function xml_encoding($data, $registry)
{
// UTF-32 Big Endian BOM
if (substr($data, 0, 4) === "\x00\x00\xFE\xFF")
{
Function get_element
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function get_element($realname, $string)
{
$return = array();
$name = preg_quote($realname, '/');
if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))
- 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 uncomment_rfc822
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function uncomment_rfc822($string)
{
$string = (string) $string;
$position = 0;
$length = strlen($string);
- 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 codepoint_to_utf8
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function codepoint_to_utf8($codepoint)
{
$codepoint = (int) $codepoint;
if ($codepoint < 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
Consider simplifying this complex logical expression. Open
if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)
{
return chr($integer);
}
Method uncomment_rfc822
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function uncomment_rfc822($string)
{
$string = (string) $string;
$position = 0;
$length = strlen($string);
Method debug
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function debug(&$sp)
{
$info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . "\n";
$info .= 'PHP ' . PHP_VERSION . "\n";
if ($sp->error() !== null)
Function error
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function error($message, $level, $file, $line)
{
if ((ini_get('error_reporting') & $level) > 0)
{
switch ($level)
- 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 debug
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function debug(&$sp)
{
$info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . "\n";
$info .= 'PHP ' . PHP_VERSION . "\n";
if ($sp->error() !== null)
- 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 error
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function error($message, $level, $file, $line)
{
if ((ini_get('error_reporting') & $level) > 0)
{
switch ($level)
Method get_element
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get_element($realname, $string)
{
$return = array();
$name = preg_quote($realname, '/');
if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))
Function change_encoding
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function change_encoding($data, $input, $output)
{
$input = SimplePie_Misc::encoding($input);
$output = SimplePie_Misc::encoding($output);
- 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 change_encoding
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function change_encoding($data, $input, $output)
{
$input = SimplePie_Misc::encoding($input);
$output = SimplePie_Misc::encoding($output);
Method change_encoding_mbstring
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function change_encoding_mbstring($data, $input, $output)
{
if ($input === 'windows-949')
{
$input = 'EUC-KR';
Method output_javascript
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function output_javascript()
{
if (function_exists('ob_gzhandler'))
{
ob_start('ob_gzhandler');
Method atom_03_construct_type
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function atom_03_construct_type($attribs)
{
if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
{
$mode = SIMPLEPIE_CONSTRUCT_BASE64;
Function get_build
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function get_build()
{
$root = dirname(dirname(__FILE__));
if (file_exists($root . '/.git/index'))
{
- 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
Avoid deeply nested control flow statements. Open
if (count($attribs[$j]) === 2)
{
$attribs[$j][2] = $attribs[$j][1];
}
Method compress_parse_url
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
Function change_encoding_mbstring
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static function change_encoding_mbstring($data, $input, $output)
{
if ($input === 'windows-949')
{
$input = 'EUC-KR';
- 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 percent_encoding_normalization
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function percent_encoding_normalization($match)
{
$integer = hexdec($match[1]);
if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)
{
- 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
Avoid too many return
statements within this method. Open
return substr_replace($url, 'itpc', 0, 4);
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $url;
Avoid too many return
statements within this method. Open
return 'ASMO_449';
Avoid too many return
statements within this method. Open
return 'BOCU-1';
Avoid too many return
statements within this method. Open
return 'EBCDIC-US';
Avoid too many return
statements within this method. Open
return 'Extended_UNIX_Code_Fixed_Width_for_Japanese';
Avoid too many return
statements within this method. Open
return 'IBM297';
Avoid too many return
statements within this method. Open
return 'IBM850';
Avoid too many return
statements within this method. Open
return 'ISO-8859-1-Windows-3.1-Latin-1';
Avoid too many return
statements within this method. Open
return 'ISO-8859-6';
Avoid too many return
statements within this method. Open
return 'ISO-11548-1';
Avoid too many return
statements within this method. Open
return 'EBCDIC-DK-NO';
Avoid too many return
statements within this method. Open
return 'ES';
Avoid too many return
statements within this method. Open
return 'IBM424';
Avoid too many return
statements within this method. Open
return 'DEC-MCS';
Avoid too many return
statements within this method. Open
return 'EBCDIC-AT-DE';
Avoid too many return
statements within this method. Open
return 'GB18030';
Avoid too many return
statements within this method. Open
return 'greek7';
Avoid too many return
statements within this method. Open
return 'ISO-8859-4';
Avoid too many return
statements within this method. Open
return 'ISO-8859-8-I';
Avoid too many return
statements within this method. Open
return 'iso-ir-90';
Avoid too many return
statements within this method. Open
return 'EBCDIC-AT-DE-A';
Avoid too many return
statements within this method. Open
return 'EBCDIC-ES-A';
Avoid too many return
statements within this method. Open
return 'EUC-JP';
Avoid too many return
statements within this method. Open
return 'IBM277';
Avoid too many return
statements within this method. Open
return 'IBM857';
Avoid too many return
statements within this method. Open
return 'IBM00924';
Avoid too many return
statements within this method. Open
return 'ISO-8859-2-Windows-Latin-2';
Avoid too many return
statements within this method. Open
return 'ISO-8859-6-I';
Avoid too many return
statements within this method. Open
return 'ISO-10646-UCS-2';
Avoid too many return
statements within this method. Open
return 'ISO-10646-UTF-1';
Avoid too many return
statements within this method. Open
return 'ISO-Unicode-IBM-1265';
Avoid too many return
statements within this method. Open
return 'Big5-HKSCS';
Avoid too many return
statements within this method. Open
return 'CSA_Z243.4-1985-1';
Avoid too many return
statements within this method. Open
return 'CSA_Z243.4-1985-2';
Avoid too many return
statements within this method. Open
return 'EBCDIC-FI-SE-A';
Avoid too many return
statements within this method. Open
return 'IBM280';
Avoid too many return
statements within this method. Open
return 'IBM852';
Avoid too many return
statements within this method. Open
return 'IBM863';
Avoid too many return
statements within this method. Open
return 'IBM866';
Avoid too many return
statements within this method. Open
return 'IBM1026';
Avoid too many return
statements within this method. Open
return 'ISO-8859-3';
Avoid too many return
statements within this method. Open
return 'CESU-8';
Avoid too many return
statements within this method. Open
return 'ECMA-cyrillic';
Avoid too many return
statements within this method. Open
return 'greek-ccitt';
Avoid too many return
statements within this method. Open
return 'IBM500';
Avoid too many return
statements within this method. Open
return 'IBM871';
Avoid too many return
statements within this method. Open
return 'IBM01140';
Avoid too many return
statements within this method. Open
return 'IBM01143';
Avoid too many return
statements within this method. Open
return 'IBM01146';
Avoid too many return
statements within this method. Open
return 'EBCDIC-ES';
Avoid too many return
statements within this method. Open
return 'EBCDIC-ES-S';
Avoid too many return
statements within this method. Open
return 'IBM855';
Avoid too many return
statements within this method. Open
return 'IBM903';
Avoid too many return
statements within this method. Open
return 'INVARIANT';
Avoid too many return
statements within this method. Open
return 'ISO-10646-UCS-4';
Avoid too many return
statements within this method. Open
return 'ISO-Unicode-IBM-1261';
Avoid too many return
statements within this method. Open
return 'ISO-Unicode-IBM-1268';
Avoid too many return
statements within this method. Open
return 'dk-us';
Avoid too many return
statements within this method. Open
return 'EBCDIC-CA-FR';
Avoid too many return
statements within this method. Open
return 'IBM284';
Avoid too many return
statements within this method. Open
return 'IBM437';
Avoid too many return
statements within this method. Open
return 'IBM880';
Avoid too many return
statements within this method. Open
return 'IBM01147';
Avoid too many return
statements within this method. Open
return 'IEC_P27-1';
Avoid too many return
statements within this method. Open
return 'Big5';
Avoid too many return
statements within this method. Open
return 'CSN_369103';
Avoid too many return
statements within this method. Open
return 'DIN_66003';
Avoid too many return
statements within this method. Open
return 'EBCDIC-FR';
Avoid too many return
statements within this method. Open
return 'GB_1988-80';
Avoid too many return
statements within this method. Open
return 'HP-Legal';
Avoid too many return
statements within this method. Open
return 'IBM273';
Avoid too many return
statements within this method. Open
return 'IBM274';
Avoid too many return
statements within this method. Open
return 'IBM275';
Avoid too many return
statements within this method. Open
return 'IBM775';
Avoid too many return
statements within this method. Open
return 'IBM862';
Avoid too many return
statements within this method. Open
return 'IBM904';
Avoid too many return
statements within this method. Open
return 'ISO-8859-1-Windows-3.0-Latin-1';
Avoid too many return
statements within this method. Open
return 'ISO-8859-5';
Avoid too many return
statements within this method. Open
return 'ISO-8859-6-E';
Avoid too many return
statements within this method. Open
return 'ISO-8859-16';
Avoid too many return
statements within this method. Open
return 'ISO-10646-UCS-Basic';
Avoid too many return
statements within this method. Open
return 'HP-Math8';
Avoid too many return
statements within this method. Open
return 'IBM-Symbols';
Avoid too many return
statements within this method. Open
return 'IBM-Thai';
Avoid too many return
statements within this method. Open
return 'IBM278';
Avoid too many return
statements within this method. Open
return 'IBM891';
Avoid too many return
statements within this method. Open
return 'IBM01142';
Avoid too many return
statements within this method. Open
return 'INIS';
Avoid too many return
statements within this method. Open
return 'INIS-cyrillic';
Avoid too many return
statements within this method. Open
return 'ISO-2022-CN-EXT';
Avoid too many return
statements within this method. Open
return 'ISO-8859-10';
Avoid too many return
statements within this method. Open
return 'ISO-8859-14';
Avoid too many return
statements within this method. Open
return 'ISO-8859-15';
Avoid too many return
statements within this method. Open
return 'EBCDIC-DK-NO-A';
Avoid too many return
statements within this method. Open
return 'EBCDIC-UK';
Avoid too many return
statements within this method. Open
return 'greek7-old';
Avoid too many return
statements within this method. Open
return 'IBM870';
Avoid too many return
statements within this method. Open
return 'IBM01145';
Avoid too many return
statements within this method. Open
return 'ISO-8859-8-E';
Avoid too many return
statements within this method. Open
return 'ISO-10646-J-1';
Avoid too many return
statements within this method. Open
return 'ISO_646.irv:1983';
Avoid too many return
statements within this method. Open
return 'BRF';
Avoid too many return
statements within this method. Open
return 'HP-DeskTop';
Avoid too many return
statements within this method. Open
return 'IBM423';
Avoid too many return
statements within this method. Open
return 'INIS-8';
Avoid too many return
statements within this method. Open
return 'ISO-8859-2';
Avoid too many return
statements within this method. Open
return 'ISO-Unicode-IBM-1276';
Avoid too many return
statements within this method. Open
return 'ES2';
Avoid too many return
statements within this method. Open
return 'GBK';
Avoid too many return
statements within this method. Open
return 'IBM037';
Avoid too many return
statements within this method. Open
return 'IBM038';
Avoid too many return
statements within this method. Open
return 'IBM285';
Avoid too many return
statements within this method. Open
return 'IBM860';
Avoid too many return
statements within this method. Open
return 'IBM861';
Avoid too many return
statements within this method. Open
return 'IBM869';
Avoid too many return
statements within this method. Open
return 'IBM01148';
Avoid too many return
statements within this method. Open
return 'ISO-2022-CN';
Avoid too many return
statements within this method. Open
return 'ISO-2022-JP-2';
Avoid too many return
statements within this method. Open
return 'ISO-8859-7';
Avoid too many return
statements within this method. Open
return 'ISO-8859-8';
Avoid too many return
statements within this method. Open
return 'BS_viewdata';
Avoid too many return
statements within this method. Open
return 'EBCDIC-IT';
Avoid too many return
statements within this method. Open
return 'IBM281';
Avoid too many return
statements within this method. Open
return 'IBM864';
Avoid too many return
statements within this method. Open
return 'IBM865';
Avoid too many return
statements within this method. Open
return 'IBM01141';
Avoid too many return
statements within this method. Open
return 'IBM01144';
Avoid too many return
statements within this method. Open
return 'ISO-2022-KR';
Avoid too many return
statements within this method. Open
return 'IBM420';
Avoid too many return
statements within this method. Open
return 'IBM918';
Avoid too many return
statements within this method. Open
return 'IBM01149';
Avoid too many return
statements within this method. Open
return 'ISO-8859-9-Windows-Latin-5';
Avoid too many return
statements within this method. Open
return 'ISO-8859-13';
Avoid too many return
statements within this method. Open
return 'ISO-Unicode-IBM-1264';
Avoid too many return
statements within this method. Open
return 'BS_4730';
Avoid too many return
statements within this method. Open
return 'CSA_Z243.4-1985-gr';
Avoid too many return
statements within this method. Open
return 'DS_2089';
Avoid too many return
statements within this method. Open
return 'EBCDIC-FI-SE';
Avoid too many return
statements within this method. Open
return 'EBCDIC-PT';
Avoid too many return
statements within this method. Open
return 'GOST_19768-74';
Avoid too many return
statements within this method. Open
return 'HP-Pi-font';
Avoid too many return
statements within this method. Open
return 'hp-roman8';
Avoid too many return
statements within this method. Open
return 'HZ-GB-2312';
Avoid too many return
statements within this method. Open
return 'IBM290';
Avoid too many return
statements within this method. Open
return 'IBM851';
Avoid too many return
statements within this method. Open
return 'IBM00858';
Avoid too many return
statements within this method. Open
return 'IBM868';
Avoid too many return
statements within this method. Open
return 'IBM905';
Avoid too many return
statements within this method. Open
return 'IBM1047';
Avoid too many return
statements within this method. Open
return 'ISO-2022-JP';
Avoid too many return
statements within this method. Open
return 'ISO-10646-Unicode-Latin1';
Avoid too many return
statements within this method. Open
return 'ISO_646.basic:1983';
Avoid too many return
statements within this method. Open
return 'ISO_5427:1981';
Avoid too many return
statements within this method. Open
return 'JIS_C6229-1984-hand';
Avoid too many return
statements within this method. Open
return 'MSZ_7795.3';
Avoid too many return
statements within this method. Open
return 'OSD_EBCDIC_DF04_1';
Avoid too many return
statements within this method. Open
return 'UNICODE-1-1';
Avoid too many return
statements within this method. Open
return 'UTF-32';
Avoid too many return
statements within this method. Open
return 'windows-949';
Avoid too many return
statements within this method. Open
return 'JIS_C6229-1984-hand-add';
Avoid too many return
statements within this method. Open
return 'KOI7-switched';
Avoid too many return
statements within this method. Open
return 'NATS-SEFI-ADD';
Avoid too many return
statements within this method. Open
return 'VISCII';
Avoid too many return
statements within this method. Open
return "\xEF\xBF\xBD";
Avoid too many return
statements within this method. Open
return 'ISO_6937-2-25';
Avoid too many return
statements within this method. Open
return 'NATS-DANO-ADD';
Avoid too many return
statements within this method. Open
return 'NC_NC00-10:81';
Avoid too many return
statements within this method. Open
return 'NF_Z_62-010_(1973)';
Avoid too many return
statements within this method. Open
return 'PC8-Turkish';
Avoid too many return
statements within this method. Open
return 'PTCP154';
Avoid too many return
statements within this method. Open
return 'us-dk';
Avoid too many return
statements within this method. Open
return 'UTF-16BE';
Avoid too many return
statements within this method. Open
return 'ISO_8859-supp';
Avoid too many return
statements within this method. Open
return 'JIS_C6229-1984-kana';
Avoid too many return
statements within this method. Open
return 'KOI8-R';
Avoid too many return
statements within this method. Open
return 'T.61-7bit';
Avoid too many return
statements within this method. Open
return 'Ventura-Math';
Avoid too many return
statements within this method. Open
return 'windows-1250';
Avoid too many return
statements within this method. Open
return 'windows-1256';
Avoid too many return
statements within this method. Open
return 'ISO_2033-1983';
Avoid too many return
statements within this method. Open
return 'IT';
Avoid too many return
statements within this method. Open
return 'JIS_C6229-1984-a';
Avoid too many return
statements within this method. Open
return 'ISO_10367-box';
Avoid too many return
statements within this method. Open
return 'JUS_I.B1.003-mac';
Avoid too many return
statements within this method. Open
return 'SCSU';
Avoid too many return
statements within this method. Open
return 'JIS_X0212-1990';
Avoid too many return
statements within this method. Open
return 'windows-874';
Avoid too many return
statements within this method. Open
return 'windows-1252';
Avoid too many return
statements within this method. Open
return 'JUS_I.B1.002';
Avoid too many return
statements within this method. Open
return 'Microsoft-Publishing';
Avoid too many return
statements within this method. Open
return 'PT';
Avoid too many return
statements within this method. Open
return SIMPLEPIE_CONSTRUCT_TEXT;
Avoid too many return
statements within this method. Open
return 'JIS_C6220-1969-jp';
Avoid too many return
statements within this method. Open
return 'JIS_C6226-1978';
Avoid too many return
statements within this method. Open
return 'KSC5636';
Avoid too many return
statements within this method. Open
return 'T.101-G2';
Avoid too many return
statements within this method. Open
return 'MNEM';
Avoid too many return
statements within this method. Open
return 'UTF-8';
Avoid too many return
statements within this method. Open
return 'UTF-7';
Avoid too many return
statements within this method. Open
return 'windows-1257';
Avoid too many return
statements within this method. Open
return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
Avoid too many return
statements within this method. Open
return 'windows-1251';
Avoid too many return
statements within this method. Open
return 'windows-1253';
Avoid too many return
statements within this method. Open
return 'windows-1255';
Avoid too many return
statements within this method. Open
return 'ISO_5427';
Avoid too many return
statements within this method. Open
return 'ISO_5428:1980';
Avoid too many return
statements within this method. Open
return 'JIS_C6220-1969-ro';
Avoid too many return
statements within this method. Open
return 'JIS_X0201';
Avoid too many return
statements within this method. Open
return 'SEN_850200_C';
Avoid too many return
statements within this method. Open
return 'Ventura-US';
Avoid too many return
statements within this method. Open
return 'windows-1254';
Avoid too many return
statements within this method. Open
return 'JIS_C6229-1984-b';
Avoid too many return
statements within this method. Open
return 'Latin-greek-1';
Avoid too many return
statements within this method. Open
return 'NS_4551-2';
Avoid too many return
statements within this method. Open
return 'TSCII';
Avoid too many return
statements within this method. Open
return 'UNICODE-1-1-UTF-7';
Avoid too many return
statements within this method. Open
return 'ISO_6937-2-add';
Avoid too many return
statements within this method. Open
return 'MNEMONIC';
Avoid too many return
statements within this method. Open
return 'NF_Z_62-010';
Avoid too many return
statements within this method. Open
return 'OSD_EBCDIC_DF03_IRV';
Avoid too many return
statements within this method. Open
return 'latin-lap';
Avoid too many return
statements within this method. Open
return 'NATS-DANO';
Avoid too many return
statements within this method. Open
return 'SEN_850200_B';
Avoid too many return
statements within this method. Open
return 'UTF-16LE';
Avoid too many return
statements within this method. Open
return 'Ventura-International';
Avoid too many return
statements within this method. Open
return 'VIQR';
Avoid too many return
statements within this method. Open
return $charset;
Avoid too many return
statements within this method. Open
return SIMPLEPIE_CONSTRUCT_TEXT;
Avoid too many return
statements within this method. Open
return SIMPLEPIE_CONSTRUCT_BASE64;
Avoid too many return
statements within this method. Open
return 'PC8-Danish-Norwegian';
Avoid too many return
statements within this method. Open
return 'T.61-8bit';
Avoid too many return
statements within this method. Open
return 'UNKNOWN-8BIT';
Avoid too many return
statements within this method. Open
return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
Avoid too many return
statements within this method. Open
return 'JUS_I.B1.003-serb';
Avoid too many return
statements within this method. Open
return 'latin-greek';
Avoid too many return
statements within this method. Open
return 'NS_4551-1';
Avoid too many return
statements within this method. Open
return 'UTF-32BE';
Avoid too many return
statements within this method. Open
return 'windows-1258';
Avoid too many return
statements within this method. Open
return 'JIS_C6226-1983';
Avoid too many return
statements within this method. Open
return 'KZ-1048';
Avoid too many return
statements within this method. Open
return 'NATS-SEFI';
Avoid too many return
statements within this method. Open
return 'OSD_EBCDIC_DF04_15';
Avoid too many return
statements within this method. Open
return 'US-ASCII';
Avoid too many return
statements within this method. Open
return 'UTF-32LE';
Avoid too many return
statements within this method. Open
return 'videotex-suppl';
Avoid too many return
statements within this method. Open
return 'Windows-31J';
Avoid too many return
statements within this method. Open
return 'JIS_C6229-1984-b-add';
Avoid too many return
statements within this method. Open
return 'JIS_Encoding';
Avoid too many return
statements within this method. Open
return 'KOI8-U';
Avoid too many return
statements within this method. Open
return 'macintosh';
Avoid too many return
statements within this method. Open
return 'PT2';
Avoid too many return
statements within this method. Open
return 'UTF-16';
Function fix_protocol
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function fix_protocol($url, $http = 1)
{
$url = SimplePie_Misc::normalize_url($url);
$parsed = SimplePie_Misc::parse_url($url);
if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https')
- 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 atom_10_content_construct_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function atom_10_content_construct_type($attribs)
{
if (isset($attribs['']['type']))
{
$type = strtolower(trim($attribs['']['type']));
- 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
Similar blocks of code found in 4 locations. Consider refactoring. Open
elseif (substr($data, 0, 20) === "\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C\x00\x00\x00")
{
if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00"))
{
$parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8')));
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 118.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
elseif (substr($data, 0, 10) === "\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C\x00")
{
if ($pos = strpos($data, "\x3F\x00\x3E\x00"))
{
$parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8')));
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 118.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
elseif (substr($data, 0, 20) === "\x00\x00\x00\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C")
{
if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E"))
{
$parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8')));
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 118.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
elseif (substr($data, 0, 10) === "\x00\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C")
{
if ($pos = strpos($data, "\x00\x3F\x00\x3E"))
{
$parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8')));
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 118.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($string[$pos - 1] !== '\\')
{
$depth++;
while ($depth && $position < $length)
{
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 108.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76