CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Avoid deeply nested control flow statements.
Open

                                    if (preg_match('/^[0-9\x00]+$/', $value)) {
                                        $thisfile_asf_comments['track'][$key] = intval(str_replace("\x00", '', $value));
                                    }
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    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));
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.flv.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  switch ($PictureSizeType) {
                                      case 0:
                                          //$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2));
                                          //$PictureSizeEnc <<= 1;
                                          //$info['video']['resolution_x'] = ($PictureSizeEnc & 0xFF00) >> 8;
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.flv.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                        switch ($ExplodedOptions[1]) {
                                            case 'fast':
                                            case 'portable':
                                            case 'medium':
                                            case 'standard':
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if ($SynchErrorsFound > 0) {
                                      $info['warning'][] = 'Found '.$SynchErrorsFound.' synch errors in histogram analysis';
                                      //return false;
                                  }
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                            if (!self::$hide_clusters) {
                                                $info['matroska']['cluster'][] = $cluster_entry;
                                            }
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.matroska.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if (empty($thisfile_asf_comments['track'])) {
                                                  $thisfile_asf_comments['track'] = array(1 + $this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
                                              }
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                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']);
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                      if ($info['mime_type'] == 'video/x-ms-asf') {
                                                          $info['mime_type'] = 'audio/x-ms-wma';
                                                      }
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    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']));
                                                            }
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php - About 45 mins to fix

                      Function query has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function query() {
                              $args = func_get_args();
                              $method = array_shift($args);
                              $request = new IXR_Request($method, $args);
                              $xml = $request->getXml();
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-http-ixr-client.php - About 45 mins to fix

                      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 (!empty($getid3_temp->info['warning'])) {
                                                                  foreach ($getid3_temp->info['warning'] as $newerror) {
                                                                      $this->warning('getid3_ac3() says: ['.$newerror.']');
                                                                  }
                                                              }
                      Severity: Major
                      Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        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);
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          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;
                          Severity: Major
                          Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

                            Function getFileSizeSyscall has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            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:
                            Severity: Minor
                            Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 45 mins to fix

                            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

                                                            switch ($sourcekey) {
                                                                case 'width':
                                                                case 'height':
                                                                    $info['video'][$destkey] = intval(round($info['flv']['meta']['onMetaData'][$sourcekey]));
                                                                    break;
                            Severity: Major
                            Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.flv.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              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:
                              Severity: Major
                              Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.matroska.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                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'];
                                                                }
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  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;
                                                                  }
                                  Severity: Major
                                  Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.matroska.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                    if (!isset($thisfile_audio['channels'])) {
                                                                        if (strstr($AudioCodecChannels, 'stereo')) {
                                                                            $thisfile_audio['channels'] = 2;
                                                                        } elseif (strstr($AudioCodecChannels, 'mono')) {
                                                                            $thisfile_audio['channels'] = 1;
                                    Severity: Major
                                    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language