chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/search/ChamiloIndexer.class.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$ref_id_second_level'.
Open

        $ref_id_second_level,

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

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

The parameter $tool_id is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $course_code is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $tool_id is not named in camelCase.
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

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

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $terms_string is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $ref_id_high_level is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $course_code is not named in camelCase.
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

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

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $ref_id is not named in camelCase.
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

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

        $course_code,

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

        $tool_id,

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

        $ref_id_second_level,

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

        if ((0 == count(array_diff($terms, $stored_terms))) &&

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

            $this->replace_document($doc, (int) $search_did);

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

        $terms_string = trim($terms_string);

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

        $terms = explode(',', $terms_string);

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

        $terms_string,

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

        $stored_terms = $this->get_terms_on_db($prefix, $course_code, $tool_id, $ref_id_high_level);

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

        foreach ($xapian_terms as $xapian_term) {

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

        $terms_string = trim($terms_string);

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

        $doc = $this->get_document($search_did);

Method name "ChamiloIndexer::get_terms_on_db" is not in camel caps format
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)

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

        $xapian_terms = xapian_get_doc_terms($doc, $prefix);

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

            $ref_id

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

        foreach ($deprecated_terms as $term) {

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

            $prefix_terms[] = $term['value'];

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

        foreach ($xapian_terms as $xapian_term) {

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

        $missing_terms = array_diff($dterms, $xterms);

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

        $stored_terms = $this->get_terms_on_db($prefix, $course_code, $tool_id, $ref_id_high_level);

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

        if ((count($missing_terms) > 0) || (count($deprecated_terms) > 0)) {

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

        $deprecated_terms = array_diff($xterms, $dterms);

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

            $course_code,

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

        return $prefix_terms;

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

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)

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

        $prefix_terms = [];

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

        $ref_id_high_level,

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

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)

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

        $search_did

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

        $stored_terms = $this->get_terms_on_db($prefix, $course_code, $tool_id, $ref_id_high_level);

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

            (0 == count(array_diff($stored_terms, $terms)))

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

        $stored_terms = $this->get_terms_on_db($prefix, $course_code, $tool_id, $ref_id_high_level);

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

            $xterms[] = substr($xapian_term['name'], 1);

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

        foreach ($missing_terms as $term) {

Method name "ChamiloIndexer::set_terms" is not in camel caps format
Open

    public function set_terms(

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

        if ((count($missing_terms) > 0) || (count($deprecated_terms) > 0)) {

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

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)

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

            $tool_id,

The variable $terms_string is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $xapian_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $prefix_terms is not named in camelCase.
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

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

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $stored_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $deprecated_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_id,

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_code is not named in camelCase.
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

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

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $terms_string is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $stored_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $stored_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $xapian_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $missing_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $ref_id_high_level is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $prefix_terms is not named in camelCase.
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

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

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $tool_id is not named in camelCase.
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

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

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

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

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $deprecated_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $xapian_term is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $prefix_terms is not named in camelCase.
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

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 set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $deprecated_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $xapian_term is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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_did is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_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 $missing_terms is not named in camelCase.
Open

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_id,

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The method get_terms_on_db is not named in camelCase.
Open

    public function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id)
    {
        require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
        $terms = get_specific_field_values_list_by_prefix(
            $prefix,

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

    public function set_terms(
        $terms_string,
        $prefix,
        $course_code,
        $tool_id,

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status