chamilo/chamilo-lms

View on GitHub
public/plugin/bbb/lib/vm/DigitalOceanVM.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '61', column '31').
Open

                    throw new \Exception('Sizes are not well configured');

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '64', column '27').
Open

                throw new \Exception('Sizes not available');

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '98', column '27').
Open

                throw new \Exception(' Id '.$this->vmId." doesn't exists.");

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The method resizeTo uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                throw new \Exception('Sizes not available');
            }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

The method resizeTo uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                        } else {
                            $this->resize($this->vmMaxSize);
                        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

The method resizeTo uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                        } else {
                            $this->resize($this->vmMinSize);
                        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

The method resizeTo uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                throw new \Exception(' Id '.$this->vmId." doesn't exists.");
            }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Variable "event_id" is not in valid camel caps format
Open

        $this->waitForEvent($resizeDroplet->event_id);

Missing function doc comment
Open

    public function resizeToMaxLimit()

Missing function doc comment
Open

    public function resizeToMinLimit()

Missing function doc comment
Open

    public function runCron()

Missing function doc comment
Open

    public function __construct($settings)

Variable "event_id" is not in valid camel caps format
Open

        $this->waitForEvent($powerOn->event_id);

Variable "event_id" is not in valid camel caps format
Open

        $this->waitForEvent($powerOff->event_id);

Missing function doc comment
Open

    public function connect()

There are no issues that match your filters.

Category
Status