tabuna/VestaAPI

View on GitHub

Showing 10 of 10 total issues

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

    public static function render(Exception $e)
    {
        switch ($e->message) {
            case 1:
                $return = redirect()->back()->withErrors(['Not enough arguments provided']);
Severity: Minor
Found in src/Exceptions/VestaExceptions.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 render has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function render(Exception $e)
    {
        switch ($e->message) {
            case 1:
                $return = redirect()->back()->withErrors(['Not enough arguments provided']);
Severity: Major
Found in src/Exceptions/VestaExceptions.php - About 2 hrs to fix

    Method send has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function send($cmd)
        {
            $postVars = [
                'user'       => $this->userName,
                'password'   => $this->key,
    Severity: Minor
    Found in src/Services/VestaAPI.php - About 1 hr to fix

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

          public function editCron($job, $min, $hour, $day, $month, $wday, $cmd)
      Severity: Major
      Found in src/Services/Cron.php - About 50 mins to fix

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

            public function addDNSDomain($domain, $ip, $ns1, $ns2, $ns3 = null, $ns4 = null)
        Severity: Minor
        Found in src/Services/DNS.php - About 45 mins to fix

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

              public function regUser($username, $password, $email, $package, $fistName, $lastName)
          Severity: Minor
          Found in src/Services/User.php - About 45 mins to fix

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

                public function addCron($min, $hour, $day, $month, $wday, $cmd)
            Severity: Minor
            Found in src/Services/Cron.php - About 45 mins to fix

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

                  public function addDNSRecord($domain, $rec, $type, $val, $priority)
              Severity: Minor
              Found in src/Services/DNS.php - About 35 mins to fix

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

                    public function addDateBase($database, $dbuser, $password, $type, $charset)
                Severity: Minor
                Found in src/Services/BD.php - About 35 mins to fix

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

                      public function send($cmd)
                      {
                          $postVars = [
                              'user'       => $this->userName,
                              'password'   => $this->key,
                  Severity: Minor
                  Found in src/Services/VestaAPI.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