chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/search/tool_processors/quiz_processor.class.php

Summary

Maintainability
A
0 mins
Test Coverage

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

            $score[$key] = $row['total_score'];

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

                        } else { // course not visible for user
                            if ($search_show_unlinked_results) {
                                $result['url'] = '';
                                $results[] = $result;
                            }

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

        } else {
            return [];
        }

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

FIXME found
Open

                $image = $thumbnail; //FIXME: use big images

The class quiz_processor is not named in CamelCase.
Open

class quiz_processor extends search_processor
{
    public $exercices = [];

    public function __construct($rows)

CamelCaseClassName

Since: 0.2

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

Example

class class_name {
}

Source

The parameter $exercise_id is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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

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

            $courseid = $row_val['courseid'];

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

                                'row_id' => $row_id,

Missing function doc comment
Open

    public function process()

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

                        foreach ($se_data['exercise_ids'] as $exercise_id) {

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

            $course_visible_for_user = api_is_course_visible_for_user(null, $courseid);

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

            $dk_result = $em

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

                    'id' => $exercise_id,

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

                        'ref' => $exercise_id,

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

                    $author = UserManager::formatUserFullName($item_result->getInsertUser());

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

                            $this->exercises[$courseid][$exercise_id]['total_score'] += $row_val['score'];

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

                        $url = sprintf($url, $courseid, $exercise_id);

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

            $se_data = $row_val['xapian_data'][SE_DATA];

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

            switch ($row_val['xapian_data'][SE_DATA]['type']) {

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

                                'total_score' => $row_val['score'],

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

                        list($thumbnail, $image, $name, $author) = $this->get_information($courseid, $exercise_id);

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

                $item_result = $em

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

                    $exercise_id = $se_data['exercise_id'];

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

                            $this->exercises[$courseid][$exercise_id]['total_score'] += $row_val['score'];

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

        $course_information = api_get_course_info($courseCode);

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

                    $this->exercises[$courseid][$exercise_id]['total_score'] += $row_val['score'];

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

                        foreach ($se_data['exercise_ids'] as $exercise_id) {

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

                foreach ($exercises as $exercise_id => $exercise) {

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

            if ($course_visible_for_user || $search_show_unlinked_results) {

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

        if (!empty($course_information)) {

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

                    $visibility = api_get_item_visibility(api_get_course_info($courseid), TOOL_QUIZ, $exercise_id);

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

                        if ($course_visible_for_user) {

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

    private function get_information($courseCode, $exercise_id)

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

                    $this->exercises[$courseid][$exercise_id] = $item;

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

                            $this->exercises[$courseid][$exercise_id] = $item;

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

                            if ($search_show_unlinked_results) {

Method name "quiz_processor::get_information" is not in camel caps format
Open

    private function get_information($courseCode, $exercise_id)

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

                    'cId' => $course_id,

Missing function doc comment
Open

    public function __construct($rows)

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

                        'row_id' => $row_id,

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

            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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

                if ($item_result) {

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

        foreach ($rows as $row_id => $row_val) {

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

                            $question = $se_data['question_id'];

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

        $course_id = $course_information['real_id'];

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

            $exercise_id = intval($exercise_id);

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

                    if (is_array($se_data['exercise_ids'])) {

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

                        'course' => $course_id,

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

        foreach ($rows as $row_id => $row_val) {

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

                        'total_score' => $row_val['score'],

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

            $se_data = $row_val['xapian_data'][SE_DATA];

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

                    $exercise_id = $se_data['exercise_id'];

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

                    $this->exercises[$courseid][$exercise_id]['total_score'] += $row_val['score'];

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

            if ($course_visible_for_user || $search_show_unlinked_results) {

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

            if ($dk_result) {

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

                $name = $dk_result->getTitle();

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

        $course_id = $course_information['real_id'];

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

            $exercise_id = intval($exercise_id);

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

class quiz_processor extends search_processor

The variable $row_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $item_result is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $se_data is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $course_id is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $course_id is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $exercise_id is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 $search_show_unlinked_results is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 $course_information is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $row_val is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $row_val is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $course_information is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $row_val is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $se_data is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $exercise_id is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 $se_data is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $se_data is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $exercise_id is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $row_val is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $exercise_id is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 $course_information is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $dk_result is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $row_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $exercise_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $dk_result is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $exercise_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $exercise_id is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $item_result is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $row_val is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $exercise_id is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $exercise_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $exercise_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $row_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $search_show_unlinked_results is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 $exercise_id is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $exercise_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $course_visible_for_user is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 $course_id is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $item_result is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $course_visible_for_user is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 $row_val is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $search_show_unlinked_results is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 $course_visible_for_user is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 $dk_result is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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 $row_val is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $exercise_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $row_val is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $se_data is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;
        // group by exercise
        foreach ($rows as $row_id => $row_val) {

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 $exercise_id is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->exercises as $courseid => $exercises) {
            $search_show_unlinked_results = ('true' == api_get_setting('search_show_unlinked_results'));

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 get_information is not named in camelCase.
Open

    private function get_information($courseCode, $exercise_id)
    {
        $course_information = api_get_course_info($courseCode);
        $course_id = $course_information['real_id'];

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