chamilo/chamilo-lms

View on GitHub
public/main/inc/ajax/model.ajax.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $exercise_id = $_REQUEST['exerciseId'];

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

                ['where' => $whereCondition, 'extra' => $extra_fields]

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

$total_pages = 0;

Consider putting global function "getWhereClause" in a static class
Open

function getWhereClause($col, $oper, $val)

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

                if (!empty($condition_array)) {

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

        $count = get_count_work($work_id);

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

        $documents = getAllDocumentToWork($work_id, api_get_course_int_id());

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

            $exercise_id,

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

        $field_id = $_REQUEST['field_id'];

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

        $total_pages = ceil((float) $count / (float) $limit);

Multi-line function call not indented correctly; expected 4 spaces but found 8
Open

        $action,

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

                $new_result[] = $row;

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

        $group_id = isset($_REQUEST['gidReq']) ? $_REQUEST['gidReq'] : null;

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

                $whereCondition .= " te.exe_user_id  = '$filter_user'";

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

            $group_id,

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

                if (isset($filters->custom_dates)) {

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

                    $whereCondition .= $filters->custom_dates;

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

        $course_id = api_get_course_int_id();

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

                $work_id,

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

                    ['where' => $whereCondition, 'extra' => $extra_fields]

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

                    $options['where'] = [' usergroup.course_id = ? ' => $course_id];

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

            $column_names[] = get_lang('Group');

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

$extra_fields = [];

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

                if (!empty($condition_array)) {

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

                    $extraQuestionCondition .= implode($filters->groupOp, $condition_array);

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

                ['where' => $whereCondition, 'extra' => $extra_fields]

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

        $course_id = isset($_REQUEST['course_id']) ? $_REQUEST['course_id'] : null;

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

            $course_id,

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

                ['where' => $whereCondition, 'extra' => $extra_fields]

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

                ['where' => $whereCondition, 'extra' => $extra_fields]

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

                $column_names[] = $extra['3'];

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

                ['where' => $whereCondition, 'extra' => $extra_fields]

Multi-line function call not indented correctly; expected 0 spaces but found 4
Open

    ) && !isset($_REQUEST['from_course_session'])) {

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

                $work_id,

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

        $count = $obj->get_count_by_field_id($field_id);

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

        $options['course_id'] = $course_id;

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

            $result = $new_result;

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

                $condition_array = $result['condition_array'];

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

            $group_id,

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

        $count = get_count_work($work_id, api_get_user_id());

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

                    ['where' => $whereCondition, 'extra' => $extra_fields],

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

            $filter_user = (int) $_GET['filter_by_user'];

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

                $column_names[] = $extra['3'];

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

                ['where' => $whereCondition, 'extra' => $extra_fields]

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

        $count = Question::get_count_course_medias($course_id);

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

        $work_id = $_REQUEST['work_id'];

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

            $filter_user = (int) $_GET['filter_by_user'];

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

                $whereCondition .= " AND te.exe_user_id  = '$filter_user'";

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

        if (isset($filters->filter_status)) {

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

if ($page > $total_pages) {

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

    $page = $total_pages;

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

                    $options['where'] = [' (course_id IS NULL OR course_id != ?) ' => $course_id];

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

            $course_id,

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

        $column_names = [

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

                    $extraCondition .= implode($filters->groupOp, $condition_array);

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

                $condition_array = $resultQuestion['condition_array'];

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

                $whereCondition .= " te.exe_user_id  = '$filter_user'";

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

                $whereCondition .= " AND te.exe_user_id  = '$filter_user'";

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

            $sStatus = (int) $filters->filter_status;

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

        $course_id = api_get_course_int_id();

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

$is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_allowed_to_edit(true) || api_is_drh();

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

            $course_id,

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

                $extra_fields = $result['extra_fields'];

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

        $work_id = $_REQUEST['work_id'];

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

        $work_id = $_REQUEST['work_id'];

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

        $new_result = [];

Multi-line function call not indented correctly; expected 4 spaces but found 8
Open

        [

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

                    ['where' => $whereCondition, 'extra' => $extra_fields],

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

            ['where' => $whereCondition, 'extra' => $extra_fields]

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

        $column_names = [

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

        $total_pages = 0;

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

                $total_pages = ceil((float) $count / (float) $limit);

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

        $date_to = $_GET['date_to'];

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

        $result = $new_result;

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

                $new_result[] = [

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

                    $column_names[] = get_lang('Section');

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

                            $course_item['code']

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

                        $count_skill_by_course[$course_item['code']] = $skills_in_course[$course_item['code']];

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

            $work_id,

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

        if ($is_allowedToEdit || api_is_student_boss()) {

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

            $new_result[] = $item;

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

if (in_array($action, $allowed_actions)) {

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

                $count_skill_by_course = [];

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

                        $skills_in_course[$course_item['code']] = $count_skill_by_course[$course_item['code']];

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

            $date_from,

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

        foreach ($questions as $question_id => $question) {

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

        $new_result = [];

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

        $new_result = [];

Multi-line function call not indented correctly; expected 20 spaces but found 24
Open

                        ).'&type=not_registered';

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

                    'course_per_session' => $count_courses_in_session,

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

                        'extra' => $extra_fields,

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

            $date_to,

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

                foreach ($personal_course_list as $course_item) {

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

                        $skills_in_course[$course_item['code']] = $count_skill_by_course[$course_item['code']];

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

                        $skills_in_course[$course_item['code']] = $count_skill_by_course[$course_item['code']];

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

                        $count_skill_by_course[$course_item['code']] = $skills_in_course[$course_item['code']];

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

                ['where' => $whereCondition, 'extra' => $extra_fields]

Add a single space after each comma delimiter
Open

                    Display::getMdiIcon(ActionIcon::VIEW_DETAILS, 'ch-tool-icon', null, ICON_SIZE_SMALL,),

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

            $date_from,

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

        $result = $new_result;

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

            $result = $new_result;

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

                    $column_names[] = get_lang('Username');

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

                        $count_skill_by_course[$course_item['code']] = $skill->getCountSkillsByCourse(

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

                $new_result[] = $group;

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

                    'student_per_session' => $count_users_in_session,

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

$allowed_actions = [

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

            $date_to = intval($_GET['date_to']);

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

                foreach ($personal_course_list as $course_item) {

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

                        $skills_in_course[$course_item['code']] = $count_skill_by_course[$course_item['code']];

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

                $item['currently_learning'] = !empty($count_skill_by_course) ? array_sum($count_skill_by_course) : 0;

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

            $exercise_id,

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

            $columns[] = $lesson_id;

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

            $date_from = intval($_GET['date_from']);

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

            $result = $new_result;

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

        $skills_in_course = [];

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

            ['where' => $whereCondition, 'extra' => $extra_fields]

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

            $date_from,

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

        $new_result = [];

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

                $user_info = api_get_user_info($item['user_id']);

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

            $new_result[] = $item;

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

                    $count_courses_in_session = count(

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

        if ($page > $total_pages) {

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

                        'extra' => $extra_fields,

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

            $date_from,

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

        $result = $new_result;

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

        $new_result = [];

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

                    $column_names[] = get_lang('Name');

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

        $new_result = [];

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

                    if (!isset($skills_in_course[$course_item['code']])) {

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

            $work_id,

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

        $column_names = [];

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

                $personal_course_list = UserManager::get_personal_session_course_list(

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

        $is_allowedToEdit = api_is_allowed_to_edit(null, true) ||

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

            $new_result[] = $item;

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

                    $column_names[] = $title;

Multi-line function call not indented correctly; expected 28 spaces but found 32
Open

                                $urlUserGroup.'&id='.$group['id']

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

                    $count_courses_in_session = SessionManager::get_course_list_by_session_id(

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

                if (!empty($extra_fields)) {

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

            $page = $total_pages;

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

        $date_to = $_GET['date_to'];

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

                        'extra' => $extra_fields,

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

        $date_from = $_GET['date_from'];

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

            $date_from = $_GET['date_from'];

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

            $new_result[] = $item;

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

        $new_result = [];

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

        $result = $new_result;

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

                    $options['where'] = [' (course_id IS NULL OR course_id != ?) ' => $course_id];

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

                    $course_id,

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

        if (empty($column_names)) {

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

                    $column_names[] = get_lang('Final score');

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

            'where' => ['field_id = ? ' => $field_id],

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

            $column_names = $columns;

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

                        $count_skill_by_course[$course_item['code']] = $skills_in_course[$course_item['code']];

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

                $item['currently_learning'] = !empty($count_skill_by_course) ? array_sum($count_skill_by_course) : 0;

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

                $work_id,

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

                $work_id,

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

                ['where' => $whereCondition, 'extra' => $extra_fields]

Expected 0 spaces before closing bracket; 1 found
Open

        if (isset($_REQUEST['origin'] ) &&  'load_search' === $_REQUEST['origin']) {

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

            $date_to,

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

            $date_to = $_GET['date_to'];

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

                    if (!isset($skills_in_course[$course_item['code']])) {

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

            $columns[] = $question_id;

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

        $new_result = [];

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

                $item['photo'] = Display::img($user_info['avatar_small'], $user_info['complete_name'], [], false);

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

        $documents = getAllDocumentToWork($work_id, api_get_course_int_id());

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

                ['where' => $whereCondition, 'extra' => $extra_fields]

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

                $count_users_in_session = SessionManager::get_users_by_session(

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

        $date_from = $_GET['date_from'];

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

        foreach ($lessons as $lesson_id => $lesson) {

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

            $new_result[] = $item;

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

                        $count_skill_by_course[$course_item['code']] = $skill->getCountSkillsByCourse(

Multi-line function call not indented correctly; expected 20 spaces but found 24
Open

                        ).'&id_session='.api_get_session_id();

Multi-line function call not indented correctly; expected 28 spaces but found 32
Open

                                Display::getMdiIcon(ToolIcon::TRACKING, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Statistics')),

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

    $response->total = $total_pages;

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

                        $count_skill_by_course[$course_item['code']] = $skills_in_course[$course_item['code']];

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

        foreach ($column_names as $col) {

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

                $item['photo'] = Display::img($user_info['avatar_small'], $user_info['complete_name'], [], false);

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

                    foreach ($extra_fields as $extraField) {

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

            $date_to,

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

            $date_to,

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

        $result = $new_result;

Multi-line function call not indented correctly; expected 24 spaces but found 28
Open

                            ).' ';

Multi-line function call not indented correctly; expected 4 spaces but found 8
Open

        $action,

Multi-line function call not indented correctly; expected 0 spaces but found 4
Open

    ) && !isset($_REQUEST['from_course_session'])) {

Multi-line function call not indented correctly; expected 4 spaces but found 8
Open

        [

Multi-line function call not indented correctly; expected 28 spaces but found 32
Open

                                Display::getMdiIcon(ToolIcon::TRACKING, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Statistics')),

Multi-line function call not indented correctly; expected 20 spaces but found 24
Open

                        ).'&type=not_registered';

Multi-line function call not indented correctly; expected 24 spaces but found 28
Open

                            ).' ';

Multi-line function call not indented correctly; expected 28 spaces but found 32
Open

                                $urlUserGroup.'&id='.$group['id']

No space found after comma in function call
Open

                    Display::getMdiIcon(ActionIcon::VIEW_DETAILS, 'ch-tool-icon', null, ICON_SIZE_SMALL,),

Expected 0 spaces before closing bracket; 1 found
Open

        if (isset($_REQUEST['origin'] ) &&  'load_search' === $_REQUEST['origin']) {

Multi-line function call not indented correctly; expected 20 spaces but found 24
Open

                        ).'&id_session='.api_get_session_id();

There are no issues that match your filters.

Category
Status