chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/search/tool_processors/link_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['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_tmp['url'] = '';
                                $result = $result_tmp;
                            }

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

Avoid assigning values to variables in if clauses and the like (line '110', column '17').
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['id'];

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

FIXME found
Open

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

The class link_processor is not named in CamelCase.
Open

class link_processor extends search_processor
{
    public $links = [];

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

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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

The parameter $link_id is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 "course_visible_for_user" is not in valid camel caps format
Open

            $course_visible_for_user = api_is_course_visible_for_user(null, $courseCode);

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

                                $result = $result_tmp;

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

        $course_id = $course_information['real_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_property_table" is not in valid camel caps format
Open

            $item_property_table = Database::get_course_table(TABLE_ITEM_PROPERTY);

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

            $link_id = intval($link_id);

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

            $courseid = $row_val['courseid'];

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

                    $visibility = api_get_item_visibility($course_info, TOOL_LINK, $one_link['link_id']);

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

                      WHERE ref = $link_id AND tool = '".TOOL_LINK."' AND c_id = $course_id

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

                foreach ($one_course_links['links'] as $one_link) {

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

                        list($thumbnail, $image, $name, $author, $url) = $this->get_information($courseCode, $one_link['link_id']);

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

                        if ($course_visible_for_user) {

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

    private function get_information($course_id, $link_id)

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

        if (!empty($course_information)) {

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

                foreach ($one_course_links['links'] as $one_link) {

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

        $course_information = api_get_course_info($course_id);

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

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

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

        foreach ($this->links as $courseCode => $one_course_links) {

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

                'link_id' => $link_id,

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

                'row_id' => $row_id,

Missing function doc comment
Open

    public function process()

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

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

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

    private function get_information($course_id, $link_id)

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

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

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

        $course_id_alpha = $course_information['id'];

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

            $course_info = api_get_course_info($courseCode);

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

                $author = api_get_person_name($user_data['firstName'], $user_data['lastName']);

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

    private function get_information($course_id, $link_id)

Missing function doc comment
Open

    public function __construct($rows)

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

        $course_id = $course_information['real_id'];

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

            $link_id = intval($link_id);

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

            $url = sprintf($url, $course_id_alpha);

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

            if ($row = Database::fetch_array($item_result)) {

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

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

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

                    $visibility = api_get_item_visibility($course_info, TOOL_LINK, $one_link['link_id']);

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

        $course_information = api_get_course_info($course_id);

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

        $course_id_alpha = $course_information['id'];

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

                        $result_tmp = [

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

                            if ($search_show_unlinked_results) {

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

            $item_result = Database::query($sql);

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

                $user_data = api_get_user_info($row['insert_user_id']);

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

            if ($course_visible_for_user || $search_show_unlinked_results) {

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

            $sql = "SELECT insert_user_id FROM $item_property_table

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

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

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

                            $result = $result_tmp;

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

                      WHERE ref = $link_id AND tool = '".TOOL_LINK."' AND c_id = $course_id

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

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

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

            if ($course_visible_for_user || $search_show_unlinked_results) {

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

                            'score' => $one_course_links['total_score'] / (count($one_course_links) - 1), // not count total_score array item

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

                            'score' => $one_course_links['total_score'] / (count($one_course_links) - 1), // not count total_score array item

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

                                $result_tmp['url'] = '';

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

                $author = api_get_person_name($user_data['firstName'], $user_data['lastName']);

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

class link_processor extends search_processor

The variable $course_information is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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_information is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $result_tmp is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $user_data is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 all links together

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 all links together

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->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $search_show_unlinked_results is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $link_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;

        // group all links together

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 all links together

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 all links together

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 all links together

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 all links together

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $link_id is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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_property_table is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $link_id is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 all links together

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($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $one_link is not named in camelCase.
Open

    public function process()
    {
        $results = [];
        foreach ($this->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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_alpha is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $user_data is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $user_data is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 $link_id is not named in camelCase.
Open

    public function __construct($rows)
    {
        $this->rows = $rows;

        // group all links together

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->links as $courseCode => $one_course_links) {
            $course_info = api_get_course_info($courseCode);

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($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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 method get_information is not named in camelCase.
Open

    private function get_information($course_id, $link_id)
    {
        $course_information = api_get_course_info($course_id);
        $course_id = $course_information['real_id'];
        $course_id_alpha = $course_information['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