hnhdigital-os/php-virtualmin-api

View on GitHub

Showing 7 of 137 total issues

VirtualServersClient has 63 functions (exceeds 20 allowed). Consider refactoring.
Open

class VirtualServersClient extends VirtualminClient
{

    /**
     * Clone Domain.
Severity: Major
Found in src/VirtualServersClient.php - About 1 day to fix

    File VirtualServersClient.php has 508 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace HnhDigital\Virtualmin;
    
    class VirtualServersClient extends VirtualminClient
    Severity: Major
    Found in src/VirtualServersClient.php - About 1 day to fix

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

          protected function call($program, $parameters = [])
          {
              $url = sprintf('%s://%s:%s/virtual-server/remote.cgi?program=%s&json=1', $this->mode, $this->server, $this->port, $program);
      
              foreach ($parameters as $key => &$value) {
      Severity: Minor
      Found in src/VirtualminClient.php - About 1 hr to fix

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

            protected function call($program, $parameters = [])
            {
                $url = sprintf('%s://%s:%s/virtual-server/remote.cgi?program=%s&json=1', $this->mode, $this->server, $this->port, $program);
        
                foreach ($parameters as $key => &$value) {
        Severity: Minor
        Found in src/VirtualminClient.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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function create($domain, $password, array $options = [])
            {
                $parameters = [];
                $parameters['domain'] = $domain;
                $parameters['pass'] = $password;
        Severity: Minor
        Found in src/VirtualServersClient.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 createChild has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function createChild($parent_domain, $domain, $password, array $options = [])
            {
                $parameters = [];
                $parameters['parent '] = $parent_domain;
                $parameters['domain'] = $domain;
        Severity: Minor
        Found in src/VirtualServersClient.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 createAlias has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function createAlias($parent_domain, $domain, array $options = [])
            {
                $parameters = [];
                $parameters['alias'] = $parent_domain;
                $parameters['domain'] = $domain;
        Severity: Minor
        Found in src/VirtualServersClient.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