hnhdigital-os/php-linode-api

View on GitHub

Showing 224 of 224 total issues

Avoid using undefined variables such as '$linode_id' which will lead to PHP notices.
Open

            'linode_id' => $linode_id,
Severity: Minor
Found in src/endpoints/Linode/Instance.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$linode_id' which will lead to PHP notices.
Open

            'linode_id' => $linode_id,
Severity: Minor
Found in src/endpoints/Linode/Instance.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$linode_id' which will lead to PHP notices.
Open

            'linode_id' => $linode_id,
Severity: Minor
Found in src/endpoints/Linode/Instance.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$node_balancer_id' which will lead to PHP notices.
Open

            'node_balancer_id' => $node_balancer_id,

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$volume_id' which will lead to PHP notices.
Open

            'volume_id' => $volume_id,
Severity: Minor
Found in src/endpoints/Volume.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$volume_id' which will lead to PHP notices.
Open

            'volume_id' => $volume_id,
Severity: Minor
Found in src/endpoints/Volume.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$domain_id' which will lead to PHP notices.
Open

            'domain_id' => $domain_id,
Severity: Minor
Found in src/endpoints/Domain.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$linode_id' which will lead to PHP notices.
Open

            'linode_id' => $linode_id,
Severity: Minor
Found in src/endpoints/Linode/Instance.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$linode_id' which will lead to PHP notices.
Open

            'linode_id' => $linode_id,
Severity: Minor
Found in src/endpoints/Linode/Instance.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$ticket_id' which will lead to PHP notices.
Open

            'ticket_id' => $ticket_id,
Severity: Minor
Found in src/endpoints/Support/Ticket.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$linode_id' which will lead to PHP notices.
Open

            'linode_id' => $linode_id,
Severity: Minor
Found in src/endpoints/Linode/Instance.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$linode_id' which will lead to PHP notices.
Open

            'linode_id' => $linode_id,
Severity: Minor
Found in src/endpoints/Linode/Instance.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php

namespace HnhDigital\LinodeApi;

/*
Severity: Minor
Found in src/endpoints/Account.php and 1 other location - About 1 hr to fix
src/endpoints/Account/Settings.php on lines 1..68

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 100.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php

namespace HnhDigital\LinodeApi\Account;

/*
Severity: Minor
Found in src/endpoints/Account/Settings.php and 1 other location - About 1 hr to fix
src/endpoints/Account.php on lines 1..67

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 100.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Avoid classes with short names like Ip. Configured minimum length is 3.
Open

class Ip extends Base
{
    /**
     * Endpoint.
     *
Severity: Minor
Found in src/endpoints/Networking/Ip.php by phpmd

ShortClassName

Since: 2.9

Detects when classes or interfaces have a very short name.

Example

class Fo {

}

interface Fo {

}

Source https://phpmd.org/rules/naming.html#shortclassname

Avoid classes with short names like Ip. Configured minimum length is 3.
Open

class Ip extends Base
{
    /**
     * Endpoint.
     *
Severity: Minor
Found in src/endpoints/Linode/Instances/Ip.php by phpmd

ShortClassName

Since: 2.9

Detects when classes or interfaces have a very short name.

Example

class Fo {

}

interface Fo {

}

Source https://phpmd.org/rules/naming.html#shortclassname

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

    public function __construct(...$args)
    {
        // Model is set be fillable, last item is our fill data or
        // indicator to run the fill method.
        if ($this->fillable) {
Severity: Minor
Found in src/foundation/Base.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

Blank line found at start of control structure
Open

        try {

Blank line found at start of control structure
Open

        if ($this->fillable) {
Severity: Minor
Found in src/foundation/Base.php by phpcodesniffer

Blank line found at start of control structure
Open

        foreach ($current_result['data'] as $entry) {
Severity: Minor
Found in src/foundation/ApiSearch.php by phpcodesniffer
Severity
Category
Status
Source
Language