Showing 5,566 of 7,504 total issues
Avoid deeply nested control flow statements. Open
Open
if (preg_match('/^[0-9\x00]+$/', $value)) {
$thisfile_asf_comments['track'][$key] = intval(str_replace("\x00", '', $value));
}
Avoid deeply nested control flow statements. Open
Open
if ($AVCPacketType == H264_AVC_SEQUENCE_HEADER) {
// read AVCDecoderConfigurationRecord
$configurationVersion = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 1));
$AVCProfileIndication = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 1));
$profile_compatibility = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 1));
Avoid deeply nested control flow statements. Open
Open
switch ($PictureSizeType) {
case 0:
//$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2));
//$PictureSizeEnc <<= 1;
//$info['video']['resolution_x'] = ($PictureSizeEnc & 0xFF00) >> 8;
Avoid deeply nested control flow statements. Open
Open
switch ($ExplodedOptions[1]) {
case 'fast':
case 'portable':
case 'medium':
case 'standard':
Avoid deeply nested control flow statements. Open
Open
if ($SynchErrorsFound > 0) {
$info['warning'][] = 'Found '.$SynchErrorsFound.' synch errors in histogram analysis';
//return false;
}
Avoid deeply nested control flow statements. Open
Open
if (!self::$hide_clusters) {
$info['matroska']['cluster'][] = $cluster_entry;
}
Avoid deeply nested control flow statements. Open
Open
if (empty($thisfile_asf_comments['track'])) {
$thisfile_asf_comments['track'] = array(1 + $this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
}
Avoid deeply nested control flow statements. Open
Open
if (class_exists('getid3_id3v2')) {
$tempfile = tempnam(GETID3_TEMP_DIR, 'getID3');
$tempfilehandle = fopen($tempfile, 'wb');
$tempThisfileInfo = array('encoding'=>$info['encoding']);
fwrite($tempfilehandle, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
Avoid deeply nested control flow statements. Open
Open
if ($info['mime_type'] == 'video/x-ms-asf') {
$info['mime_type'] = 'audio/x-ms-wma';
}
Avoid deeply nested control flow statements. Open
Open
switch ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']) {
case 0: // Unicode string
if (substr($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']), 0, 3) == 'WM/') {
$thisfile_asf_comments[str_replace('wm/', '', strtolower($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name'])))] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
}
Function query
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function query() {
$args = func_get_args();
$method = array_shift($args);
$request = new IXR_Request($method, $args);
$xml = $request->getXml();
- 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
Open
if (!empty($getid3_temp->info['warning'])) {
foreach ($getid3_temp->info['warning'] as $newerror) {
$this->warning('getid3_ac3() says: ['.$newerror.']');
}
}
Avoid deeply nested control flow statements. Open
Open
if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', $FirstFourBytes)) {
// MP3
if (getid3_mp3::MPEGaudioHeaderBytesValid($FirstFourBytes)) {
$getid3_temp = new getID3();
$getid3_temp->openfile($this->getid3->filename);
Avoid deeply nested control flow statements. Open
Open
if (!(abs($info['audio']['bitrate'] - $FirstFrameThisfileInfo['audio']['bitrate']) <= 1)) {
// If there is garbage data between a valid VBR header frame and a sequence
// of valid MPEG-audio frames the VBR data is no longer discarded.
$info = $FirstFrameThisfileInfo;
$info['avdataoffset'] = $FirstFrameAVDataOffset;
Function getFileSizeSyscall
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function getFileSizeSyscall($path) {
$filesize = false;
if (GETID3_OS_ISWINDOWS) {
if (class_exists('COM')) { // From PHP 5.3.15 and 5.4.5, COM and DOTNET is no longer built into the php core.you have to add COM support in php.ini:
- 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
Open
switch ($sourcekey) {
case 'width':
case 'height':
$info['video'][$destkey] = intval(round($info['flv']['meta']['onMetaData'][$sourcekey]));
break;
Avoid deeply nested control flow statements. Open
Open
while ($this->getEBMLelement($subelement, $element_data['end'], array(EBML_ID_CLUSTERSILENTTRACKS, EBML_ID_CLUSTERBLOCKGROUP, EBML_ID_CLUSTERSIMPLEBLOCK))) {
switch ($subelement['id']) {
case EBML_ID_CLUSTERTIMECODE:
case EBML_ID_CLUSTERPOSITION:
Avoid deeply nested control flow statements. Open
Open
if (empty($thisfile_video['bitrate']) && !empty($thisfile_audio['bitrate']) && !empty($info['bitrate'])) {
//$thisfile_video['bitrate'] = $thisfile_asf['file_properties_object']['max_bitrate'] - $thisfile_audio['bitrate'];
$thisfile_video['bitrate'] = $info['bitrate'] - $thisfile_audio['bitrate'];
}
Avoid deeply nested control flow statements. Open
Open
if (self::$hide_clusters) { // do not parse cues if hide clusters is "ON" till they point to clusters anyway
$this->current_offset = $element_data['end'];
break;
}
Avoid deeply nested control flow statements. Open
Open
if (!isset($thisfile_audio['channels'])) {
if (strstr($AudioCodecChannels, 'stereo')) {
$thisfile_audio['channels'] = 2;
} elseif (strstr($AudioCodecChannels, 'mono')) {
$thisfile_audio['channels'] = 1;