chamilo/chamilo-lms

View on GitHub
public/main/search/load_search.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '1236', column '18').
Open

    $first = new \DateTime($date1);
Severity: Minor
Found in public/main/search/load_search.php by phpmd

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

Missing class import via use statement (line '1237', column '19').
Open

    $second = new \DateTime($date2);
Severity: Minor
Found in public/main/search/load_search.php by phpmd

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

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

$extra_params['height'] = 'auto';

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

                    $filtered_value = array_filter($valueArray, function($valueFilter) {

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

                    $value = $filtered_value;

Expected 1 space after FUNCTION keyword; 0 found
Open

                    $filtered_value = array_filter($valueArray, function($valueFilter) {

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

                ->get_handler_field_info_by_field_variable($field_variable);

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

    ).'?action=subscribe_user&user_id='.$userToLoad.'&session_id=\'+id+\'">'.Display::getMdiIcon(

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

            $field_variable = substr($key, 6);

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

    ).'?action=unsubscribe_user&user_id='.$userToLoad.'&session_id=\'+id+\'">'.Display::getMdiIcon(

Add a single space after each comma delimiter
Open

    $forceShowFields,//$forceShowFields = false

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

$extra_params['autowidth'] = 'true';

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

function dateDiffInWeeks($date1, $date2)

Missing function doc comment
Open

function dateDiffInWeeks($date1, $date2)

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

    ).'?action=subscribe_user&user_id='.$userToLoad.'&session_id=\'+id+\'">'.Display::getMdiIcon(

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

    ).'?action=unsubscribe_user&user_id='.$userToLoad.'&session_id=\'+id+\'">'.Display::getMdiIcon(

No space found after comma in function call
Open

    $forceShowFields,//$forceShowFields = false

There are no issues that match your filters.

Category
Status