madeITBelgium/Laravel-VestaCP

View on GitHub
src/Command/Domain.php

Summary

Maintainability
C
1 day
Test Coverage

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

    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 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 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 createDNSRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function createDNSRecord($user, $domain, $record, $type, $value, $priority = null, $id = null, $restart = null)
                    {
                        $request = [$user, $domain, $record, $type, $value];
                        if (!empty($priority)) {
                            $request[] = $priority;
                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

                There are no issues that match your filters.

                Category
                Status