CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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;
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 ($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

                                if ($framedata{$i} != "\x00") {
                                    $thisfile_id3v2['padding']['valid'] = false;
                                    $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i;
                                    $info['warning'][] = 'Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)';
                                    break;
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.tag.id3v2.php - About 45 mins to fix

          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))) {
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.tag.id3v2.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if ($MPEGaudioHeaderValidCache[$next4]) {
                                        fseek($this->getid3->fp, -4, SEEK_CUR);
            
                                        getid3_lib::safe_inc($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]);
                                        getid3_lib::safe_inc($Distribution['layer'][$LongMPEGlayerLookup[$head4]]);
            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 ($pct_data_scanned > 0) {
                                          $info['warning'][] = 'too many MPEG audio frames to scan, only scanned '.$frames_scanned.' frames in '.$max_scan_segments.' segments ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.';
                                          foreach ($info['mpeg']['audio'] as $key1 => $value1) {
                                              if (!preg_match('#_distribution$#i', $key1)) {
                                                  continue;
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

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

                    private static function EBML2Int($EBMLstring) {
                        // http://matroska.org/specs/
                
                        // Element ID coded with an UTF-8 like system:
                        // 1xxx xxxx                                  - Class A IDs (2^7 -2 possible values) (base 0x8X)
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.matroska.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 ($AudioCodecFrequency) {
                                                    case 8:
                                                    case 8000:
                                                        $thisfile_audio['sample_rate'] = 8000;
                                                        break;
                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

                                          for ($j = 0; $j < $size; $j++) {
                                              if ($nextScale != 0) {
                                                  $deltaScale = $this->expGolombUe();
                                                  $nextScale = ($lastScale + $deltaScale + 256) % 256;
                                              }
                  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

                                            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

                      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 (!isset($thisfile_audio['bitrate']) && strstr($AudioCodecBitrate, 'kbps')) {
                                                            $thisfile_audio['bitrate'] = (int) (trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000);
                                                        }
                        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 (!isset($MPEGaudioHeaderDecodeCache[$next4])) {
                                                      $MPEGaudioHeaderDecodeCache[$next4] = self::MPEGaudioHeaderDecode($next4);
                                                  }
                          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 ($bitrate_count > 0) {
                                                            $distinct_bitrates++;
                                                        }
                            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) { // 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

                                                                while ($this->getEBMLelement($subelement, $element_data['end'])) {
                                                                    switch ($subelement['id']) {
                                
                                                                        case EBML_ID_EDITIONENTRY:
                                                                            $editionentry_entry = array();
                                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 ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']) {
                                                                      $thisfile_audio['bitrate_mode'] = 'vbr';
                                                                      $thisfile_video['bitrate_mode'] = 'vbr';
                                                                  }
                                  Severity: Major
                                  Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.asf.php - About 45 mins to fix

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

                                        public static function iconv_fallback($in_charset, $out_charset, $string) {
                                    
                                            if ($in_charset == $out_charset) {
                                                return $string;
                                            }
                                    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

                                                                    while ($this->getEBMLelement($subelement, $element_data['end'], false)) {
                                                                        switch ($subelement['id']) {
                                    
                                                                            case EBML_ID_TAG:
                                                                                $tag_entry = array();
                                    Severity: Major
                                    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio-video.matroska.php - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language