chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/Compilatio.php

Summary

Maintainability
A
0 mins
Test Coverage

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

                throw new Exception('API key not available');
Severity: Minor
Found in public/main/inc/lib/Compilatio.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 '41', column '23').
Open

            throw new Exception('Compilatio config available');
Severity: Minor
Found in public/main/inc/lib/Compilatio.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 '74', column '42').
Open

                    $this->soapcli = new SoapClient($urlsoap, $param);
Severity: Minor
Found in public/main/inc/lib/Compilatio.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 '76', column '31').
Open

                    throw new Exception('WS urlsoap not available');
Severity: Minor
Found in public/main/inc/lib/Compilatio.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 '33', column '23').
Open

            throw new Exception('Compilatio not available');
Severity: Minor
Found in public/main/inc/lib/Compilatio.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

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

                    } else {
                        $param = [
                            'trace' => false,
                            'soap_version' => $soapVersion,
                            'exceptions' => true,
Severity: Minor
Found in public/main/inc/lib/Compilatio.php by phpmd

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 __construct 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('WS urlsoap not available');
                }
Severity: Minor
Found in public/main/inc/lib/Compilatio.php by phpmd

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 __construct 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('API key not available');
            }
Severity: Minor
Found in public/main/inc/lib/Compilatio.php by phpmd

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 giveWorkIdState uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                // if the compilatio's hash is not a valide hash md5,
                // we return à specific status (cf : IsInCompilatio() )
                $status = 'NOT_IN_COMPILATIO';
                $actionCompilatio = get_lang('Verify that it contains text (and not only images)').'<br/>'.
Severity: Minor
Found in public/main/inc/lib/Compilatio.php by phpmd

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 getPomprankBarv31 uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            if ($index >= $weakThreshold && $index < $highThreshold) {
                $class = 'warning';
            }
        }
Severity: Minor
Found in public/main/inc/lib/Compilatio.php by phpmd

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 __construct 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('Compilatio config available');
        }
Severity: Minor
Found in public/main/inc/lib/Compilatio.php by phpmd

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

Missing parameter name
Open

     * @param $filename

Missing parameter name
Open

     * @param $compiHash

Missing parameter name
Open

     * @param $content

Missing parameter name
Open

     * @param $filename

Multi-line function call not indented correctly; expected 24 spaces but found 28
Open

                            $soapRes->documentStatus->indice,

Missing parameter name
Open

     * @param $mimeType

Missing parameter name
Open

     * @param $compiHash

Missing parameter name
Open

     * @param $highThreshold

Missing parameter name
Open

     * @param $description

Multi-line function call not indented correctly; expected 20 spaces but found 24
Open

                        )

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

            return (string) $result->compilatio_id;

Missing parameter name
Open

     * @param $compiHash

Missing parameter name
Open

     * @param $compiHash

Missing parameter name
Open

     * @param $index

Missing parameter name
Open

     * @param $weakThreshold

Missing parameter name
Open

     * @param $title

Multi-line function call not indented correctly; expected 24 spaces but found 28
Open

                            10,

Multi-line function call not indented correctly; expected 24 spaces but found 28
Open

                            35

Multi-line function call not indented correctly; expected 24 spaces but found 28
Open

                            35

Multi-line function call not indented correctly; expected 20 spaces but found 24
Open

                        )

Multi-line function call not indented correctly; expected 24 spaces but found 28
Open

                            $soapRes->documentStatus->indice,

Multi-line function call not indented correctly; expected 24 spaces but found 28
Open

                            10,

There are no issues that match your filters.

Category
Status