Showing 5,566 of 7,504 total issues
Function wp_getTaxonomies
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function wp_getTaxonomies( $args ) {
if ( ! $this->minimum_args( $args, 3 ) )
return $this->error;
$this->escape( $args );
- 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 ($this->IsValidID3v2FrameName($nextFrameID, $id3v2_majorversion)) {
// next frame is OK
} elseif (($frame_name == "\x00".'MP3') || ($frame_name == "\x00\x00".'MP') || ($frame_name == ' MP3') || ($frame_name == 'MP3e')) {
// MP3ext known broken frames - "ok" for the purposes of this test
} elseif (($id3v2_majorversion == 4) && ($this->IsValidID3v2FrameName(substr($framedata, getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0), 4), 3))) {
Avoid deeply nested control flow statements. Open
while ($this->getEBMLelement($subelement, $element_data['end'])) {
switch ($subelement['id']) {
case EBML_ID_EDITIONENTRY:
$editionentry_entry = array();
Avoid deeply nested control flow statements. Open
if (!isset($MPEGaudioHeaderValidCache[$next4])) {
$MPEGaudioHeaderValidCache[$next4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$next4], false, false);
}
Avoid deeply nested control flow statements. Open
if (isset($getid3_temp->info['audio']) && is_array($getid3_temp->info['audio'])) {
foreach ($getid3_temp->info['audio'] as $key => $value) {
$track_info[$key] = $value;
}
}
Avoid deeply nested control flow statements. Open
while ($this->getEBMLelement($seek_entry, $element_data['end'])) {
switch ($seek_entry['id']) {
case EBML_ID_SEEK: // Contains a single seek entry to an EBML element
while ($this->getEBMLelement($sub_seek_entry, $seek_entry['end'], true)) {
Avoid deeply nested control flow statements. Open
if ( $paged > 1 && !is_single() ) {
$addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit("page/$paged", 'paged');
} elseif ( !is_single() ) {
$addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit($paged_redirect['path'], 'paged');
}
Avoid deeply nested control flow statements. Open
if ($framecounter == 0) {
$info['error'][] = 'Corrupt MP3 file: framecounter == zero';
return false;
}
Avoid deeply nested control flow statements. Open
if (!isset($thisfile_audio['bitrate']) && strstr($AudioCodecBitrate, 'kbps')) {
$thisfile_audio['bitrate'] = (int) (trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000);
}
Avoid deeply nested control flow statements. Open
if (!isset($MPEGaudioHeaderDecodeCache[$next4])) {
$MPEGaudioHeaderDecodeCache[$next4] = self::MPEGaudioHeaderDecode($next4);
}
Avoid deeply nested control flow statements. Open
if ($info['mpeg']['audio']['layer'] == 3) {
$info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0);
} elseif ($info['mpeg']['audio']['layer'] == 2) {
$info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0, 384000=>0);
} elseif ($info['mpeg']['audio']['layer'] == 1) {
Avoid deeply nested control flow statements. Open
if (!self::$parse_whole_file) {
if (isset($info['matroska']['info']) && is_array($info['matroska']['info'])) {
if (isset($info['matroska']['tracks']['tracks']) && is_array($info['matroska']['tracks']['tracks'])) {
if (count($info['matroska']['track_data_offsets']) == count($info['matroska']['tracks']['tracks'])) {
return;
Avoid deeply nested control flow statements. Open
switch ($AudioCodecFrequency) {
case 8:
case 8000:
$thisfile_audio['sample_rate'] = 8000;
break;
Function parseSTREAMINFO
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function parseSTREAMINFO($BlockData) {
$info = &$this->getid3->info;
$info['flac']['STREAMINFO'] = array();
$streaminfo = &$info['flac']['STREAMINFO'];
- 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 register_controls
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function register_controls() {
/* Site Title & Tagline */
$this->add_section( 'title_tagline', 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
Avoid deeply nested control flow statements. Open
for ($current_segment = 0; $current_segment < $max_scan_segments; $current_segment++) {
$frames_scanned_this_segment = 0;
if (ftell($this->getid3->fp) >= $info['avdataend']) {
break;
}
Avoid deeply nested control flow statements. Open
if ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']) {
$thisfile_audio['bitrate_mode'] = 'vbr';
$thisfile_video['bitrate_mode'] = 'vbr';
}
Avoid deeply nested control flow statements. Open
if ($bitrate_count > 0) {
$distinct_bitrates++;
}
Avoid deeply nested control flow statements. Open
while ($this->getEBMLelement($subelement, $element_data['end'])) {
switch ($subelement['id']) {
case EBML_ID_CUEPOINT:
$cuepoint_entry = array();
Avoid deeply nested control flow statements. Open
while ($this->getEBMLelement($subelement, $element_data['end'], false)) {
switch ($subelement['id']) {
case EBML_ID_TAG:
$tag_entry = array();