WordPress/WordPress

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

Summary

Maintainability
F
3 wks
Test Coverage

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

    public function Analyze() {
        $info = &$this->getid3->info;

        // initialize these values to an empty array, otherwise they default to NULL
        // and you can't append array values to a NULL value
Severity: Minor
Found in wp-includes/ID3/module.audio-video.riff.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 Analyze has 1101 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function Analyze() {
        $info = &$this->getid3->info;

        // initialize these values to an empty array, otherwise they default to NULL
        // and you can't append array values to a NULL value
Severity: Major
Found in wp-includes/ID3/module.audio-video.riff.php - About 5 days to fix

    File module.audio-video.riff.php has 1729 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-video.riff.php - About 4 days to fix

      Function ParseRIFF has a Cognitive Complexity of 168 (exceeds 5 allowed). Consider refactoring.
      Open

          public function ParseRIFF($startoffset, $maxoffset) {
              $info = &$this->getid3->info;
      
              $RIFFchunk = array();
              $FoundAllChunksWeNeed = false;
      Severity: Minor
      Found in wp-includes/ID3/module.audio-video.riff.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

      Method ParseRIFF has 304 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function ParseRIFF($startoffset, $maxoffset) {
              $info = &$this->getid3->info;
      
              $RIFFchunk = array();
              $FoundAllChunksWeNeed = false;
      Severity: Major
      Found in wp-includes/ID3/module.audio-video.riff.php - About 1 day to fix

        Method ParseRIFFAMV has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function ParseRIFFAMV($startoffset, $maxoffset) {
                // AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size
        
                // https://code.google.com/p/amv-codec-tools/wiki/AmvDocumentation
                //typedef struct _amvmainheader {
        Severity: Major
        Found in wp-includes/ID3/module.audio-video.riff.php - About 2 hrs to fix

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

              public static function parseComments(&$RIFFinfoArray, &$CommentsTargetArray) {
                  $RIFFinfoKeyLookup = array(
                      'IARL'=>'archivallocation',
                      'IART'=>'artist',
                      'ICDS'=>'costumedesigner',
          Severity: Minor
          Found in wp-includes/ID3/module.audio-video.riff.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 parseComments has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function parseComments(&$RIFFinfoArray, &$CommentsTargetArray) {
                  $RIFFinfoKeyLookup = array(
                      'IARL'=>'archivallocation',
                      'IART'=>'artist',
                      'ICDS'=>'costumedesigner',
          Severity: Major
          Found in wp-includes/ID3/module.audio-video.riff.php - About 2 hrs to fix

            Method ParseDIVXTAG has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function ParseDIVXTAG($DIVXTAG, $raw=false) {
                    // structure from "IDivX" source, Form1.frm, by "Greg Frazier of Daemonic Software Group", email: gfrazier@icestorm.net, web: http://dsg.cjb.net/
                    // source available at http://files.divx-digest.com/download/c663efe7ef8ad2e90bf4af4d3ea6188a/on0SWN2r/edit/IDivX.zip
                    // 'Byte Layout:                   '1111111111111111
                    // '32 for Movie - 1               '1111111111111111
            Severity: Major
            Found in wp-includes/ID3/module.audio-video.riff.php - About 2 hrs to fix

              Method parseWavPackHeader has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function parseWavPackHeader($WavPackChunkData) {
                      // typedef struct {
                      //     char ckID [4];
                      //     long ckSize;
                      //     short version;
              Severity: Minor
              Found in wp-includes/ID3/module.audio-video.riff.php - About 1 hr to fix

                Method ParseRIFFdata has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function ParseRIFFdata(&$RIFFdata) {
                        $info = &$this->getid3->info;
                        if ($RIFFdata) {
                            $tempfile = tempnam(GETID3_TEMP_DIR, 'getID3');
                            $fp_temp  = fopen($tempfile, 'wb');
                Severity: Minor
                Found in wp-includes/ID3/module.audio-video.riff.php - About 1 hr to fix

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

                      public function ParseRIFFAMV($startoffset, $maxoffset) {
                          // AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size
                  
                          // https://code.google.com/p/amv-codec-tools/wiki/AmvDocumentation
                          //typedef struct _amvmainheader {
                  Severity: Minor
                  Found in wp-includes/ID3/module.audio-video.riff.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

                  Avoid deeply nested control flow statements.
                  Open

                                              if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'])) {
                                                  $strhData = $thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'];
                                                  $strhfccType = substr($strhData,  0, 4);
                  
                                                  if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'])) {
                  Severity: Major
                  Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if (substr($DIVXTAG, -7) == 'DIVXTAG') {
                                                        // DIVXTAG is supposed to be inside an IDVX chunk in a LIST chunk, but some bad encoders just slap it on the end of a file
                                                        $this->warning('Found wrongly-structured DIVXTAG at offset '.($this->ftell() - 128).', parsing anyway');
                                                        $info['divxtag']['comments'] = self::ParseDIVXTAG($DIVXTAG);
                                                        break 2;
                    Severity: Major
                    Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if (isset($thisfile_riff_raw_strf_strhfccType_streamindex) && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) {
                      
                                                      $thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'];
                                                      if (self::fourccLookup($thisfile_video['fourcc'])) {
                                                          $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_video['fourcc']);
                      Severity: Major
                      Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        switch ($thisfile_riff_audio['codec_fourcc']) {
                                                            // http://developer.apple.com/qa/snd/snd07.html
                                                            case 'sowt':
                                                                $thisfile_riff_audio['codec_name'] = 'Two\'s Compliment Little-Endian PCM';
                                                                $thisfile_audio['lossless'] = true;
                        Severity: Major
                        Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                                  if (!empty($getid3_temp->info['warning'])) {
                                                                      foreach ($getid3_temp->info['warning'] as $newerror) {
                                                                          $this->warning('getid3_dts() says: ['.$newerror.']');
                                                                      }
                                                                  }
                          Severity: Major
                          Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                if ($decoded = @json_decode($value, true)) {
                                                                    if (!empty($decoded) && (count($decoded) == 1)) {
                                                                        $value = $decoded[0];
                                                                    } else {
                                                                        $value = $decoded;
                            Severity: Major
                            Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                      if ($chunkname == 'JUNK') {
                                                                          if (preg_match('#^([\\x20-\\x7F]+)#', $RIFFchunk[$chunkname][$thisindex]['data'], $matches)) {
                                                                              // only keep text characters [chr(32)-chr(127)]
                                                                              $info['riff']['comments']['junk'][] = trim($matches[1]);
                                                                          }
                              Severity: Major
                              Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                        if (empty($getid3_temp->info['error'])) {
                                                                            $info['audio'] = $getid3_temp->info['audio'];
                                                                            $info['mpeg']  = $getid3_temp->info['mpeg'];
                                                                        }
                                Severity: Major
                                Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                          if (!empty($getid3_temp->info['warning'])) {
                                                                              foreach ($getid3_temp->info['warning'] as $newerror) {
                                                                                  $this->warning('getid3_ac3() says: ['.$newerror.']');
                                                                              }
                                                                          }
                                  Severity: Major
                                  Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                        if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', $FirstFourBytes)) {
                                                                            // MP3
                                                                            if (getid3_mp3::MPEGaudioHeaderBytesValid($FirstFourBytes)) {
                                                                                $getid3_temp = new getID3();
                                                                                $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);
                                    Severity: Major
                                    Found in wp-includes/ID3/module.audio-video.riff.php - About 45 mins to fix

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

                                          public static function ParseDIVXTAG($DIVXTAG, $raw=false) {
                                              // structure from "IDivX" source, Form1.frm, by "Greg Frazier of Daemonic Software Group", email: gfrazier@icestorm.net, web: http://dsg.cjb.net/
                                              // source available at http://files.divx-digest.com/download/c663efe7ef8ad2e90bf4af4d3ea6188a/on0SWN2r/edit/IDivX.zip
                                              // 'Byte Layout:                   '1111111111111111
                                              // '32 for Movie - 1               '1111111111111111
                                      Severity: Minor
                                      Found in wp-includes/ID3/module.audio-video.riff.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.audio-video.riff.php - About 30 mins to fix

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

                                                $RIFFinfoKeyLookup = array(
                                                    'IARL'=>'archivallocation',
                                                    'IART'=>'artist',
                                                    'ICDS'=>'costumedesigner',
                                                    'ICMS'=>'commissionedby',
                                        Severity: Major
                                        Found in wp-includes/ID3/module.audio-video.riff.php and 1 other location - About 5 hrs to fix
                                        wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php on lines 254..337

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

                                        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_riff_raw_rgad_album['name'] != 0) && ($thisfile_riff_raw_rgad_album['originator'] != 0)) {
                                                                $thisfile_riff['rgad']['album']['name']       = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_album['name']);
                                                                $thisfile_riff['rgad']['album']['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_album['originator']);
                                                                $thisfile_riff['rgad']['album']['adjustment'] = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_album['adjustment'], $thisfile_riff_raw_rgad_album['signbit']);
                                                            }
                                        Severity: Major
                                        Found in wp-includes/ID3/module.audio-video.riff.php and 1 other location - About 2 hrs to fix
                                        wp-includes/ID3/module.audio-video.riff.php on lines 269..273

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

                                        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_riff_raw_rgad_track['name'] != 0) && ($thisfile_riff_raw_rgad_track['originator'] != 0)) {
                                                                $thisfile_riff['rgad']['track']['name']            = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_track['name']);
                                                                $thisfile_riff['rgad']['track']['originator']      = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_track['originator']);
                                                                $thisfile_riff['rgad']['track']['adjustment']      = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_track['adjustment'], $thisfile_riff_raw_rgad_track['signbit']);
                                                            }
                                        Severity: Major
                                        Found in wp-includes/ID3/module.audio-video.riff.php and 1 other location - About 2 hrs to fix
                                        wp-includes/ID3/module.audio-video.riff.php on lines 274..278

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

                                        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

                                                                    if ((($info['avdataend'] - $info['filesize']) == 1) && (($thisfile_riff[$RIFFsubtype]['data'][0]['size'] % 2) == 0) && ((($info['filesize'] - $info['avdataoffset']) % 2) == 1)) {
                                                                        // output file appears to be incorrectly *not* padded to nearest WORD boundary
                                                                        // Output less severe warning
                                                                        $this->warning('File should probably be padded to nearest WORD boundary, but it is not (expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' therefore short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)');
                                                                        $info['avdataend'] = $info['filesize'];
                                        Severity: Major
                                        Found in wp-includes/ID3/module.audio-video.riff.php and 1 other location - About 1 hr to fix
                                        wp-includes/ID3/module.audio-video.riff.php on lines 644..652

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

                                        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

                                                                    if (($info['avdataend'] - $info['filesize']) == 1) {
                                                                        // LiteWave appears to incorrectly *not* pad actual output file
                                                                        // to nearest WORD boundary so may appear to be short by one
                                                                        // byte, in which case - skip warning
                                                                    } else {
                                        Severity: Major
                                        Found in wp-includes/ID3/module.audio-video.riff.php and 1 other location - About 1 hr to fix
                                        wp-includes/ID3/module.audio-video.riff.php on lines 656..665

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

                                        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 (!empty($info['dts'])) {
                                                                        // Dolby DTS files masquerade as PCM-WAV, but they're not
                                                                        $thisfile_audio['wformattag']  = 0x2001;
                                                                        $thisfile_audio['codec']       = self::wFormatTagLookup($thisfile_audio['wformattag']);
                                                                        $thisfile_audio['lossless']    = false;
                                        Severity: Minor
                                        Found in wp-includes/ID3/module.audio-video.riff.php and 1 other location - About 55 mins to fix
                                        wp-includes/ID3/module.audio-video.riff.php on lines 559..566

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

                                        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 (!empty($info['ac3'])) {
                                                                        // Dolby Digital WAV files masquerade as PCM-WAV, but they're not
                                                                        $thisfile_audio['wformattag']  = 0x2000;
                                                                        $thisfile_audio['codec']       = self::wFormatTagLookup($thisfile_audio['wformattag']);
                                                                        $thisfile_audio['lossless']    = false;
                                        Severity: Minor
                                        Found in wp-includes/ID3/module.audio-video.riff.php and 1 other location - About 55 mins to fix
                                        wp-includes/ID3/module.audio-video.riff.php on lines 567..574

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

                                        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