WordPress/WordPress

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

Summary

Maintainability
F
1 mo
Test Coverage

Function QuicktimeParseAtom has a Cognitive Complexity of 522 (exceeds 5 allowed). Consider refactoring.
Open

    public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
        // http://developer.apple.com/techpubs/quicktime/qtdevdocs/APIREF/INDEX/atomalphaindex.htm
        // https://code.google.com/p/mp4v2/wiki/iTunesMetadata

        $info = &$this->getid3->info;
Severity: Minor
Found in wp-includes/ID3/module.audio-video.quicktime.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 QuicktimeParseAtom has 1581 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
        // http://developer.apple.com/techpubs/quicktime/qtdevdocs/APIREF/INDEX/atomalphaindex.htm
        // https://code.google.com/p/mp4v2/wiki/iTunesMetadata

        $info = &$this->getid3->info;
Severity: Major
Found in wp-includes/ID3/module.audio-video.quicktime.php - About 1 wk to fix

    File module.audio-video.quicktime.php has 2439 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.quicktime.php - About 6 days to fix

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

          public function Analyze() {
              $info = &$this->getid3->info;
      
              $info['fileformat'] = 'quicktime';
              $info['quicktime']['hinting']    = false;
      Severity: Minor
      Found in wp-includes/ID3/module.audio-video.quicktime.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 Analyze has 160 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function Analyze() {
              $info = &$this->getid3->info;
      
              $info['fileformat'] = 'quicktime';
              $info['quicktime']['hinting']    = false;
      Severity: Major
      Found in wp-includes/ID3/module.audio-video.quicktime.php - About 6 hrs to fix

        Method QuicktimeLanguageLookup has 122 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function QuicktimeLanguageLookup($languageid) {
                // http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353
                static $QuicktimeLanguageLookup = array();
                if (empty($QuicktimeLanguageLookup)) {
                    $QuicktimeLanguageLookup[0]     = 'English';
        Severity: Major
        Found in wp-includes/ID3/module.audio-video.quicktime.php - About 4 hrs to fix

          Method CopyToAppropriateCommentsSection has 98 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function CopyToAppropriateCommentsSection($keyname, $data, $boxname='') {
                  static $handyatomtranslatorarray = array();
                  if (empty($handyatomtranslatorarray)) {
                      // http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt
                      // http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt
          Severity: Major
          Found in wp-includes/ID3/module.audio-video.quicktime.php - About 3 hrs to fix

            Method QuicktimeIODSvideoProfileName has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function QuicktimeIODSvideoProfileName($video_profile_id) {
                    static $QuicktimeIODSvideoProfileNameLookup = array();
                    if (empty($QuicktimeIODSvideoProfileNameLookup)) {
                        $QuicktimeIODSvideoProfileNameLookup = array(
                            0x00 => 'Reserved (0x00) Profile',
            Severity: Major
            Found in wp-includes/ID3/module.audio-video.quicktime.php - About 2 hrs to fix

              getid3_quicktime has 24 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class getid3_quicktime extends getid3_handler
              {
              
                  /** audio-video.quicktime
                   * return all parsed data from all atoms if true, otherwise just returned parsed metadata
              Severity: Minor
              Found in wp-includes/ID3/module.audio-video.quicktime.php - About 2 hrs to fix

                Method QuicktimeVideoCodecLookup has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function QuicktimeVideoCodecLookup($codecid) {
                        static $QuicktimeVideoCodecLookup = array();
                        if (empty($QuicktimeVideoCodecLookup)) {
                            $QuicktimeVideoCodecLookup['.SGI'] = 'SGI';
                            $QuicktimeVideoCodecLookup['3IV1'] = '3ivx MPEG-4 v1';
                Severity: Major
                Found in wp-includes/ID3/module.audio-video.quicktime.php - About 2 hrs to fix

                  Method QuicktimeIODSaudioProfileName has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function QuicktimeIODSaudioProfileName($audio_profile_id) {
                          static $QuicktimeIODSaudioProfileNameLookup = array();
                          if (empty($QuicktimeIODSaudioProfileNameLookup)) {
                              $QuicktimeIODSaudioProfileNameLookup = array(
                                  0x00 => 'ISO Reserved (0x00)',
                  Severity: Major
                  Found in wp-includes/ID3/module.audio-video.quicktime.php - About 2 hrs to fix

                    Function CopyToAppropriateCommentsSection has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function CopyToAppropriateCommentsSection($keyname, $data, $boxname='') {
                            static $handyatomtranslatorarray = array();
                            if (empty($handyatomtranslatorarray)) {
                                // http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt
                                // http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt
                    Severity: Minor
                    Found in wp-includes/ID3/module.audio-video.quicktime.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

                    Function QuicktimeParseContainerAtom has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function QuicktimeParseContainerAtom($atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
                            $atom_structure = array();
                            $subatomoffset  = 0;
                            $subatomcounter = 0;
                            if ((strlen($atom_data) == 4) && (getid3_lib::BigEndian2Int($atom_data) == 0x00000000)) {
                    Severity: Minor
                    Found in wp-includes/ID3/module.audio-video.quicktime.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 QuicktimeAudioCodecLookup has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function QuicktimeAudioCodecLookup($codecid) {
                            static $QuicktimeAudioCodecLookup = array();
                            if (empty($QuicktimeAudioCodecLookup)) {
                                $QuicktimeAudioCodecLookup['.mp3']          = 'Fraunhofer MPEG Layer-III alias';
                                $QuicktimeAudioCodecLookup['aac ']          = 'ISO/IEC 14496-3 AAC';
                    Severity: Minor
                    Found in wp-includes/ID3/module.audio-video.quicktime.php - About 1 hr to fix

                      Function quicktime_bookmark_time_scale has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function quicktime_bookmark_time_scale($info) {
                              $time_scale = '';
                              $ts_prefix_len = 0;
                              $res = array();
                              $this->search_tag_by_pair($info['quicktime']['moov'], 'name', 'stbl', 'quicktime/moov', $res);
                      Severity: Minor
                      Found in wp-includes/ID3/module.audio-video.quicktime.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

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

                          public function LociString($lstring, &$count) {
                              // Loci strings are UTF-8 or UTF-16 and null (x00/x0000) terminated. UTF-16 has a BOM
                              // Also need to return the number of bytes the string occupied so additional fields can be extracted
                              $len = strlen($lstring);
                              if ($len == 0) {
                      Severity: Minor
                      Found in wp-includes/ID3/module.audio-video.quicktime.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 QuicktimeParseContainerAtom has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function QuicktimeParseContainerAtom($atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
                              $atom_structure = array();
                              $subatomoffset  = 0;
                              $subatomcounter = 0;
                              if ((strlen($atom_data) == 4) && (getid3_lib::BigEndian2Int($atom_data) == 0x00000000)) {
                      Severity: Minor
                      Found in wp-includes/ID3/module.audio-video.quicktime.php - About 1 hr to fix

                        Method QuicktimeStoreFrontCodeLookup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function QuicktimeStoreFrontCodeLookup($sfid) {
                                static $QuicktimeStoreFrontCodeLookup = array();
                                if (empty($QuicktimeStoreFrontCodeLookup)) {
                                    $QuicktimeStoreFrontCodeLookup[143460] = 'Australia';
                                    $QuicktimeStoreFrontCodeLookup[143445] = 'Austria';
                        Severity: Minor
                        Found in wp-includes/ID3/module.audio-video.quicktime.php - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if (substr($atomname, 0, 3) == "\x00\x00\x00") {
                                      // https://github.com/JamesHeinrich/getID3/issues/139
                                      $atomname = getid3_lib::BigEndian2Int($atomname);
                                      $atom_structure['name'] = $atomname;
                                      $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);
                          Severity: Major
                          Found in wp-includes/ID3/module.audio-video.quicktime.php - About 1 hr to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                    if ($atom_structure['sample_description_table'][$i]['video_pixel_color_name'] != 'invalid') {
                                                                        $info['quicktime']['video']['codec_fourcc']        = $atom_structure['sample_description_table'][$i]['data_format'];
                                                                        $info['quicktime']['video']['codec_fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($atom_structure['sample_description_table'][$i]['data_format']);
                                                                        $info['quicktime']['video']['codec']               = (((int) $atom_structure['sample_description_table'][$i]['video_encoder_name_len'] > 0) ? $atom_structure['sample_description_table'][$i]['video_encoder_name'] : $atom_structure['sample_description_table'][$i]['data_format']);
                                                                        $info['quicktime']['video']['color_depth']         = $atom_structure['sample_description_table'][$i]['video_pixel_color_depth'];
                            Severity: Major
                            Found in wp-includes/ID3/module.audio-video.quicktime.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                              if (isset($info['mpeg']['audio'])) {
                                                                  $info['audio']['dataformat']   = 'mp3';
                                                                  $info['audio']['codec']        = (!empty($info['mpeg']['audio']['encoder']) ? $info['mpeg']['audio']['encoder'] : (!empty($info['mpeg']['audio']['codec']) ? $info['mpeg']['audio']['codec'] : (!empty($info['mpeg']['audio']['LAME']) ? 'LAME' :'mp3')));
                                                                  $info['audio']['sample_rate']  = $info['mpeg']['audio']['sample_rate'];
                                                                  $info['audio']['channels']     = $info['mpeg']['audio']['channels'];
                              Severity: Major
                              Found in wp-includes/ID3/module.audio-video.quicktime.php - About 45 mins to fix

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

                                    public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
                                Severity: Minor
                                Found in wp-includes/ID3/module.audio-video.quicktime.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                          switch ($atom_structure['sample_description_table'][$i]['data_format']) {
                                                                              case 'raw ': // PCM
                                                                              case 'alac': // Apple Lossless Audio Codec
                                                                              case 'sowt': // signed/two's complement (Little Endian)
                                                                              case 'twos': // signed/two's complement (Big Endian)
                                  Severity: Major
                                  Found in wp-includes/ID3/module.audio-video.quicktime.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                                    if ($atomname == 'covr') {
                                                                                        if (!empty($atom_structure['data'])) {
                                                                                            $atom_structure['image_mime'] = 'image/unknown'; // provide default MIME type to ensure array keys exist
                                                                                            if (function_exists('getimagesizefromstring') && ($getimagesize = getimagesizefromstring($atom_structure['data'])) && !empty($getimagesize['mime'])) {
                                                                                                $atom_structure['image_mime'] = $getimagesize['mime'];
                                    Severity: Major
                                    Found in wp-includes/ID3/module.audio-video.quicktime.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                              if ($this->QuicktimeVideoCodecLookup($info['video']['fourcc'])) {
                                                                                  $info['video']['fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($info['video']['fourcc']);
                                                                              }
                                      Severity: Major
                                      Found in wp-includes/ID3/module.audio-video.quicktime.php - About 45 mins to fix

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

                                            public function search_tag_by_pair($info, $k, $v, $history, &$result) {
                                                foreach ($info as $key => $value) {
                                                    $key_history = $history.'/'.$key;
                                                    if (($key === $k) && ($value === $v)) {
                                                        $result[] = array($key_history, $info);
                                        Severity: Minor
                                        Found in wp-includes/ID3/module.audio-video.quicktime.php - About 45 mins to fix

                                        Cognitive Complexity

                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                        A method's cognitive complexity is based on a few simple rules:

                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                        • Code is considered more complex for each "break in the linear flow of the code"
                                        • Code is considered more complex when "flow breaking structures are nested"

                                        Further reading

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                                        switch ($atomname) {
                                                                                            case 'cpil':
                                                                                            case 'hdvd':
                                                                                            case 'pcst':
                                                                                            case 'pgap':
                                        Severity: Major
                                        Found in wp-includes/ID3/module.audio-video.quicktime.php - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                                  if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($atom_structure['sample_description_table'][$i]['height'])) {
                                                                                      // assume that values stored here are more important than values stored in [tkhd] atom
                                                                                      $info['video']['resolution_x'] = $atom_structure['sample_description_table'][$i]['width'];
                                                                                      $info['video']['resolution_y'] = $atom_structure['sample_description_table'][$i]['height'];
                                                                                      $info['quicktime']['video']['resolution_x'] = $info['video']['resolution_x'];
                                          Severity: Major
                                          Found in wp-includes/ID3/module.audio-video.quicktime.php - About 45 mins to fix

                                            Consider simplifying this complex logical expression.
                                            Open

                                                    if (!empty($info['bitrate']) && !empty($info['audio']['bitrate']) && empty($info['video']['bitrate']) && !empty($info['video']['frame_rate']) && !empty($info['video']['resolution_x']) && ($info['bitrate'] > $info['audio']['bitrate'])) {
                                                        $info['video']['bitrate'] = $info['bitrate'] - $info['audio']['bitrate'];
                                                    }
                                            Severity: Major
                                            Found in wp-includes/ID3/module.audio-video.quicktime.php - About 40 mins to fix

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

                                                  public function search_tag_by_pair($info, $k, $v, $history, &$result) {
                                              Severity: Minor
                                              Found in wp-includes/ID3/module.audio-video.quicktime.php - About 35 mins to fix

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

                                                    public function search_tag_by_key($info, $tag, $history, &$result) {
                                                        foreach ($info as $key => $value) {
                                                            $key_history = $history.'/'.$key;
                                                            if ($key === $tag) {
                                                                $result[] = array($key_history, $info);
                                                Severity: Minor
                                                Found in wp-includes/ID3/module.audio-video.quicktime.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 $lmatches[1];
                                                Severity: Major
                                                Found in wp-includes/ID3/module.audio-video.quicktime.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

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

                                                    Function quicktime_time_to_sample_table has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                        public function quicktime_time_to_sample_table($info) {
                                                            $res = array();
                                                            $this->search_tag_by_pair($info['quicktime']['moov'], 'name', 'stbl', 'quicktime/moov', $res);
                                                            foreach ($res as $value) {
                                                                $stbl_res = array();
                                                    Severity: Minor
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php - About 25 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

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

                                                                        if (strlen($lat_deg) == 2) {        // [+-]DD.D
                                                                            $ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim($lat_deg, '0').$lat_deg_dec);
                                                                        } elseif (strlen($lat_deg) == 4) {  // [+-]DDMM.M
                                                                            $ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval(ltrim(substr($lat_deg, 2, 2), '0').$lat_deg_dec / 60);
                                                                        } elseif (strlen($lat_deg) == 6) {  // [+-]DDMMSS.S
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 2 other locations - About 1 day to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 158..164
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 166..172

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

                                                    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 (strlen($lon_deg) == 3) {        // [+-]DDD.D
                                                                            $ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim($lon_deg, '0').$lon_deg_dec);
                                                                        } elseif (strlen($lon_deg) == 5) {  // [+-]DDDMM.M
                                                                            $ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval(ltrim(substr($lon_deg, 2, 2), '0').$lon_deg_dec / 60);
                                                                        } elseif (strlen($lon_deg) == 7) {  // [+-]DDDMMSS.S
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 2 other locations - About 1 day to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 150..156
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 166..172

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

                                                    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 (strlen($alt_deg) == 3) {        // [+-]DDD.D
                                                                            $ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim($alt_deg, '0').$alt_deg_dec);
                                                                        } elseif (strlen($alt_deg) == 5) {  // [+-]DDDMM.M
                                                                            $ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval(ltrim(substr($alt_deg, 2, 2), '0').$alt_deg_dec / 60);
                                                                        } elseif (strlen($alt_deg) == 7) {  // [+-]DDDMMSS.S
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 2 other locations - About 1 day to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 150..156
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 158..164

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

                                                    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

                                                                    case 'stss': // Sample Table Sync Sample (key frames) atom
                                                                        if ($ParseAllPossibleAtoms) {
                                                                            $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
                                                                            $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
                                                                            $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 2 other locations - About 4 hrs to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1108..1120
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1123..1134

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

                                                    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

                                                                    case 'stco': // Sample Table Chunk Offset atom
                                                    //                    if (true) {
                                                                        if ($ParseAllPossibleAtoms) {
                                                                            $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
                                                                            $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 2 other locations - About 4 hrs to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1059..1070
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1123..1134

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

                                                    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

                                                                    case 'co64': // Chunk Offset 64-bit (version of "stco" that supports > 2GB files)
                                                                        if ($ParseAllPossibleAtoms) {
                                                                            $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
                                                                            $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
                                                                            $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 2 other locations - About 4 hrs to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1059..1070
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1108..1120

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

                                                    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 5 locations. Consider refactoring.
                                                    Open

                                                                                        case 1:
                                                                                            $atom_structure['sensor_data']['data_type']['accel_count']++;
                                                                                            $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);
                                                                                            $sensor_data_array['mode']      = $uuid_bytes_read['mode'];
                                                                                            $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 4 other locations - About 2 hrs to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1816..1825
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1836..1845
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1846..1855
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1870..1879

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

                                                    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 5 locations. Consider refactoring.
                                                    Open

                                                                                        case 6:
                                                                                            $atom_structure['sensor_data']['data_type']['rotation_count']++;
                                                                                            $uuid_bytes_read = unpack('cmode/Jtimestamp/Grotx/Groty/Grotz/x*', $sensor_data_content);
                                                                                            $sensor_data_array['mode']      = $uuid_bytes_read['mode'];
                                                                                            $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 4 other locations - About 2 hrs to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1816..1825
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1826..1835
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1836..1845
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1846..1855

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

                                                    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 5 locations. Consider refactoring.
                                                    Open

                                                                                        case 3:
                                                                                            $atom_structure['sensor_data']['data_type']['magno_count']++;
                                                                                            $uuid_bytes_read = unpack('cmode/Jtimestamp/Gmagx/Gmagy/Gmagz/x*', $sensor_data_content);
                                                                                            $sensor_data_array['mode']      = $uuid_bytes_read['mode'];
                                                                                            $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 4 other locations - About 2 hrs to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1816..1825
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1826..1835
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1836..1845
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1870..1879

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

                                                    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 5 locations. Consider refactoring.
                                                    Open

                                                                                        case 250:
                                                                                            $atom_structure['sensor_data']['data_type']['fusion_count']++;
                                                                                            $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);
                                                                                            $sensor_data_array['mode']      = $uuid_bytes_read['mode'];
                                                                                            $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 4 other locations - About 2 hrs to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1826..1835
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1836..1845
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1846..1855
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1870..1879

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

                                                    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 5 locations. Consider refactoring.
                                                    Open

                                                                                        case 2:
                                                                                            $atom_structure['sensor_data']['data_type']['gyro_count']++;
                                                                                            $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content);
                                                                                            $sensor_data_array['mode']      = $uuid_bytes_read['mode'];
                                                                                            $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp'];
                                                    Severity: Major
                                                    Found in wp-includes/ID3/module.audio-video.quicktime.php and 4 other locations - About 2 hrs to fix
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1816..1825
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1826..1835
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1846..1855
                                                    wp-includes/ID3/module.audio-video.quicktime.php on lines 1870..1879

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

                                                    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