CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/class-pop3.php

Summary

Maintainability
F
4 days
Test Coverage

File class-pop3.php has 483 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * mail_fetch/setup.php
 *
 * @package SquirrelMail
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 7 hrs to fix

    Function uidl has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        function uidl ($msgNum = "")
        {
            //  Returns the UIDL of the msg specified. If called with
            //  no arguments, returns an associative array where each
            //  undeleted msg num is a key, and the msg's uidl is the element
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method pop_list has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function pop_list ($msgNum = "") {
            //  If called with an argument, returns that msgs' size in octets
            //  No argument returns an associative array of undeleted
            //  msg numbers and their sizes in octets
    
    
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 2 hrs to fix

      Function pop_list has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          function pop_list ($msgNum = "") {
              //  If called with an argument, returns that msgs' size in octets
              //  No argument returns an associative array of undeleted
              //  msg numbers and their sizes in octets
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          function uidl ($msgNum = "")
          {
              //  Returns the UIDL of the msg specified. If called with
              //  no arguments, returns an associative array where each
              //  undeleted msg num is a key, and the msg's uidl is the element
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 2 hrs to fix

        Function parse_banner has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            function parse_banner ( $server_text ) {
                $outside = true;
                $banner = "";
                $length = strlen($server_text);
                for($count =0; $count < $length; $count++)
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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 apop has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            function apop ($login,$pass) {
                //  Attempts an APOP login. If this fails, it'll
                //  try a standard login. YOUR SERVER MUST SUPPORT
                //  THE USE OF THE APOP COMMAND!
                //  (apop is optional per rfc1939)
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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 apop has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function apop ($login,$pass) {
                //  Attempts an APOP login. If this fails, it'll
                //  try a standard login. YOUR SERVER MUST SUPPORT
                //  THE USE OF THE APOP COMMAND!
                //  (apop is optional per rfc1939)
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 1 hr to fix

          Method top has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function top ($msgNum, $numLines = "0") {
                  //  Gets the header and first $numLines of the msg body
                  //  returns data in an array with each returned line being
                  //  an array element. If $numLines is empty, returns
                  //  only the header information, and none of the body.
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 1 hr to fix

            Method connect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function connect ($server, $port = 110)  {
                    //  Opens a socket to the specified server. Unless overridden,
                    //  port defaults to 110. Returns true on success, false on fail
            
                    // If MAILSERVER is set, override $server with it's value
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 1 hr to fix

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

                  function login ($login = "", $pass = "") {
                      // Sends both user and pass. Returns # of msgs in mailbox or
                      // false on failure (or -1, if the error occurs while getting
                      // the number of messages.)
              
              
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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 get has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function get ($msgNum) {
                      //  Retrieve the specified msg number. Returns an array
                      //  where each line of the msg is an array element.
              
                      if(!isset($this->FP))
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 1 hr to fix

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

                    function get ($msgNum) {
                        //  Retrieve the specified msg number. Returns an array
                        //  where each line of the msg is an array element.
                
                        if(!isset($this->FP))
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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 top has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    function top ($msgNum, $numLines = "0") {
                        //  Gets the header and first $numLines of the msg body
                        //  returns data in an array with each returned line being
                        //  an array element. If $numLines is empty, returns
                        //  only the header information, and none of the body.
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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 connect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    function connect ($server, $port = 110)  {
                        //  Opens a socket to the specified server. Unless overridden,
                        //  port defaults to 110. Returns true on success, false on fail
                
                        // If MAILSERVER is set, override $server with it's value
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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/class-pop3.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                      return $count;
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return $size;
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $MsgArray;
                      Severity: Major
                      Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return $retVal;
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                              return $retVal;
                          Severity: Major
                          Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return false;
                            Severity: Major
                            Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return $UIDLArray;
                              Severity: Major
                              Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return false;
                                Severity: Major
                                Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.php - About 30 mins to fix

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

                                      function user ($user = "") {
                                          // Sends the USER command, returns true or false
                                  
                                          if( empty($user) ) {
                                              $this->ERROR = "POP3 user: " . _("no login ID submitted");
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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 pass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      function pass ($pass = "")     {
                                          // Sends the PASS command, returns # of msgs in mailbox,
                                          // returns false (undef) on Auth failure
                                  
                                          if(empty($pass)) {
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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 POP3 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      function POP3 ( $server = '', $timeout = '' ) {
                                          settype($this->BUFFER,"integer");
                                          if( !empty($server) ) {
                                              // Do not allow programs to alter MAILSERVER
                                              // if it is already specified. They can get around
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/class-pop3.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

                                  There are no issues that match your filters.

                                  Category
                                  Status