Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php
Function Analyze
has a Cognitive Complexity of 288 (exceeds 5 allowed). Consider refactoring. Open
Open
public function Analyze() {
$info = &$this->getid3->info;
// Shortcuts
$thisfile_audio = &$info['audio'];
- 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 Analyze
has 917 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function Analyze() {
$info = &$this->getid3->info;
// Shortcuts
$thisfile_audio = &$info['audio'];
File module.audio-video.asf.php
has 1378 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
Method ASF_HeaderExtensionObjectDataParse
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ASF_HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) {
// http://msdn.microsoft.com/en-us/library/bb643323.aspx
$offset = 0;
$objectOffset = 0;
Function ASF_HeaderExtensionObjectDataParse
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
Open
public function ASF_HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) {
// http://msdn.microsoft.com/en-us/library/bb643323.aspx
$offset = 0;
$objectOffset = 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
Method KnownGUIDs
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function KnownGUIDs() {
static $GUIDarray = array(
'GETID3_ASF_Extended_Stream_Properties_Object' => '14E6A5CB-C672-4332-8399-A96952065B5A',
'GETID3_ASF_Padding_Object' => '1806D474-CADF-4509-A4BA-9AABCB96AAE8',
'GETID3_ASF_Payload_Ext_Syst_Pixel_Aspect_Ratio' => '1B1EE554-F9EA-4BC8-821A-376B74E4C4B8',
Method ASF_WMpicture
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ASF_WMpicture(&$data) {
//typedef struct _WMPicture{
// LPWSTR pwszMIMEType;
// BYTE bPictureType;
// LPWSTR pwszDescription;
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
switch ($AudioCodecFrequency) {
case 8:
case 8000:
$thisfile_audio['sample_rate'] = 8000;
break;
Avoid deeply nested control flow statements. Open
Open
if ($info['mime_type'] == 'video/x-ms-asf') {
$info['mime_type'] = 'video/x-ms-wmv';
}
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 (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 ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']) {
$thisfile_audio['bitrate_mode'] = 'vbr';
$thisfile_video['bitrate_mode'] = 'vbr';
}
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 (!isset($thisfile_audio['bitrate']) && strstr($AudioCodecBitrate, 'kbps')) {
$thisfile_audio['bitrate'] = (int) (trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000);
}
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']));
}
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;