chamilo/chamilo-lms

View on GitHub
public/main/lp/scormMetadata.class.php

Summary

Maintainability
A
0 mins
Test Coverage

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 {
                                        $this->text[$element->tagName] = $child->textContent;
                                    }

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 class scormMetadata is not named in CamelCase.
Open

class scormMetadata
{
    public $lom = '';
    public $schema = '';
    public $schemaversion = '';

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Spaces must be used for alignment; tabs are not allowed
Open

     * @param    mixed    Depending on the type, can be the DB ID of the learnpath item or

Missing parameter name
Open

     * @param    string    Type of creation required. Can be 'db' or 'manifest' (default)

Spaces must be used for alignment; tabs are not allowed
Open

     * @param    string    Type of creation required. Can be 'db' or 'manifest' (default)

Missing parameter name
Open

     * @param    mixed    Depending on the type, can be the DB ID of the learnpath item or

Spaces must be used for alignment; tabs are not allowed
Open

     * @param    mixed    Depending on the type, can be the DB ID of the learnpath item or

Spaces must be used for alignment; tabs are not allowed
Open

     * @param    string    Type of creation required. Can be 'db' or 'manifest' (default)

Arguments with default values must be at the end of the argument list
Open

    public function __construct($type = 'manifest', &$element)

Class name "scormMetadata" is not in camel caps format
Open

class scormMetadata

There are no issues that match your filters.

Category
Status