CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php

Summary

Maintainability
F
2 wks
Test Coverage

File getid3.lib.php has 1070 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org>               //
//  available at http://getid3.sourceforge.net                 //
//            or http://www.getid3.org                         //
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 2 days to fix

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

        public static function CopyTagsToComments(&$ThisFileInfo) {
    
            // Copy all entries from ['tags'] into common ['comments']
            if (!empty($ThisFileInfo['tags'])) {
                foreach ($ThisFileInfo['tags'] as $tagtype => $tagarray) {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

    getid3_lib has 66 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class getid3_lib
    {
    
        public static function PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8') {
            $returnstring = '';
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 1 day to fix

      Function hash_data has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function hash_data($file, $offset, $end, $algorithm) {
              static $tempdir = '';
              if (!self::intValueSupported($end)) {
                  return false;
              }
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function MultiByteCharString2HTML has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') {
              $string = (string) $string; // in case trying to pass a numeric (float, int) string, would otherwise return an empty string
              $HTMLstring = '';
      
              switch ($charset) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method MultiByteCharString2HTML has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') {
              $string = (string) $string; // in case trying to pass a numeric (float, int) string, would otherwise return an empty string
              $HTMLstring = '';
      
              switch ($charset) {
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 3 hrs to fix

        Function BigEndian2Float has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function BigEndian2Float($byteword) {
                // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic
                // http://www.psc.edu/general/software/packages/ieee/ieee.html
                // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html
        
        
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 3 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method hash_data has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function hash_data($file, $offset, $end, $algorithm) {
                static $tempdir = '';
                if (!self::intValueSupported($end)) {
                    return false;
                }
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 2 hrs to fix

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

              public static function BigEndian2Float($byteword) {
                  // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic
                  // http://www.psc.edu/general/software/packages/ieee/ieee.html
                  // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html
          
          
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 2 hrs to fix

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

                public static function CopyFileParts($filename_source, $filename_dest, $offset, $length) {
                    if (!self::intValueSupported($offset + $length)) {
                        throw new Exception('cannot copy file portion, it extends beyond the '.round(PHP_INT_MAX / 1073741824).'GB limit');
                    }
                    if (is_readable($filename_source) && is_file($filename_source) && ($fp_src = fopen($filename_source, 'rb'))) {
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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 CopyTagsToComments has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function CopyTagsToComments(&$ThisFileInfo) {
            
                    // Copy all entries from ['tags'] into common ['comments']
                    if (!empty($ThisFileInfo['tags'])) {
                        foreach ($ThisFileInfo['tags'] as $tagtype => $tagarray) {
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 1 hr to fix

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

                  public static function BigEndian2Int($byteword, $synchsafe=false, $signed=false) {
                      $intvalue = 0;
                      $bytewordlen = strlen($byteword);
                      if ($bytewordlen == 0) {
                          return false;
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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 iconv_fallback has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function iconv_fallback($in_charset, $out_charset, $string) {
              
                      if ($in_charset == $out_charset) {
                          return $string;
                      }
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 1 hr to fix

                Method iconv_fallback_utf8_utf16be has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function iconv_fallback_utf8_utf16be($string, $bom=false) {
                        $newcharstring = '';
                        if ($bom) {
                            $newcharstring .= "\xFE\xFF";
                        }
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 1 hr to fix

                  Method iconv_fallback_utf8_iso88591 has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function iconv_fallback_utf8_iso88591($string) {
                          if (function_exists('utf8_decode')) {
                              return utf8_decode($string);
                          }
                          // utf8_decode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 1 hr to fix

                    Method iconv_fallback_utf8_utf16le has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function iconv_fallback_utf8_utf16le($string, $bom=false) {
                            $newcharstring = '';
                            if ($bom) {
                                $newcharstring .= "\xFF\xFE";
                            }
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 1 hr to fix

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

                          public static function iconv_fallback_utf8_utf16be($string, $bom=false) {
                              $newcharstring = '';
                              if ($bom) {
                                  $newcharstring .= "\xFE\xFF";
                              }
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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 iconv_fallback_utf8_iso88591 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function iconv_fallback_utf8_iso88591($string) {
                              if (function_exists('utf8_decode')) {
                                  return utf8_decode($string);
                              }
                              // utf8_decode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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 iconv_fallback_utf8_utf16le has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function iconv_fallback_utf8_utf16le($string, $bom=false) {
                              $newcharstring = '';
                              if ($bom) {
                                  $newcharstring .= "\xFF\xFE";
                              }
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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 PrintHexBytes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8') {
                              $returnstring = '';
                              for ($i = 0; $i < strlen($string); $i++) {
                                  if ($hex) {
                                      $returnstring .= str_pad(dechex(ord($string{$i})), 2, '0', STR_PAD_LEFT);
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 55 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          public static function getFileSizeSyscall($path) {
                              $filesize = false;
                      
                              if (GETID3_OS_ISWINDOWS) {
                                  if (class_exists('COM')) { // From PHP 5.3.15 and 5.4.5, COM and DOTNET is no longer built into the php core.you have to add COM support in php.ini:
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 45 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          public static function iconv_fallback($in_charset, $out_charset, $string) {
                      
                              if ($in_charset == $out_charset) {
                                  return $string;
                              }
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                          public static function EmbeddedLookup($key, $begin, $end, $file, $name) {
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 35 mins to fix

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

                            public static function IncludeDependency($filename, $sourcefile, $DieOnFailure=false) {
                                global $GETID3_ERRORARRAY;
                        
                                if (file_exists($filename)) {
                                    if (include_once($filename)) {
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                            public static function intValueSupported($num) {
                                // check if integers are 64-bit
                                static $hasINT64 = null;
                                if ($hasINT64 === null) { // 10x faster than is_null()
                                    $hasINT64 = is_int(pow(2, 31)); // 32-bit int are limited to (2^31)-1
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                            public static function array_merge_clobber($array1, $array2) {
                                // written by kcØhireability*com
                                // taken from http://www.php.net/manual/en/function.array-merge-recursive.php
                                if (!is_array($array1) || !is_array($array2)) {
                                    return false;
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                            public static function array_merge_noclobber($array1, $array2) {
                                if (!is_array($array1) || !is_array($array2)) {
                                    return false;
                                }
                                $newarray = $array1;
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                            public static function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) {
                                // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html
                                if (strpos($binarypointnumber, '.') === false) {
                                    $binarypointnumber = '0.'.$binarypointnumber;
                                } elseif ($binarypointnumber{0} == '.') {
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                            public static function Float2String($floatvalue, $bits) {
                                // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html
                                switch ($bits) {
                                    case 32:
                                        $exponentbits = 8;
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                            public static function array_max($arraydata, $returnkey=false) {
                                $maxvalue = false;
                                $maxkey = false;
                                foreach ($arraydata as $key => $value) {
                                    if (!is_array($value)) {
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                            public static function array_min($arraydata, $returnkey=false) {
                                $minvalue = false;
                                $minkey = false;
                                foreach ($arraydata as $key => $value) {
                                    if (!is_array($value)) {
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                            public static function BigEndian2String($number, $minbytes=1, $synchsafe=false, $signed=false) {
                                if ($number < 0) {
                                    throw new Exception('ERROR: self::BigEndian2String() does not support negative numbers');
                                }
                                $maskbyte = (($synchsafe || $signed) ? 0x7F : 0xFF);
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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

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

                            public static function fileextension($filename, $numextensions=1) {
                                if (strstr($filename, '.')) {
                                    $reversedfilename = strrev($filename);
                                    $offset = 0;
                                    for ($i = 0; $i < $numextensions; $i++) {
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.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 2 locations. Consider refactoring.
                        Open

                            public static function iconv_fallback_utf8_utf16le($string, $bom=false) {
                                $newcharstring = '';
                                if ($bom) {
                                    $newcharstring .= "\xFF\xFE";
                                }
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 2 days to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 772..812

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

                        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

                            public static function iconv_fallback_utf8_utf16be($string, $bom=false) {
                                $newcharstring = '';
                                if ($bom) {
                                    $newcharstring .= "\xFE\xFF";
                                }
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 2 days to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 815..855

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

                        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

                            public static function iconv_fallback_utf16le_iso88591($string) {
                                if (substr($string, 0, 2) == "\xFF\xFE") {
                                    // strip BOM
                                    $string = substr($string, 2);
                                }
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 2 hrs to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 891..902

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

                        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

                            public static function iconv_fallback_utf16be_iso88591($string) {
                                if (substr($string, 0, 2) == "\xFE\xFF") {
                                    // strip BOM
                                    $string = substr($string, 2);
                                }
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 2 hrs to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 905..916

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

                        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

                            public static function iconv_fallback_utf16le_utf8($string) {
                                if (substr($string, 0, 2) == "\xFF\xFE") {
                                    // strip BOM
                                    $string = substr($string, 2);
                                }
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 2 hrs to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 863..874

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

                        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

                            public static function iconv_fallback_utf16be_utf8($string) {
                                if (substr($string, 0, 2) == "\xFE\xFF") {
                                    // strip BOM
                                    $string = substr($string, 2);
                                }
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 2 hrs to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 877..888

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

                        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

                                    case 'UTF-16BE':
                                        for ($i = 0; $i < strlen($string); $i += 2) {
                                            $charval = self::BigEndian2Int(substr($string, $i, 2));
                                            if (($charval >= 32) && ($charval <= 127)) {
                                                $HTMLstring .= chr($charval);
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 1 hr to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 1052..1061

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

                        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

                                    case 'UTF-16LE':
                                        for ($i = 0; $i < strlen($string); $i += 2) {
                                            $charval = self::LittleEndian2Int(substr($string, $i, 2));
                                            if (($charval >= 32) && ($charval <= 127)) {
                                                $HTMLstring .= chr($charval);
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 1 hr to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 1063..1072

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

                        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

                            public static function array_min($arraydata, $returnkey=false) {
                                $minvalue = false;
                                $minkey = false;
                                foreach ($arraydata as $key => $value) {
                                    if (!is_array($value)) {
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 30 mins to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 493..505

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

                        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

                            public static function array_max($arraydata, $returnkey=false) {
                                $maxvalue = false;
                                $maxkey = false;
                                foreach ($arraydata as $key => $value) {
                                    if (!is_array($value)) {
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php and 1 other location - About 30 mins to fix
                        Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php on lines 507..519

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

                        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