madeITBelgium/Laravel-VestaCP

View on GitHub

Showing 22 of 22 total issues

User has 114 functions (exceeds 20 allowed). Consider refactoring.
Open

class User
{
    use DateTime;

    private $username;
Severity: Major
Found in src/Object/User.php - About 2 days to fix

    File User.php has 589 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace MadeITBelgium\VestaCP\Object;
    
    /**
    Severity: Major
    Found in src/Object/User.php - About 1 day to fix

      WebDomain has 37 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class WebDomain
      {
          use GeneralDomain;
          use DateTime;
      
      
      Severity: Minor
      Found in src/Object/WebDomain.php - About 4 hrs to fix

        Sys has 33 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Sys
        {
            private $vestacp;
        
            /**
        Severity: Minor
        Found in src/Command/Sys.php - About 4 hrs to fix

          Domain has 29 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Domain
          {
              private $vestacp;
          
              /**
          Severity: Minor
          Found in src/Command/Domain.php - About 3 hrs to fix

            Function checkResultCode has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                private function checkResultCode($output)
                {
                    switch ($output) {
                        case 0: return true; break; //Command Successful
            
            
            Severity: Minor
            Found in src/VestaCP.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 parseUser has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function parseUser($username, $user)
                {
                    $obj = new self();
                    $obj->setUsername($username);
                    $obj->setFirstName($user['FNAME']);
            Severity: Major
            Found in src/Object/User.php - About 2 hrs to fix

              Method call has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function call($command, $returnCode = '', $parameters = [])
                  {
                      $requestData = [
                          'hash'       => $this->hash,
                          'cmd'        => $command,
              Severity: Minor
              Found in src/VestaCP.php - About 1 hr to fix

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

                    private function parseWebDomain($domainname, $data)
                    {
                        $obj = new self();
                        $obj->setDomainname($domainname);
                        $obj->setIp($data['IP']);
                Severity: Minor
                Found in src/Object/WebDomain.php - About 1 hr to fix

                  Method createDNSRecord has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function createDNSRecord($user, $domain, $record, $type, $value, $priority = null, $id = null, $restart = null)
                  Severity: Major
                  Found in src/Command/Domain.php - About 1 hr to fix

                    Method create has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function create($user, $database, $dbuser, $dbpass, $type = null, $host = null, $charset = null)
                    Severity: Major
                    Found in src/Command/Database.php - About 50 mins to fix

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

                          public function call($command, $returnCode = '', $parameters = [])
                          {
                              $requestData = [
                                  'hash'       => $this->hash,
                                  'cmd'        => $command,
                      Severity: Minor
                      Found in src/VestaCP.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 createDNS has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function createDNS($user, $domain, $ip, $ipv6, $ns = [], $restart = null)
                      Severity: Minor
                      Found in src/Command/Domain.php - About 45 mins to fix

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

                            public function create($user, $password, $email, $package = null, $firstname = null, $lastname = null)
                        Severity: Minor
                        Found in src/Command/User.php - About 45 mins to fix

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

                              public function changeDNSRecord($user, $domain, $id, $value, $priority = null)
                          Severity: Minor
                          Found in src/Command/Domain.php - About 35 mins to fix

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

                                public function create($user, $domain, $ip = null, $ipv6 = null, $restart = null)
                            Severity: Minor
                            Found in src/Command/Domain.php - About 35 mins to fix

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

                                  public function createFtp($user, $domain, $ftp_user, $ftp_password, $ftp_path = null)
                              Severity: Minor
                              Found in src/Command/Domain.php - About 35 mins to fix

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

                                    public function createMailAccount($user, $domain, $account, $password, $quota = null)
                                Severity: Minor
                                Found in src/Command/Domain.php - About 35 mins to fix

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

                                      public function create($user, $domain, $ip = null, $ipv6 = null, $restart = null)
                                      {
                                          $request = [$user, $domain];
                                          if (!empty($ip)) {
                                              $request[] = $ip;
                                  Severity: Minor
                                  Found in src/Command/Domain.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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function create($user, $database, $dbuser, $dbpass, $type = null, $host = null, $charset = null)
                                      {
                                          $request = [$user, $database, $dbuser, $dbpass];
                                          if ($type != null) {
                                              $request[] = $type;
                                  Severity: Minor
                                  Found in src/Command/Database.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language