WordPress/WordPress

View on GitHub
wp-includes/ID3/module.tag.id3v2.php

Summary

Maintainability
F
1 mo
Test Coverage

Function ParseID3v2Frame has a Cognitive Complexity of 556 (exceeds 5 allowed). Consider refactoring.
Open

    public function ParseID3v2Frame(&$parsedFrame) {

        // shortcuts
        $info = &$this->getid3->info;
        $id3v2_majorversion = $info['id3v2']['majorversion'];
Severity: Minor
Found in wp-includes/ID3/module.tag.id3v2.php - About 1 wk 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 ParseID3v2Frame has 1101 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function ParseID3v2Frame(&$parsedFrame) {

        // shortcuts
        $info = &$this->getid3->info;
        $id3v2_majorversion = $info['id3v2']['majorversion'];
Severity: Major
Found in wp-includes/ID3/module.tag.id3v2.php - About 5 days to fix

    File module.tag.id3v2.php has 1773 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.tag.id3v2.php - About 4 days to fix

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

          public function Analyze() {
              $info = &$this->getid3->info;
      
              //    Overall tag structure:
              //        +-----------------------------+
      Severity: Minor
      Found in wp-includes/ID3/module.tag.id3v2.php - About 3 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

      Consider simplifying this complex logical expression.
      Open

              if (isset($parsedFrame['datalength']) && ($parsedFrame['datalength'] == 0)) {
      
                  $warning = 'Frame "'.$parsedFrame['frame_name'].'" at offset '.$parsedFrame['dataoffset'].' has no data portion';
                  switch ($parsedFrame['frame_name']) {
                      case 'WCOM':
      Severity: Critical
      Found in wp-includes/ID3/module.tag.id3v2.php - About 3 days to fix

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

            public function Analyze() {
                $info = &$this->getid3->info;
        
                //    Overall tag structure:
                //        +-----------------------------+
        Severity: Major
        Found in wp-includes/ID3/module.tag.id3v2.php - About 1 day to fix

          getid3_id3v2 has 28 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class getid3_id3v2 extends getid3_handler
          {
              public $StartingOffset = 0;
          
              /**
          Severity: Minor
          Found in wp-includes/ID3/module.tag.id3v2.php - About 3 hrs to fix

            Method ID3v22iTunesBrokenFrameName has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function ID3v22iTunesBrokenFrameName($frame_name) {
                    // iTunes (multiple versions) has been known to write ID3v2.3 style frames
                    // but use ID3v2.2 frame names, right-padded using either [space] or [null]
                    // to make them fit in the 4-byte frame name space of the ID3v2.3 frame.
                    // This function will detect and translate the corrupt frame name into ID3v2.3 standard.
            Severity: Major
            Found in wp-includes/ID3/module.tag.id3v2.php - About 3 hrs to fix

              Function ParseID3v2GenreString has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function ParseID3v2GenreString($genrestring) {
                      // Parse genres into arrays of genreName and genreID
                      // ID3v2.2.x, ID3v2.3.x: '(21)' or '(4)Eurodisco' or '(51)(39)' or '(55)((I think...)'
                      // ID3v2.4.x: '21' $00 'Eurodisco' $00
                      $clean_genres = array();
              Severity: Minor
              Found in wp-includes/ID3/module.tag.id3v2.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 ETCOEventLookup has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function ETCOEventLookup($index) {
                      if (($index >= 0x17) && ($index <= 0xDF)) {
                          return 'reserved for future use';
                      }
                      if (($index >= 0xE0) && ($index <= 0xEF)) {
              Severity: Minor
              Found in wp-includes/ID3/module.tag.id3v2.php - About 1 hr to fix

                Method ParseID3v2GenreString has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function ParseID3v2GenreString($genrestring) {
                        // Parse genres into arrays of genreName and genreID
                        // ID3v2.2.x, ID3v2.3.x: '(21)' or '(4)Eurodisco' or '(51)(39)' or '(55)((I think...)'
                        // ID3v2.4.x: '21' $00 'Eurodisco' $00
                        $clean_genres = array();
                Severity: Minor
                Found in wp-includes/ID3/module.tag.id3v2.php - About 1 hr to fix

                  Function IsValidDateStampString has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function IsValidDateStampString($datestamp) {
                          if (!preg_match('#^[12][0-9]{3}[01][0-9][0123][0-9]$#', $datestamp)) {
                              return false;
                          }
                          $year  = substr($datestamp, 0, 4);
                  Severity: Minor
                  Found in wp-includes/ID3/module.tag.id3v2.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 APICPictureTypeLookup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function APICPictureTypeLookup($index, $returnarray=false) {
                          static $APICPictureTypeLookup = array(
                              0x00 => 'Other',
                              0x01 => '32x32 pixels \'file icon\' (PNG only)',
                              0x02 => 'Other file icon',
                  Severity: Minor
                  Found in wp-includes/ID3/module.tag.id3v2.php - About 1 hr 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 wp-includes/ID3/module.tag.id3v2.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  switch (strtoupper($info['id3v2']['encoding'])) {
                                                      case 'ISO-8859-1':
                                                      case 'UTF-8':
                                                          $encoding_converted_text = substr($encoding_converted_text, 2);
                                                          // remove unwanted byte-order-marks
                      Severity: Major
                      Found in wp-includes/ID3/module.tag.id3v2.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;
                                                    $this->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 wp-includes/ID3/module.tag.id3v2.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;
                                                      $this->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 wp-includes/ID3/module.tag.id3v2.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if (strlen($this->TextEncodingTerminatorLookup($subframe['encoding'])) == 2) {
                                                                // the null terminator between "description" and "picture data" could be either 1 byte (ISO-8859-1, UTF-8) or two bytes (UTF-16)
                                                                // the above regex assumes one byte, if it's actually two then strip the second one here
                                                                $subframe_apic_picturedata = substr($subframe_apic_picturedata, 1);
                                                            }
                            Severity: Major
                            Found in wp-includes/ID3/module.tag.id3v2.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          switch (strtoupper($info['id3v2']['encoding'])) {
                                                              case 'ISO-8859-1':
                                                              case 'UTF-8':
                                                                  $encoding_converted_text = substr($encoding_converted_text, 2);
                                                                  // remove unwanted byte-order-marks
                              Severity: Major
                              Found in wp-includes/ID3/module.tag.id3v2.php - About 45 mins to fix

                                Function ID3v22iTunesBrokenFrameName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public static function ID3v22iTunesBrokenFrameName($frame_name) {
                                        // iTunes (multiple versions) has been known to write ID3v2.3 style frames
                                        // but use ID3v2.2 frame names, right-padded using either [space] or [null]
                                        // to make them fit in the 4-byte frame name space of the ID3v2.3 frame.
                                        // This function will detect and translate the corrupt frame name into ID3v2.3 standard.
                                Severity: Minor
                                Found in wp-includes/ID3/module.tag.id3v2.php - About 35 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 too many return statements within this method.
                                Open

                                        return true;
                                Severity: Major
                                Found in wp-includes/ID3/module.tag.id3v2.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.tag.id3v2.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.tag.id3v2.php - About 30 mins to fix

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

                                              } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GRID')) { // 4.26  GRID Group identification registration (ID3v2.3+ only)
                                      
                                                  //   There may be several 'GRID' frames in a tag,
                                                  //   but only one containing the same symbol
                                                  //   and only one containing the same owner identifier
                                      Severity: Major
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 1 other location - About 5 hrs to fix
                                      wp-includes/ID3/module.tag.id3v2.php on lines 1840..1862

                                      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 195.

                                      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

                                              } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ENCR')) { // 4.25  ENCR Encryption method registration (ID3v2.3+ only)
                                                  //   There may be several 'ENCR' frames in a tag,
                                                  //   but only one containing the same symbol
                                                  //   and only one containing the same owner identifier
                                                  // <Header for 'Encryption method registration', ID: 'ENCR'>
                                      Severity: Major
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 1 other location - About 5 hrs to fix
                                      wp-includes/ID3/module.tag.id3v2.php on lines 1862..1885

                                      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 195.

                                      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 (strlen($parsedFrame['data']) > 0) {
                                                          $parsedFrame['incdec']['bass'] = (bool) substr($frame_incrdecrflags, 2, 1);
                                                          $parsedFrame['volumechange']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
                                                          if ($parsedFrame['incdec']['bass'] === false) {
                                                              $parsedFrame['volumechange']['bass'] *= -1;
                                      Severity: Major
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 1 other location - About 4 hrs to fix
                                      wp-includes/ID3/module.tag.id3v2.php on lines 1239..1248

                                      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 179.

                                      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 (strlen($parsedFrame['data']) > 0) {
                                                          $parsedFrame['incdec']['center'] = (bool) substr($frame_incrdecrflags, 3, 1);
                                                          $parsedFrame['volumechange']['center'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
                                                          if ($parsedFrame['incdec']['center'] === false) {
                                                              $parsedFrame['volumechange']['center'] *= -1;
                                      Severity: Major
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 1 other location - About 4 hrs to fix
                                      wp-includes/ID3/module.tag.id3v2.php on lines 1250..1259

                                      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 179.

                                      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

                                                              if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
                                                                  if (!isset($info['id3v2']['comments']['picture'])) {
                                                                      $info['id3v2']['comments']['picture'] = array();
                                                                  }
                                                                  $comments_picture_data = array();
                                      Severity: Major
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 2 other locations - About 2 hrs to fix
                                      wp-includes/ID3/module.audio.flac.php on lines 150..162
                                      wp-includes/ID3/module.tag.apetag.php on lines 322..334

                                      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 131.

                                      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

                                              static $APICPictureTypeLookup = array(
                                                  0x00 => 'Other',
                                                  0x01 => '32x32 pixels \'file icon\' (PNG only)',
                                                  0x02 => 'Other file icon',
                                                  0x03 => 'Cover (front)',
                                      Severity: Major
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 1 other location - About 1 hr to fix
                                      wp-includes/ID3/module.audio.flac.php on lines 493..515

                                      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 113.

                                      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

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

                                                          for ($i = 0; $i < $len; $i++) {
                                                              if ($framedata[$i] != "\x00") {
                                                                  $thisfile_id3v2['padding']['valid'] = false;
                                                                  $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i;
                                                                  $this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)');
                                      Severity: Major
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 1 other location - About 1 hr to fix
                                      wp-includes/ID3/module.tag.id3v2.php on lines 265..272

                                      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 105.

                                      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

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

                                                          for ($i = 0; $i < $thisfile_id3v2['padding']['length']; $i++) {
                                                              if ($framedata[$i] != "\x00") {
                                                                  $thisfile_id3v2['padding']['valid'] = false;
                                                                  $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i;
                                                                  $this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)');
                                      Severity: Major
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 1 other location - About 1 hr to fix
                                      wp-includes/ID3/module.tag.id3v2.php on lines 331..338

                                      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 105.

                                      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 ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) {
                                                              $this->warning('CHAP subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)');
                                                              break;
                                                          }
                                      Severity: Minor
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 1 other location - About 40 mins to fix
                                      wp-includes/ID3/module.tag.id3v2.php on lines 2153..2156

                                      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 93.

                                      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 ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) {
                                                              $this->warning('CTOS subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)');
                                                              break;
                                                          }
                                      Severity: Minor
                                      Found in wp-includes/ID3/module.tag.id3v2.php and 1 other location - About 40 mins to fix
                                      wp-includes/ID3/module.tag.id3v2.php on lines 2027..2030

                                      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 93.

                                      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