chamilo/chamilo-lms

View on GitHub
public/main/exercise/export/scorm/ScormQuestion.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '74', column '37').
Open

                $this->answer = new ScormAnswerMultipleChoice($this->id);

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 '117', column '37').
Open

                $this->answer = new ScormAnswerHotspot($this->id);

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 '91', column '37').
Open

                $this->answer = new ScormAnswerMatching($this->id);

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 '112', column '37').
Open

                $this->answer = new ScormAnswerHotspot($this->id);

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 '56', column '31').
Open

        $assessmentItem = new ScormAssessmentItem($this);

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 '127', column '37').
Open

                $this->answer = new ScormAnswerMultipleChoice($this->id);

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 '107', column '37').
Open

                $this->answer = new ScormAnswerMultipleChoice($this->id);

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 '68', column '37').
Open

                $this->answer = new ScormAnswerMultipleChoice($this->id);

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

            throw new \Exception('Question not supported. Exercise: '.$this->selectTitle());

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 '79', column '37').
Open

                $this->answer = new ScormAnswerTrueFalse($this->id);

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 '102', column '37').
Open

                $this->answer = new ScormAnswerHotspot($this->id);

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 '84', column '37').
Open

                $this->answer = new ScormAnswerFillInBlanks($this->id);

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 '97', column '37').
Open

                $this->answer = new ScormAnswerFree($this->id);

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 '132', column '37').
Open

                $this->answer = new stdClass();

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 export 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('Question not supported. Exercise: '.$this->selectTitle());
        }

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

Avoid unused parameters such as '$form'.
Open

    public function createAnswersForm($form)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$form'.
Open

    public function processAnswersCreation($form, $exercise)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$exercise'.
Open

    public function processAnswersCreation($form, $exercise)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

The property $js_id is not named in camelCase.
Open

class ScormQuestion extends Question
{
    public $js_id;
    public $answer;

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

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

                $this->answer->questionJSId = $this->js_id;

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

                $this->answer->questionJSId = $this->js_id;

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

                $this->answer->questionJSId = $this->js_id;

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

                $this->answer->questionJSId = $this->js_id;

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

                $this->answer->questionJSId = $this->js_id;

Member variable "js_id" is not in valid camel caps format
Open

    public $js_id;

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

        $this->js_id = $jsId;

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

                $this->answer->questionJSId = $this->js_id;

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

                $this->answer->questionJSId = $this->js_id;

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

                $this->answer->questionJSId = $this->js_id;

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

                $this->answer->questionJSId = $this->js_id;

Missing function doc comment
Open

    public function createAnswersForm($form)

Missing function doc comment
Open

    public function processAnswersCreation($form, $exercise)

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

            questions.push('.$this->js_id.');

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

                $this->answer->questionJSId = $this->js_id;

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

                $this->answer->questionJSId = $this->js_id;

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

                $this->answer->questionJSId = $this->js_id;

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

                    $("#question_'.$this->js_id.'").shuffleRows();                    

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

        $js .= 'questions_score_max['.$this->js_id.'] = '.$weight.';';

There are no issues that match your filters.

Category
Status