chamilo/chamilo-lms

View on GitHub
public/plugin/search_course/lib/search_course_widget.class.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused local variables such as '$key'.
Open

        foreach ($courses as $key => $course) {

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Avoid unused local variables such as '$value'.
Open

        foreach ($user_courses as $key => $value) {

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

The method run uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $result = $this->action_display();
        }

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

        } else {
            echo '<div>';
        }

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

        } else {
            $course_fiter = 'visibility = '.COURSE_VISIBILITY_OPEN_WORLD.' OR ';
            $course_fiter .= 'visibility = '.COURSE_VISIBILITY_OPEN_PLATFORM.' OR ';
            $course_fiter .= '(visibility = '.COURSE_VISIBILITY_REGISTERED.' AND subscribe = 1)';
        }

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

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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 $current_course is not named in camelCase.
Open

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

Missing function doc comment
Open

    public function accept()

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

            if ($display_teacher) {

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

        return $url == $index_url || $url == $root;

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

        $search_term = self::post('search_term');

Missing function doc comment
Open

    public function display_footer()

Missing function doc comment
Open

    public static function server($key, $default = '')

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

        return $url == $index_url || $url == $root;

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

        if ($has_content) {

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

        $search_course_label = self::get_lang('Search courses');

Method name "SearchCourseWidget::get_url" is not in camel caps format
Open

    public function get_url($action = '')

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

                $this->display_subscribe_icon($course, $user_courses);

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

            echo "<h5>$search_result_for_label $search_term_html</h5>";

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

            &nbsp;<input class="btn btn--plain" type="submit" value="$search_label" />

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

        $has_content = !empty($search_term) || !empty($action);

Method name "SearchCourseWidget::action_display" is not in camel caps format
Open

    public function action_display()

Missing function doc comment
Open

    public function display_header()

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

        $display_teacher = 'true' == api_get_setting('display_teacher_in_courselist');

Method name "SearchCourseWidget::get_lang" is not in camel caps format
Open

    public static function get_lang($name)

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

        if ($search_term) {

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

            <input type="text" name="search_term" class="span2" value="$search_term" />

Missing function doc comment
Open

    public static function get_lang($name)

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

            $search_term_html = htmlentities($search_term, ENT_QUOTES, $charset);

Method name "SearchCourseWidget::display_header" is not in camel caps format
Open

    public function display_header()

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

        $search_label = self::get_lang('_search');

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

        $search_term = self::post('search_term');

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

        if (isset($user_courses[$code])) {

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

        if ($search_term) {

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

        $user_id = (int) $user_id;

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

        $user_id = $_user['user_id'];

Missing function doc comment
Open

    public function get_url($action = '')

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

            $search_term_html = htmlentities($search_term, ENT_QUOTES, $charset);

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

        $user_courses = $this->retrieve_user_courses();

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

        $course_table = Database::get_main_table(TABLE_MAIN_COURSE);

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

            $course_fiter = 'visibility = '.COURSE_VISIBILITY_OPEN_WORLD;

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

                WHERE ($course_fiter) AND (code LIKE '%$search_term%' OR visual_code LIKE '%$search_term%' OR title LIKE '%$search_term%' OR tutor_name LIKE '%$search_term%')

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

            <h4>$search_course_label</h4>

Method name "SearchCourseWidget::display_subscribe_icon" is not in camel caps format
Open

    public function display_subscribe_icon($current_course, $user_courses)

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

        if (SUBSCRIBE_ALLOWED != $current_course['subscribe']) {

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

        $search_term = Database::escape_string($search_term);

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

                SELECT * FROM $course_table

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

                    <input type="hidden" name="search_term" value="$search_term" />

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

                       FROM $course_table course, $user_course_table course_rel_user

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

        foreach ($user_courses as $key => $value) {

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

    public function retrieve_courses($search_term)

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

        $course_table = Database::get_main_table(TABLE_MAIN_COURSE);

Method name "SearchCourseWidget::is_homepage" is not in camel caps format
Open

    public function is_homepage()

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

        $index_url = $root.'index.php';

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

        $index_url = $root.'user_portal.php';

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

            $search_result_for_label = self::get_lang('Search results for:');

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

        $display_coursecode = 'true' == api_get_setting('display_coursecode_in_courselist');

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

            $course_fiter .= 'visibility = '.COURSE_VISIBILITY_OPEN_PLATFORM.' OR ';

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

            $user_id = $_user['user_id'];

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

                             AND course_rel_user.user_id = $user_id

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

        $has_content = !empty($search_term) || !empty($action);

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

        $search_term = self::post('search_term');

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

            echo "<h5>$search_result_for_label $search_term_html</h5>";

Method name "SearchCourseWidget::display_footer" is not in camel caps format
Open

    public function display_footer()

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

            if ($display_coursecode) {

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

            $course_fiter = 'visibility = '.COURSE_VISIBILITY_OPEN_WORLD.' OR ';

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

                       FROM $course_table course, $user_course_table course_rel_user

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

        $search_term = $this->post('search_term');

Method name "SearchCourseWidget::retrieve_user_courses" is not in camel caps format
Open

    public function retrieve_user_courses($user_id = null)

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

        $sql_select_courses = "SELECT course.code k, course.visual_code  vc, course.subscribe subscr, course.unsubscribe unsubscr,

Method name "SearchCourseWidget::is_user_portal" is not in camel caps format
Open

    public function is_user_portal()

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

            $courses = $this->retrieve_courses($search_term);

Method name "SearchCourseWidget::display_form" is not in camel caps format
Open

    public function display_form()

Method name "SearchCourseWidget::display_list" is not in camel caps format
Open

    public function display_list($courses)

Method name "SearchCourseWidget::filter_out_user_courses" is not in camel caps format
Open

    public function filter_out_user_courses($courses)

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

        $user_courses = $this->retrieve_user_courses($user_id);

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

    public function display_subscribe_icon($current_course, $user_courses)

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

        $user_courses = $this->retrieve_user_courses($user_id);

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

            $search_term = Security::remove_XSS($search_term);

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

        $search_term = Database::escape_string($search_term);

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

        $user_course_table = Database::get_main_table(TABLE_MAIN_COURSE_USER);

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

    public function display_subscribe_icon($current_course, $user_courses)

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

                WHERE ($course_fiter) AND (code LIKE '%$search_term%' OR visual_code LIKE '%$search_term%' OR title LIKE '%$search_term%' OR tutor_name LIKE '%$search_term%')

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

                WHERE ($course_fiter) AND (code LIKE '%$search_term%' OR visual_code LIKE '%$search_term%' OR title LIKE '%$search_term%' OR tutor_name LIKE '%$search_term%')

Method name "SearchCourseWidget::retrieve_courses" is not in camel caps format
Open

    public function retrieve_courses($search_term)

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

    public function retrieve_user_courses($user_id = null)

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

        if (null === $user_id) {

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

        $user_id = (int) $user_id;

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

        $code = $current_course['code'];

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

            $search_term = Security::remove_XSS($search_term);

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

        if (empty($search_term)) {

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

                WHERE ($course_fiter) AND (code LIKE '%$search_term%' OR visual_code LIKE '%$search_term%' OR title LIKE '%$search_term%' OR tutor_name LIKE '%$search_term%')

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

                WHERE ($course_fiter) AND (code LIKE '%$search_term%' OR visual_code LIKE '%$search_term%' OR title LIKE '%$search_term%' OR tutor_name LIKE '%$search_term%')

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

        $resultset = Database::query($sql_select_courses);

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

            $course_fiter .= '(visibility = '.COURSE_VISIBILITY_REGISTERED.' AND subscribe = 1)';

The variable $index_url is not named in camelCase.
Open

    public function is_homepage()
    {
        $url = self::server('REQUEST_URI');
        $url = explode('?', $url);
        $url = reset($url);

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

    public function is_user_portal()
    {
        $url = self::server('REQUEST_URI');
        $url = explode('?', $url);
        $url = reset($url);

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

    public function action_display()
    {
        global $charset;

        $search_term = self::post('search_term');

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

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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_term is not named in camelCase.
Open

    public function run()
    {
        if (!$this->accept()) {
            return;
        }

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

    public function action_display()
    {
        global $charset;

        $search_term = self::post('search_term');

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

    public function display_header()
    {
        $search_course_label = self::get_lang('Search courses');
        echo <<<EOT
        <div class="well course_search">

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

    public function display_list($courses)
    {
        if (empty($courses)) {
            return false;
        }

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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 $display_teacher is not named in camelCase.
Open

    public function display_list($courses)
    {
        if (empty($courses)) {
            return false;
        }

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

    public function action_display()
    {
        global $charset;

        $search_term = self::post('search_term');

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

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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_term is not named in camelCase.
Open

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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 is not named in camelCase.
Open

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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 $sql_select_courses is not named in camelCase.
Open

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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_result_for_label is not named in camelCase.
Open

    public function action_display()
    {
        global $charset;

        $search_term = self::post('search_term');

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

    public function display_form()
    {
        global $stok;
        $search_label = self::get_lang('_search');
        $self = api_get_self();

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

    public function display_form()
    {
        global $stok;
        $search_label = self::get_lang('_search');
        $self = api_get_self();

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

    public function display_list($courses)
    {
        if (empty($courses)) {
            return false;
        }

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

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function run()
    {
        if (!$this->accept()) {
            return;
        }

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

    public function action_display()
    {
        global $charset;

        $search_term = self::post('search_term');

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

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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_id is not named in camelCase.
Open

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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 $index_url is not named in camelCase.
Open

    public function is_homepage()
    {
        $url = self::server('REQUEST_URI');
        $url = explode('?', $url);
        $url = reset($url);

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

    public function display_form()
    {
        global $stok;
        $search_label = self::get_lang('_search');
        $self = api_get_self();

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

    public function display_list($courses)
    {
        if (empty($courses)) {
            return false;
        }

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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 is not named in camelCase.
Open

    public function filter_out_user_courses($courses)
    {
        if (empty($courses)) {
            return $courses;
        }

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

    public function run()
    {
        if (!$this->accept()) {
            return;
        }

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

    public function action_display()
    {
        global $charset;

        $search_term = self::post('search_term');

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function display_list($courses)
    {
        if (empty($courses)) {
            return false;
        }

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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_term is not named in camelCase.
Open

    public function run()
    {
        if (!$this->accept()) {
            return;
        }

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

    public function action_display()
    {
        global $charset;

        $search_term = self::post('search_term');

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

    public function filter_out_user_courses($courses)
    {
        if (empty($courses)) {
            return $courses;
        }

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

    public function filter_out_user_courses($courses)
    {
        if (empty($courses)) {
            return $courses;
        }

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

    public function action_display()
    {
        global $charset;

        $search_term = self::post('search_term');

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

    public function display_header()
    {
        $search_course_label = self::get_lang('Search courses');
        echo <<<EOT
        <div class="well course_search">

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

    public function display_list($courses)
    {
        if (empty($courses)) {
            return false;
        }

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

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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_courses is not named in camelCase.
Open

    public function filter_out_user_courses($courses)
    {
        if (empty($courses)) {
            return $courses;
        }

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

    public function display_form()
    {
        global $stok;
        $search_label = self::get_lang('_search');
        $self = api_get_self();

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function filter_out_user_courses($courses)
    {
        if (empty($courses)) {
            return $courses;
        }

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

    public function is_user_portal()
    {
        $url = self::server('REQUEST_URI');
        $url = explode('?', $url);
        $url = reset($url);

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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_id is not named in camelCase.
Open

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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_id is not named in camelCase.
Open

    public function filter_out_user_courses($courses)
    {
        if (empty($courses)) {
            return $courses;
        }

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

    public function display_list($courses)
    {
        if (empty($courses)) {
            return false;
        }

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

    public function retrieve_courses($search_term)
    {
        if (empty($search_term)) {
            return [];
        }

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

    public function display_form()
    {
        global $stok;
        $search_label = self::get_lang('_search');
        $self = api_get_self();

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

    public function action_display()
    {
        global $charset;

        $search_term = self::post('search_term');

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

    public function display_footer()
    {
        echo '</div></div>';
    }

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

    public function display_subscribe_icon($current_course, $user_courses)
    {
        global $stok;

        //Already subscribed

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

    public function is_homepage()
    {
        $url = self::server('REQUEST_URI');
        $url = explode('?', $url);
        $url = reset($url);

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

    public function retrieve_user_courses($user_id = null)
    {
        if (null === $user_id) {
            global $_user;
            $user_id = $_user['user_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

The method is_user_portal is not named in camelCase.
Open

    public function is_user_portal()
    {
        $url = self::server('REQUEST_URI');
        $url = explode('?', $url);
        $url = reset($url);

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

    public function get_url($action = '')
    {
        $self = $_SERVER['PHP_SELF'];
        $parameters = [];
        if ($action) {

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

    public function filter_out_user_courses($courses)
    {
        if (empty($courses)) {
            return $courses;
        }

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

    public static function get_lang($name)
    {
        return SearchCoursePlugin::create()->get_lang($name);
    }

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

    public function display_header()
    {
        $search_course_label = self::get_lang('Search courses');
        echo <<<EOT
        <div class="well course_search">

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