WordPress/WordPress

View on GitHub
wp-includes/ID3/module.audio.mp3.php

Summary

Maintainability
F
1 mo
Test Coverage

Function getOnlyMPEGaudioInfo has a Cognitive Complexity of 260 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOnlyMPEGaudioInfo($avdataoffset, $BitrateHistogram=false) {
        // looks for synch, decodes MPEG audio header

        $info = &$this->getid3->info;

Severity: Minor
Found in wp-includes/ID3/module.audio.mp3.php - About 5 days 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 decodeMPEGaudioHeader has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring.
Open

    public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $ScanAsCBR=false, $FastMPEGheaderScan=false) {
        static $MPEGaudioVersionLookup;
        static $MPEGaudioLayerLookup;
        static $MPEGaudioBitrateLookup;
        static $MPEGaudioFrequencyLookup;
Severity: Minor
Found in wp-includes/ID3/module.audio.mp3.php - About 4 days 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

File module.audio.mp3.php has 1494 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org>               //
//  available at https://github.com/JamesHeinrich/getID3       //
Severity: Major
Found in wp-includes/ID3/module.audio.mp3.php - About 3 days to fix

    Method decodeMPEGaudioHeader has 388 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $ScanAsCBR=false, $FastMPEGheaderScan=false) {
            static $MPEGaudioVersionLookup;
            static $MPEGaudioLayerLookup;
            static $MPEGaudioBitrateLookup;
            static $MPEGaudioFrequencyLookup;
    Severity: Major
    Found in wp-includes/ID3/module.audio.mp3.php - About 1 day to fix

      Function getOnlyMPEGaudioInfoBruteForce has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getOnlyMPEGaudioInfoBruteForce() {
              $MPEGaudioHeaderDecodeCache   = array();
              $MPEGaudioHeaderValidCache    = array();
              $MPEGaudioHeaderLengthCache   = array();
              $MPEGaudioVersionLookup       = self::MPEGaudioVersionArray();
      Severity: Minor
      Found in wp-includes/ID3/module.audio.mp3.php - About 1 day 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 getOnlyMPEGaudioInfo has 244 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getOnlyMPEGaudioInfo($avdataoffset, $BitrateHistogram=false) {
              // looks for synch, decodes MPEG audio header
      
              $info = &$this->getid3->info;
      
      
      Severity: Major
      Found in wp-includes/ID3/module.audio.mp3.php - About 1 day to fix

        Function Analyze has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
        Open

            public function Analyze() {
                $info = &$this->getid3->info;
        
                $initialOffset = $info['avdataoffset'];
        
        
        Severity: Minor
        Found in wp-includes/ID3/module.audio.mp3.php - About 1 day 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 GuessEncoderOptions has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
        Open

            public function GuessEncoderOptions() {
                // shortcuts
                $info = &$this->getid3->info;
                $thisfile_mpeg_audio = array();
                $thisfile_mpeg_audio_lame = array();
        Severity: Minor
        Found in wp-includes/ID3/module.audio.mp3.php - About 1 day 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 GuessEncoderOptions has 205 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function GuessEncoderOptions() {
                // shortcuts
                $info = &$this->getid3->info;
                $thisfile_mpeg_audio = array();
                $thisfile_mpeg_audio_lame = array();
        Severity: Major
        Found in wp-includes/ID3/module.audio.mp3.php - About 1 day to fix

          Method getOnlyMPEGaudioInfoBruteForce has 135 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getOnlyMPEGaudioInfoBruteForce() {
                  $MPEGaudioHeaderDecodeCache   = array();
                  $MPEGaudioHeaderValidCache    = array();
                  $MPEGaudioHeaderLengthCache   = array();
                  $MPEGaudioVersionLookup       = self::MPEGaudioVersionArray();
          Severity: Major
          Found in wp-includes/ID3/module.audio.mp3.php - About 5 hrs to fix

            Method Analyze has 105 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function Analyze() {
                    $info = &$this->getid3->info;
            
                    $initialOffset = $info['avdataoffset'];
            
            
            Severity: Major
            Found in wp-includes/ID3/module.audio.mp3.php - About 4 hrs to fix

              Function MPEGaudioFrameLength has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function MPEGaudioFrameLength(&$bitrate, &$version, &$layer, $padding, &$samplerate) {
                      static $AudioFrameLengthCache = array();
              
                      if (!isset($AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate])) {
                          $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = false;
              Severity: Minor
              Found in wp-includes/ID3/module.audio.mp3.php - About 3 hrs 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 FreeFormatFrameLength has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function FreeFormatFrameLength($offset, $deepscan=false) {
                      $info = &$this->getid3->info;
              
                      $this->fseek($offset);
                      $MPEGaudioData = $this->fread(32768);
              Severity: Minor
              Found in wp-includes/ID3/module.audio.mp3.php - About 3 hrs 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

              getid3_mp3 has 25 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class getid3_mp3 extends getid3_handler
              {
                  /**
                   * Forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow,
                   * unrecommended, but may provide data from otherwise-unusable files.
              Severity: Minor
              Found in wp-includes/ID3/module.audio.mp3.php - About 2 hrs to fix

                Function RecursiveFrameScanning has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function RecursiveFrameScanning(&$offset, &$nextframetestoffset, $ScanAsCBR) {
                        $info = &$this->getid3->info;
                        $firstframetestarray = array('error' => array(), 'warning'=> array(), 'avdataend' => $info['avdataend'], 'avdataoffset' => $info['avdataoffset']);
                        $this->decodeMPEGaudioHeader($offset, $firstframetestarray, false);
                
                
                Severity: Minor
                Found in wp-includes/ID3/module.audio.mp3.php - About 2 hrs 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 FreeFormatFrameLength has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function FreeFormatFrameLength($offset, $deepscan=false) {
                        $info = &$this->getid3->info;
                
                        $this->fseek($offset);
                        $MPEGaudioData = $this->fread(32768);
                Severity: Major
                Found in wp-includes/ID3/module.audio.mp3.php - About 2 hrs to fix

                  Function MPEGaudioHeaderValid has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function MPEGaudioHeaderValid($rawarray, $echoerrors=false, $allowBitrate15=false) {
                          if (!isset($rawarray['synch']) || ($rawarray['synch'] & 0x0FFE) != 0x0FFE) {
                              return false;
                          }
                  
                  
                  Severity: Minor
                  Found in wp-includes/ID3/module.audio.mp3.php - About 2 hrs 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 MPEGaudioHeaderValid has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function MPEGaudioHeaderValid($rawarray, $echoerrors=false, $allowBitrate15=false) {
                          if (!isset($rawarray['synch']) || ($rawarray['synch'] & 0x0FFE) != 0x0FFE) {
                              return false;
                          }
                  
                  
                  Severity: Major
                  Found in wp-includes/ID3/module.audio.mp3.php - About 2 hrs to fix

                    Method LAMEpresetUsedLookup has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function LAMEpresetUsedLookup($LAMEtag) {
                    
                            if ($LAMEtag['preset_used_id'] == 0) {
                                // no preset used (LAME >=3.93)
                                // no preset recorded (LAME <3.93)
                    Severity: Minor
                    Found in wp-includes/ID3/module.audio.mp3.php - About 1 hr to fix

                      Function ClosestStandardMP3Bitrate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function ClosestStandardMP3Bitrate($bit_rate) {
                              static $standard_bit_rates = array (320000, 256000, 224000, 192000, 160000, 128000, 112000, 96000, 80000, 64000, 56000, 48000, 40000, 32000, 24000, 16000, 8000);
                              static $bit_rate_table = array (0=>'-');
                              $round_bit_rate = intval(round($bit_rate, -3));
                              if (!isset($bit_rate_table[$round_bit_rate])) {
                      Severity: Minor
                      Found in wp-includes/ID3/module.audio.mp3.php - About 1 hr 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 MPEGaudioFrameLength has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function MPEGaudioFrameLength(&$bitrate, &$version, &$layer, $padding, &$samplerate) {
                              static $AudioFrameLengthCache = array();
                      
                              if (!isset($AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate])) {
                                  $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = false;
                      Severity: Minor
                      Found in wp-includes/ID3/module.audio.mp3.php - About 1 hr to fix

                        Method RecursiveFrameScanning has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function RecursiveFrameScanning(&$offset, &$nextframetestoffset, $ScanAsCBR) {
                                $info = &$this->getid3->info;
                                $firstframetestarray = array('error' => array(), 'warning'=> array(), 'avdataend' => $info['avdataend'], 'avdataoffset' => $info['avdataoffset']);
                                $this->decodeMPEGaudioHeader($offset, $firstframetestarray, false);
                        
                        
                        Severity: Minor
                        Found in wp-includes/ID3/module.audio.mp3.php - About 1 hr to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if (!empty($info['audio']['encoder']) && !empty($info['mpeg']['audio']['LAME']['short_version']) && ($info['audio']['encoder'] == $info['mpeg']['audio']['LAME']['short_version'])) {
                                                      if (preg_match('#^LAME[0-9\\.]+#', $PossiblyLongerLAMEversion_NewString, $matches)) {
                                                          // "LAME3.100" -> "LAME3.100.1", but avoid including "(alpha)" and similar
                                                          $info['mpeg']['audio']['LAME']['short_version'] = $matches[0];
                                                      }
                          Severity: Major
                          Found in wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    for ($current_segment = 0; $current_segment < $max_scan_segments; $current_segment++) {
                                                        $frames_scanned_this_segment = 0;
                                                        $scan_start_offset = array();
                                                        if ($this->ftell() >= $info['avdataend']) {
                                                            break;
                            Severity: Major
                            Found in wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ($MPEGaudioHeaderValidCache[$next4]) {
                                                          $this->fseek(-4, SEEK_CUR);
                              
                                                          $Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] = isset($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]) ? ++$Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] : 1;
                                                          $Distribution['layer'][$LongMPEGlayerLookup[$head4]] = isset($Distribution['layer'][$LongMPEGlayerLookup[$head4]]) ? ++$Distribution['layer'][$LongMPEGlayerLookup[$head4]] : 1;
                              Severity: Major
                              Found in 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 wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if ($framecounter == 0) {
                                                              $this->error('Corrupt MP3 file: framecounter == zero');
                                                              return false;
                                                          }
                                  Severity: Major
                                  Found in wp-includes/ID3/module.audio.mp3.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 wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                  if ($bitratevalue != 'free') {
                                                                      $bittotal += ($bitratevalue * $bitratecount);
                                                                  }
                                      Severity: Major
                                      Found in wp-includes/ID3/module.audio.mp3.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 wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if ($SynchErrorsFound > 0) {
                                                                      $this->warning('Found '.$SynchErrorsFound.' synch errors in histogram analysis');
                                                                      //return false;
                                                                  }
                                          Severity: Major
                                          Found in wp-includes/ID3/module.audio.mp3.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 wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      if ($pct_data_scanned > 0) {
                                                                          $this->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 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 wp-includes/ID3/module.audio.mp3.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 wp-includes/ID3/module.audio.mp3.php - About 45 mins to fix

                                                    Method decodeMPEGaudioHeader has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                        public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $ScanAsCBR=false, $FastMPEGheaderScan=false) {
                                                    Severity: Minor
                                                    Found in wp-includes/ID3/module.audio.mp3.php - About 35 mins to fix

                                                      Method MPEGaudioFrameLength has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                          public static function MPEGaudioFrameLength(&$bitrate, &$version, &$layer, $padding, &$samplerate) {
                                                      Severity: Minor
                                                      Found in wp-includes/ID3/module.audio.mp3.php - About 35 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                        return false;
                                                        Severity: Major
                                                        Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                      return false;
                                                          Severity: Major
                                                          Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                    return true;
                                                            Severity: Major
                                                            Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                          return false;
                                                              Severity: Major
                                                              Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                            return false;
                                                                Severity: Major
                                                                Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                                  return false;
                                                                  Severity: Major
                                                                  Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                        return false;
                                                                    Severity: Major
                                                                    Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                      return false;
                                                                      Severity: Major
                                                                      Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                        return false;
                                                                        Severity: Major
                                                                        Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                  return true;
                                                                          Severity: Major
                                                                          Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                        return false;
                                                                            Severity: Major
                                                                            Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                      return true;
                                                                              Severity: Major
                                                                              Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                                            return false;
                                                                                Severity: Major
                                                                                Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                              return false;
                                                                                  Severity: Major
                                                                                  Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                            return true;
                                                                                    Severity: Major
                                                                                    Found in wp-includes/ID3/module.audio.mp3.php - About 30 mins to fix

                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                      Open

                                                                                                                  if ($thisfile_mpeg_audio_lame_raw['RGAD_track'] != 0) {
                                                                                      
                                                                                                                      $thisfile_mpeg_audio_lame_RGAD_track['raw']['name']        = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0xE000) >> 13;
                                                                                                                      $thisfile_mpeg_audio_lame_RGAD_track['raw']['originator']  = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x1C00) >> 10;
                                                                                                                      $thisfile_mpeg_audio_lame_RGAD_track['raw']['sign_bit']    = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x0200) >> 9;
                                                                                      Severity: Major
                                                                                      Found in wp-includes/ID3/module.audio.mp3.php and 1 other location - About 1 day to fix
                                                                                      wp-includes/ID3/module.audio.mp3.php on lines 833..850

                                                                                      Duplicated Code

                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                      Tuning

                                                                                      This issue has a mass of 298.

                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                      Refactorings

                                                                                      Further Reading

                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                      Open

                                                                                                                  if ($thisfile_mpeg_audio_lame_raw['RGAD_album'] != 0) {
                                                                                      
                                                                                                                      $thisfile_mpeg_audio_lame_RGAD_album['raw']['name']        = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0xE000) >> 13;
                                                                                                                      $thisfile_mpeg_audio_lame_RGAD_album['raw']['originator']  = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x1C00) >> 10;
                                                                                                                      $thisfile_mpeg_audio_lame_RGAD_album['raw']['sign_bit']    = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x0200) >> 9;
                                                                                      Severity: Major
                                                                                      Found in wp-includes/ID3/module.audio.mp3.php and 1 other location - About 1 day to fix
                                                                                      wp-includes/ID3/module.audio.mp3.php on lines 815..832

                                                                                      Duplicated Code

                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                      Tuning

                                                                                      This issue has a mass of 298.

                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                      Refactorings

                                                                                      Further Reading

                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                      Open

                                                                                                              } elseif ($info['mpeg']['audio']['layer'] == 1) {
                                                                                                                  $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0, 176000=>0, 192000=>0, 224000=>0, 256000=>0);
                                                                                                              } else {
                                                                                      Severity: Major
                                                                                      Found in wp-includes/ID3/module.audio.mp3.php and 2 other locations - About 1 hr to fix
                                                                                      wp-includes/ID3/module.audio.mp3.php on lines 1577..1579
                                                                                      wp-includes/ID3/module.audio.mp3.php on lines 1579..1581

                                                                                      Duplicated Code

                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                      Tuning

                                                                                      This issue has a mass of 115.

                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                      Refactorings

                                                                                      Further Reading

                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                      Open

                                                                                                                  } elseif ($info['mpeg']['audio']['layer'] == 1) {
                                                                                                                      $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 64000=>0, 96000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 288000=>0, 320000=>0, 352000=>0, 384000=>0, 416000=>0, 448000=>0);
                                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in wp-includes/ID3/module.audio.mp3.php and 2 other locations - About 1 hr to fix
                                                                                      wp-includes/ID3/module.audio.mp3.php on lines 1577..1579
                                                                                      wp-includes/ID3/module.audio.mp3.php on lines 1582..1584

                                                                                      Duplicated Code

                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                      Tuning

                                                                                      This issue has a mass of 115.

                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                      Refactorings

                                                                                      Further Reading

                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                      Open

                                                                                                                  } 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 wp-includes/ID3/module.audio.mp3.php and 2 other locations - About 1 hr to fix
                                                                                      wp-includes/ID3/module.audio.mp3.php on lines 1579..1581
                                                                                      wp-includes/ID3/module.audio.mp3.php on lines 1582..1584

                                                                                      Duplicated Code

                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                      Tuning

                                                                                      This issue has a mass of 115.

                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                      Refactorings

                                                                                      Further Reading

                                                                                      There are no issues that match your filters.

                                                                                      Category
                                                                                      Status