CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Avoid deeply nested control flow statements.
Open

                        if (!isset($MPEGaudioHeaderValidCache[$next4])) {
                            $MPEGaudioHeaderValidCache[$next4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$next4], false, 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

                                    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)) {
    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'], true)) {
                                          switch ($subelement['id']) {
      
                                              case EBML_ID_TIMECODESCALE:
                                                  $info_entry[$subelement['id_name']] = getid3_lib::BigEndian2Int($subelement['data']);
      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($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 (!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

            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 ($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) {
              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

                                                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

                                                      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 (isset($getid3_temp->info['audio']) && is_array($getid3_temp->info['audio'])) {
                                                            foreach ($getid3_temp->info['audio'] as $key => $value) {
                                                                $track_info[$key] = $value;
                                                            }
                                                        }
                    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

                                                        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 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'];
                          Severity: Minor
                          Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.flac.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

                          Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false)
                          Severity: Minor
                          Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/File.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
                                                            {
                                                                if ($cache->save(array('headers' => $file->headers, 'body' => $file->body)))
                                                                {
                                                                    $img->setAttribute('src', $this->image_handler . $image_url);
                            Severity: Major
                            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Sanitize.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                              if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($atom_structure['sample_description_table'][$i]['height'])) {
                                  // assume that values stored here are more important than values stored in [tkhd] atom
                                  $info['video']['resolution_x'] = $atom_structure['sample_description_table'][$i]['width'];
                                  $info['video']['resolution_y'] = $atom_structure['sample_description_table'][$i]['height'];
                                  $info['quicktime']['video']['resolution_x'] = $info['video']['resolution_x'];

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

                                function wp_update_post($postarr = array()) {
                                    if ( is_object($postarr) ) {
                                        // non-escaped post was passed
                                        $postarr = get_object_vars($postarr);
                                        $postarr = add_magic_quotes($postarr);
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/post.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 (isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) {
                                
                                                                $thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'];
                                                                if (self::fourccLookup($thisfile_video['fourcc'])) {
                                                                    $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_video['fourcc']);
                                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 (empty($getid3_temp->info['error'])) {
                                                                              $info['audio'] = $getid3_temp->info['audio'];
                                                                              $info['mpeg']  = $getid3_temp->info['mpeg'];
                                                                          }
                                  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

                                                                                switch ($atomname) {
                                                                                    case 'cpil':
                                                                                    case 'pcst':
                                                                                    case 'pgap':
                                                                                        $atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language