chamilo/chamilo-lms

View on GitHub
src/CourseBundle/Component/CourseCopy/Resources/QuizQuestion.php

Summary

Maintainability
A
0 mins
Test Coverage

The method __construct has 10 parameters. Consider reducing the number of parameters to less than 10.
Open

    public function __construct(
        $id,
        $question,
        $description,
        $ponderation,

Avoid using undefined variables such as '$itemsToAdd' which will lead to PHP notices.
Open

                $itemsToAdd[] = $pictureId;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$itemsToAdd' which will lead to PHP notices.
Open

                $courseBuilder->build_documents(api_get_session_id(), $courseId, false, $itemsToAdd);

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$itemsToAdd' which will lead to PHP notices.
Open

                            $itemsToAdd[] = $parent['id'];

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

The property $quiz_type is not named in camelCase.
Open

class QuizQuestion extends Resource
{
    /**
     * The question.
     */

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $question_category is not named in camelCase.
Open

    public function __construct(
        $id,
        $question,
        $description,
        $ponderation,

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $answer_text is not named in camelCase.
Open

    public function add_answer(
        $answer_id,
        $answer_text,
        $correct,
        $comment,

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $hotspot_type is not named in camelCase.
Open

    public function add_answer(
        $answer_id,
        $answer_text,
        $correct,
        $comment,

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The property $question_category is not named in camelCase.
Open

class QuizQuestion extends Resource
{
    /**
     * The question.
     */

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $hotspot_coordinates is not named in camelCase.
Open

    public function add_answer(
        $answer_id,
        $answer_text,
        $correct,
        $comment,

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $answer_id is not named in camelCase.
Open

    public function add_answer(
        $answer_id,
        $answer_text,
        $correct,
        $comment,

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The variable $question_category is not named in camelCase.
Open

    public function __construct(
        $id,
        $question,
        $description,
        $ponderation,

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $answer_text is not named in camelCase.
Open

    public function add_answer(
        $answer_id,
        $answer_text,
        $correct,
        $comment,

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $hotspot_type is not named in camelCase.
Open

    public function add_answer(
        $answer_id,
        $answer_text,
        $correct,
        $comment,

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $answer_id is not named in camelCase.
Open

    public function add_answer(
        $answer_id,
        $answer_text,
        $correct,
        $comment,

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $hotspot_coordinates is not named in camelCase.
Open

    public function add_answer(
        $answer_id,
        $answer_text,
        $correct,
        $comment,

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The method add_answer is not named in camelCase.
Open

    public function add_answer(
        $answer_id,
        $answer_text,
        $correct,
        $comment,

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method add_option is not named in camelCase.
Open

    public function add_option($option)
    {
        $this->question_options[$option->obj->id] = $option;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status