hnhdigital-os/php-virtualmin-api

View on GitHub

Showing 137 of 137 total issues

The method disableWeb has a boolean flag argument $domain, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function disableWeb($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method enableStatus has a boolean flag argument $user, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function enableStatus($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method enableWebmin has a boolean flag argument $domain, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function enableWebmin($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method enableSvn has a boolean flag argument $domain, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function enableSvn($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

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

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 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

The class VirtualServersClient has 1138 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class VirtualServersClient extends VirtualminClient
{

    /**
     * Clone Domain.
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

Avoid unused parameters such as '$user'.
Open

    public function disableWebmin($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$user'.
Open

    public function enableAwstats($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$options'.
Open

    public function notifyDomains(array $options = [])
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$user'.
Open

    public function disableUnix($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$user'.
Open

    public function disableMail($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$user'.
Open

    public function enableSpam($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$options'.
Open

    public function modifyDomain(array $options = [])
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$options'.
Open

    public function modifyWeb(array $options = [])
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$user'.
Open

    public function enableWebmin($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$options'.
Open

    public function migrateDomain(array $options = [])
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$user'.
Open

    public function enableDir($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$user'.
Open

    public function enableWeb($domain = false, $user = false)
Severity: Minor
Found in src/VirtualServersClient.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Severity
Category
Status
Source
Language