CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

    function wp_getTaxonomies( $args ) {
        if ( ! $this->minimum_args( $args, 3 ) )
            return $this->error;

        $this->escape( $args );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 ($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

                                    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 (!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

                                            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

                                          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

                                if ( $paged > 1 && !is_single() ) {
                                    $addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit("page/$paged", 'paged');
                                } elseif ( !is_single() ) {
                                    $addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit($paged_redirect['path'], 'paged');
                                }
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/canonical.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if ($framecounter == 0) {
                                          $info['error'][] = 'Corrupt MP3 file: framecounter == zero';
                                          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 (!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 ($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

                                                      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

                                                        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

                          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

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

                              public function register_controls() {
                          
                                  /* Site Title & Tagline */
                          
                                  $this->add_section( 'title_tagline', array(
                          Severity: Minor
                          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-manager.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

                                                  for ($current_segment = 0; $current_segment < $max_scan_segments; $current_segment++) {
                                                      $frames_scanned_this_segment = 0;
                                                      if (ftell($this->getid3->fp) >= $info['avdataend']) {
                                                          break;
                                                      }
                          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 ($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

                              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

                                                                while ($this->getEBMLelement($subelement, $element_data['end'])) {
                                                                    switch ($subelement['id']) {
                                
                                                                        case EBML_ID_CUEPOINT:
                                                                            $cuepoint_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

                                                                  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