chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/search/get_terms.php

Summary

Maintainability
A
0 mins
Test Coverage

The parameter $specific_fields is not named in camelCase.
Open

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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 "specific_field" is not in valid camel caps format
Open

        foreach ($specific_fields as $specific_field) {

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

            foreach (xapian_get_all_terms(1000, $specific_field['code']) as $raw_term) {

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

                        $normal_term = substr($raw_term['name'], 1);

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

                        $sf_terms[$specific_field['code']][$normal_term] = $normal_term;

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

    return $sf_terms;

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

        $sf_terms = get_usual_sf_terms($filter, $specific_fields);

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

        $sf_terms = get_usual_sf_terms($filter, $specific_fields);

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

                    if (count($raw_term['name']) > 1) {

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

function get_usual_sf_terms($filter, $specific_fields)

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

        foreach ($specific_fields as $specific_field) {

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

                foreach ($obj['sf-'.$specific_field['code']] as $raw_term) {

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

        foreach ($specific_fields as $specific_field) {

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

                    $sf_terms[$specific_field['code']][$normal_term] = $normal_term;

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

    $sf_terms = [];

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

                        $normal_term = substr($raw_term['name'], 1);

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

            'prefix' => $sf_prefix,

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

                    $normal_term = substr($raw_term['name'], 1);

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

echo json_encode($terms_list);

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

            'terms' => array_merge($first_term, $term_group),

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

                foreach ($obj['sf-'.$specific_field['code']] as $raw_term) {

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

$specific_fields = get_specific_field_list();

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

                    $sf_terms[$specific_field['code']][$normal_term] = $normal_term;

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

foreach ($sf_terms as $sf_prefix => $term_group) {

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

    if ($sf_prefix != $prefix) {

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

        $terms_list[] = [

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

                        $sf_terms[$specific_field['code']][$normal_term] = $normal_term;

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

                        $sf_terms[$specific_field['code']][$normal_term] = $normal_term;

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

    $first_term = ['__all__' => ('or' == $operator ? '-- Any --' : '-- All -- ')];

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

function get_usual_sf_terms($filter, $specific_fields)

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

                if (count($raw_term['name']) > 1) {

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

            'terms' => array_merge($first_term, $term_group),

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

foreach ($sf_terms as $sf_prefix => $term_group) {

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

$sf_terms = [];

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

$terms_list = [];

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

        foreach ($specific_fields as $specific_field) {

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

                    $normal_term = substr($raw_term['name'], 1);

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

                    $sf_terms[$specific_field['code']][$normal_term] = $normal_term;

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

    echo json_encode($terms_list);

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

            foreach (xapian_get_all_terms(1000, $specific_field['code']) as $raw_term) {

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

    $sf_terms = get_usual_sf_terms($filter, $specific_fields);

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

                        $sf_terms[$specific_field['code']][$normal_term] = $normal_term;

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

foreach ($sf_terms as $sf_prefix => $term_group) {

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

    $sf_terms = get_usual_sf_terms($filter, $specific_fields);

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

                    $sf_terms[$specific_field['code']][$normal_term] = $normal_term;

The variable $specific_fields is not named in camelCase.
Open

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

function get_usual_sf_terms($filter, $specific_fields)
{
    $sf_terms = [];
    $dkterms = chamilo_query_simple_query('', 0, 1000, $filter);

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

There are no issues that match your filters.

Category
Status