CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php

Summary

Maintainability
F
5 days
Test Coverage

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

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

        $info['fileformat'] = 'ogg';

Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 1 day to fix

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

        public function Analyze() {
            $info = &$this->getid3->info;
    
            $info['fileformat'] = 'ogg';
    
    
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function ParseVorbisComments has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

        public function ParseVorbisComments() {
            $info = &$this->getid3->info;
    
            $OriginalOffset = $this->ftell();
            $commentdataoffset = 0;
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 7 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

    File module.audio.ogg.php has 483 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: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 7 hrs to fix

      Method ParseVorbisComments has 145 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function ParseVorbisComments() {
              $info = &$this->getid3->info;
      
              $OriginalOffset = $this->ftell();
              $commentdataoffset = 0;
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 5 hrs to fix

        Method ParseVorbisPageHeader has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function ParseVorbisPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) {
                $info = &$this->getid3->info;
                $info['audio']['dataformat'] = 'vorbis';
                $info['audio']['lossless']   = false;
        
        
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 1 hr to fix

          Method ParseOggPageHeader has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function ParseOggPageHeader() {
                  // http://xiph.org/ogg/vorbis/doc/framing.html
                  $oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file
          
                  $filedata = $this->fread($this->getid3->fread_buffer_size());
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 1 hr to fix

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

                public function ParseOggPageHeader() {
                    // http://xiph.org/ogg/vorbis/doc/framing.html
                    $oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file
            
                    $filedata = $this->fread($this->getid3->fread_buffer_size());
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.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 OggPageSegmentLength has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function OggPageSegmentLength($OggInfoArray, $SegmentNumber=1) {
                    for ($i = 0; $i < $SegmentNumber; $i++) {
                        $segmentlength = 0;
                        foreach ($OggInfoArray['segment_table'] as $key => $value) {
                            $segmentlength += $value;
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.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 false;
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return true;
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.ogg.php - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status