detain/myadmin-plesk-webhosting

View on GitHub

Showing 102 of 102 total issues

Missing class import via use statement (line '2538', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '1935', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '24', column '16').
Open

    return new \Detain\MyAdminPlesk\Plesk($ip, $pleskUser, $pleskPass);
Severity: Minor
Found in src/get_webhosting_plesk_instance.php by phpmd

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 '1785', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '1863', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '1899', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '464', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '2263', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '846', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '1631', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '500', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '2014', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '737', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '2438', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '902', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '2057', column '23').
Open

        $xmldoc = new \DomDocument('1.0', 'UTF-8');
Severity: Minor
Found in src/Plesk.php by phpmd

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 '81', column '27').
Open

                throw new \Exception('Failed getting server information.'.(isset($result['errtext']) ? ' Error message was: '.$result['errtext'].'.' : ''));
Severity: Minor
Found in src/Plugin.php by phpmd

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

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

    public function deleteClient($params)
    {
        $xmldoc = new \DomDocument('1.0', 'UTF-8');
        $xmldoc->formatOutput = true;
        $packet = $xmldoc->createElement('packet');
Severity: Minor
Found in src/Plesk.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 createCustomer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function createCustomer($username, $password, $data)
    {
        $xmldoc = new \DomDocument('1.0', 'UTF-8');
        $xmldoc->formatOutput = true;

Severity: Minor
Found in src/Plesk.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 Plesk has 2553 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class Plesk
{
    public $curl;
    private $host;
    private $login;
Severity: Minor
Found in src/Plesk.php by phpmd
Severity
Category
Status
Source
Language