chamilo/chamilo-lms

View on GitHub
public/plugin/dashboard/block_student/block_student.class.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '149', column '27').
Open

        $attendance = new Attendance();

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

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

                } else {
                    $class_tr = 'row_even';
                }

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

                } else {
                    $style = ' style="background-color:#FFF" ';
                }

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

        } else {
            $students_table .= get_lang('ThereIsNoInformationAboutYour learners');
        }

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

                } else {
                    $attendances_faults_avg = '0%';
                }

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

        } else {
            $students_table .= get_lang('ThereIsNoInformationAboutYour learners');
        }

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

                } else {
                    $students_table .= '<tr '.$style.'>
                                            <td align="center" colspan="2"><i>'.get_lang('You left some fields empty.<br>Use the <b>Back</b> button on your browser and try again.<br>If you ignore your training code, see the Training Program').'</i></td>
                                        </tr>';
                }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

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

                    $course_code = $course['code'];

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

    public function __construct($user_id)
    {
        $this->user_id = $user_id;
        $this->path = 'block_student';
        if ($this->is_block_visible_for_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 $user_id is not named in camelCase.
Open

    public function is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = false;

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The property $user_id is not named in camelCase.
Open

class BlockStudent extends Block
{
    private $user_id;
    private $students;
    private $permission = [DRH];

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

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

                        $course_code = $course['code'];

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

        $is_block_visible_for_user = false;

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

    public function is_block_visible_for_user($user_id)

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

                                            <td align="right">'.$course_title.'</td>

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

                        $courseInfo = api_get_course_info($course_code);

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

        $user_status = $user_info['status'];

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

                $count_courses = count($courses_by_user);

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

                    $attendances_faults_avg = '0%';

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

                $courses_by_user = CourseManager::get_courses_list_by_user_id($student_id, true);

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

    public function __construct($user_id)

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

        $user_info = api_get_user_info($user_id);

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

        if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) {

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

        $this->user_id = $user_id;

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

        $user_info = api_get_user_info($user_id);

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

                $rowspan = $count_courses ? $count_courses + 1 : 2;

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

            $students_table .= '<tr>

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

                $courses_by_user = CourseManager::get_courses_list_by_user_id($student_id, true);

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

        $this->user_id = $user_id;

Method name "BlockStudent::get_block" is not in camel caps format
Open

    public function get_block()

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

                if (!empty($courses_by_user)) {

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

                if (!empty($results_faults_avg)) {

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

        if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) {

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

                $rowspan = $count_courses ? $count_courses + 1 : 2;

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

                    $students_table .= '<tr '.$style.'>

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

                        $results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['percent'].'%)</a>';

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

        if ($this->is_block_visible_for_user($user_id)) {

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

        $students_table = null;

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

                $courses_by_user = CourseManager::get_courses_list_by_user_id($student['user_id'], true);

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

        $content = $students_table;

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

                $student_id = $student['user_id'];

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

                        $results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['percent'].'%)</a>';

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

                        $course_title = $course['title'];

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

                        $results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['percent'].'%)</a>';

Method name "BlockStudent::is_block_visible_for_user" is not in camel caps format
Open

    public function is_block_visible_for_user($user_id)

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

                $count_courses = count($courses_by_user);

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

                $students_table .= '<tr '.$style.'>

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

                    foreach ($courses_by_user as $course) {

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

            $students_table .= '</table>';

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

            $students_table .= '<table class="data_table">';

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

            $is_block_visible_for_user = true;

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

        return $is_block_visible_for_user;

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

            $students_table .= get_lang('ThereIsNoInformationAboutYour learners');

Method name "BlockStudent::get_students_content_html_for_drh" is not in camel caps format
Open

    public function get_students_content_html_for_drh()

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

                        href="'.api_get_path(WEB_CODE_PATH).'my_space/myStudents.php?student='.$student_id.'">'.

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

        $user_status = $user_info['status'];

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

            $students_table .= '<tr>

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

                        $students_table .= '<tr '.$style.'>

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

            $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT);

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

            $students_table .= '<table class="data_table">';

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

        $students_table = null;

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

                $results_faults_avg = $attendance->get_faults_average_inside_courses($student_id);

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

                $results_faults_avg = $attendance->get_faults_average_inside_courses($student_id);

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

                    $attendances_faults_avg = '<a

Method name "BlockStudent::get_number_of_students" is not in camel caps format
Open

    public function get_number_of_students()

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

                    $course_code = $course['code'];

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

                                        <td>'.$attendances_faults_avg.'</td>

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

                $students_table .= '<tr class="'.$class_tr.'">

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

                $evaluations_avg = 0;

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

                                        <td>'.$evaluations_avg.'</td>

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

                        $scoretotal = $cats[0]->calc_score($student_id, null, $course['real_id']);

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

                    $class_tr = 'row_odd';

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

                    $evaluations_avg = '<a title="'.get_lang('Go to learner details').'" href="'.api_get_path(WEB_CODE_PATH).'my_space/myStudents.php?student='.$student_id.'">'.round($score, 2).'/'.round($weight, 2).'('.round($score / $weight * 100, 2).' %)</a>';

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

                $students_table .= '<tr class="'.$class_tr.'">

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

                foreach ($courses_by_user as $course) {

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

            $students_table .= get_lang('ThereIsNoInformationAboutYour learners');

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

            $students_table .= '</table>';

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

        $content .= $students_table;

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

                    $evaluations_avg = '<a title="'.get_lang('Go to learner details').'" href="'.api_get_path(WEB_CODE_PATH).'my_space/myStudents.php?student='.$student_id.'">'.round($score, 2).'/'.round($weight, 2).'('.round($score / $weight * 100, 2).' %)</a>';

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

                    $class_tr = 'row_even';

The variable $courses_by_user is not named in camelCase.
Open

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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 __construct($user_id)
    {
        $this->user_id = $user_id;
        $this->path = 'block_student';
        if ($this->is_block_visible_for_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 is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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 $students_table is not named in camelCase.
Open

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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 $results_faults_avg is not named in camelCase.
Open

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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 $count_courses is not named in camelCase.
Open

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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 $courses_by_user is not named in camelCase.
Open

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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 __construct($user_id)
    {
        $this->user_id = $user_id;
        $this->path = 'block_student';
        if ($this->is_block_visible_for_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 __construct($user_id)
    {
        $this->user_id = $user_id;
        $this->path = 'block_student';
        if ($this->is_block_visible_for_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 $students_table is not named in camelCase.
Open

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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_status is not named in camelCase.
Open

    public function is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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 $is_block_visible_for_user is not named in camelCase.
Open

    public function is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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 $students_table is not named in camelCase.
Open

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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 is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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_code is not named in camelCase.
Open

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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 $student_id is not named in camelCase.
Open

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function getContent()
    {
        $students = $this->students;
        $students_table = null;
        if (count($students) > 0) {

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function get_students_content_html_for_drh()
    {
        $attendance = new Attendance();
        $students = $this->students;
        $content = '<h4>'.get_lang('Your learners').'</h4>';

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

    public function is_block_visible_for_user($user_id)
    {
        $user_info = api_get_user_info($user_id);
        $user_status = $user_info['status'];
        $is_block_visible_for_user = 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 get_number_of_students is not named in camelCase.
Open

    public function get_number_of_students()
    {
        return count($this->students);
    }

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

    public function get_block()
    {
        $column = 1;
        $data = [];
        $html = $this->getBlockCard(

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