chamilo/chamilo-lms

View on GitHub
public/main/exercise/TestCategory.php

Summary

Maintainability
A
0 mins
Test Coverage

The method get_stats_table_by_attempt() has an NPath complexity of 2424. The configured NPath complexity threshold is 200.
Open

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method getQuestionsByCat() has an NPath complexity of 740. The configured NPath complexity threshold is 200.
Open

    public static function getQuestionsByCat(
        int   $exerciseId,
        array $checkInQuestionList = [],
        array $categoriesAddedInExercise = [],
        $onlyMandatory = false
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

Missing class import via use statement (line '688', column '22').
Open

        $table = new HTML_Table(
Severity: Minor
Found in public/main/exercise/TestCategory.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 '369', column '21').
Open

        $quiz = new Exercise();
Severity: Minor
Found in public/main/exercise/TestCategory.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 '266', column '25').
Open

        $exercise = new Exercise($courseId);
Severity: Minor
Found in public/main/exercise/TestCategory.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

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

                    } else {
                        $resultsArray[] = 0;
                    }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

            } else {
                $count += $nbQuestionInThisCat;
            }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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 '$label'.
Open

                foreach ($labelsWithId as $categoryId => $label) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

Avoid unused parameters such as '$courseId'.
Open

    public static function get_category_id_for_title($title, $courseId = 0)
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

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

        $course = api_get_course_entity($courseId);
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

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

        foreach ($in_tab as $cat_id => $tabquestion) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

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

        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

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

        $session = api_get_session_entity($sessionId);
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

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

        foreach ($tabCatName as $key => $val) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

Avoid unused parameters such as '$grouped_by_category'.
Open

    public static function getListOfCategoriesNameForTest($exerciseId, $grouped_by_category = true)
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

Avoid using count() function in for loops.
Open

        for ($i = 1; $i <= count($questionList); $i++) {
            if (self::getCategoryForQuestion($questionList[$i]) == $categoryId) {
                $nbCatResult++;
            }
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

CountInLoopExpression

Since: 2.7.0

Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

Example

class Foo {

  public function bar()
  {
    $array = array();

    for ($i = 0; count($array); $i++) {
      // ...
    }
  }
}

Source https://phpmd.org/rules/design.html#countinloopexpression

The parameter $in_display_category_name is not named in camelCase.
Open

    public static function returnCategoryAndTitle($questionId, $in_display_category_name = 1)
    {
        $is_student = !(api_is_allowed_to_edit(null, true) || api_is_session_admin());
        $objExercise = Session::read('objExercise');
        if (!empty($objExercise)) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function sortTabByBracketLabel($in_tab)
    {
        $tabResult = [];
        $tabCatName = []; // tab of category name
        foreach ($in_tab as $cat_id => $tabquestion) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesNameForTest($exerciseId, $grouped_by_category = true)
    {
        $result = [];
        $categories = self::getListOfCategoriesIDForTest($exerciseId);

Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

                $category_list = [$category_list];

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

            if (!empty($category_list)) {

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

            $in_display_category_name = $objExercise->display_category_name;

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

        foreach ($in_tab as $cat_id => $tabquestion) {

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

            $categories_in_exercise = array_unique(array_filter($categories_in_exercise));

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

            $in_display_category_name = $objExercise->display_category_name;

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

            if ($nbQuestionInThisCat > $res_num_max) {

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

                $categories_in_exercise = array_merge($categories_in_exercise, $category_list);

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

    public static function getListOfCategoriesNameForTest($exerciseId, $grouped_by_category = true)

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

    public static function sortTabByBracketLabel($in_tab)

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

            $category = $category->getCategory($cat_id);

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

            $tabCatName[$cat_id] = $category->name;

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

                $res_num_max = $nbQuestionInThisCat;

Missing function doc comment
Open

    public static function getCategoryInfoForQuestion($questionId, $courseId = 0)

Expected 8 spaces after parameter type; 1 found
Open

     * @param int $courseId

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

        $categories_in_exercise = [];

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

            if (is_numeric($category_list)) {

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])

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

            $none_category = $category_list['none'];

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

            $sql = "DELETE FROM $tbl_question_rel_cat

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

            $tabResult[$key] = $in_tab[$key];

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

        if (isset($category_list['none'])) {

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

                $category_list = [$category_list];

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

        if (!empty($categories_in_exercise)) {

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

            $cat = (array) $cat->getCategory($cat_id);

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

        return $categories_in_exercise;

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

        reset($in_tab);

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

        foreach ($question_list as $questionInfo) {

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

                $categories_in_exercise = array_merge($categories_in_exercise, $category_list);

Expected 2 spaces after parameter type; 1 found
Open

     * @param int $exerciseId

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

        $is_student = !(api_is_allowed_to_edit(null, true) || api_is_session_admin());

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

            $question_id = $questionInfo['question_id'];

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

                $categories_in_exercise = array_merge($categories_in_exercise, $category_list);

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

    public static function returnCategoryAndTitle($questionId, $in_display_category_name = 1)

Missing parameter name
Open

     * @param bool

Method name "TestCategory::get_stats_table_by_attempt" is not in camel caps format
Open

    public static function get_stats_table_by_attempt($exercise, $category_list = [])

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

            $none_category = $category_list['none'];

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

            $categories_in_exercise = array_unique(array_filter($categories_in_exercise));

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

        foreach ($in_tab as $cat_id => $tabquestion) {

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

        $none_category = [];

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

        foreach ($categories as $cat_id) {

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

            (1 == $in_display_category_name || !$is_student)

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

        $res_num_max = 0;

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

        $tbl_question_rel_cat = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);

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

        $category = $this->getCategory($id, $course_id);

Missing parameter name
Open

     * @param $questionId

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

            $category_list = self::getCategoryForQuestion($question_id);

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

            unset($category_list['none']);

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

        $course_id = api_get_course_int_id();

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

        $question_list = $exercise->getQuestionOrderedListByName();

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

        return $res_num_max;

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

        if (empty($category_list) || empty($exercise)) {

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

            $category_list = self::getCategoryForQuestion($question_id);

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

            (1 == $in_display_category_name || !$is_student)

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

                        $none_category['total'],

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

                        $none_category['total'],

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

                $tempResult[$category_id] = $category_item['total'] != 0 ? round($category_item['score'] / $category_item['total'] * 10) : 0;

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

        if (!empty($this->parent_id)) {

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

                $value = isset($saved_categories) && isset($saved_categories[$cat_id]) ? $saved_categories[$cat_id]['count_questions'] : -1;

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

                    "category[$cat_id]",

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

                        $category_item['score'],

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

            $parent_cat = new self();

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

            $parent_cat = $parent_cat->getCategory($this->parent_id);

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

        $form->addSelect('parent_id', get_lang('Parent'), $category_parent_list, ['id' => 'parent_id']);

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

            $total = $category_list['total'];

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

                $category_item = $category_list[$category_id];

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

            $category_parent_list = [$parent_cat->id => $parent_cat->name];

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

                $category_item = $category_list[$category_id];

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

            $parent_cat = $parent_cat->getCategory($this->parent_id);

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

            $category_parent_list = [$parent_cat->id => $parent_cat->name];

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

        $out_res = 0;

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

            if ($countCategories > 2 && RESULT_DISABLE_RADAR === (int) $exercise->results_disabled) {

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

                $cat_id = $category['iid'];

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

                $tempResult[$category_id] = $category_item['total'] != 0 ? round($category_item['score'] / $category_item['total'] * 10) : 0;

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

            unset($category_list['total']);

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

                        $category_item['total'],

Method name "TestCategory::get_category_id_for_title" is not in camel caps format
Open

    public static function get_category_id_for_title($title, $courseId = 0)

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

                if (!isset($category_list[$category_id])) {

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

                        $none_category['score'],

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

        $defaults['parent_id'] = $this->parent_id;

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

        return $out_res;

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

        $countCategories = count($category_list);

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

                if (!isset($category_list[$category_id])) {

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

            $script .= '<script>$(function() { $("#parent_id").trigger("addItem",[{"title": "'.$parent_cat->name.'", "value": "'.$parent_cat->id.'"}]); });</script>';

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

        $saved_categories = $exercise->getCategoriesInExercise();

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

            foreach ($labelsWithId as $category_id => $title) {

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

                $tempResult[$category_id] = $category_item['total'] != 0 ? round($category_item['score'] / $category_item['total'] * 10) : 0;

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

        $category_parent_list = [];

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

            $parent_cat = $parent_cat->getCategory($this->parent_id);

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

        if (isset($category_list['total'])) {

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

            $category_parent_list = [$parent_cat->id => $parent_cat->name];

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

            $script .= '<script>$(function() { $("#parent_id").trigger("addItem",[{"title": "'.$parent_cat->name.'", "value": "'.$parent_cat->id.'"}]); });</script>';

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

                        $category_item['score'],

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

            $real_question_count = count($exercise->getQuestionList());

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

                        $category_item['total'],

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

                $value = isset($saved_categories) && isset($saved_categories[$cat_id]) ? $saved_categories[$cat_id]['count_questions'] : -1;

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

                $value = isset($saved_categories) && isset($saved_categories[$cat_id]) ? $saved_categories[$cat_id]['count_questions'] : -1;

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

                $category_item = $category_list[$category_id];

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

            if ($nbQuestionsTotal != $real_question_count) {

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

            $out_res = $data['iid'];

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

                $tempResult[$category_id] = $category_item['total'] != 0 ? round($category_item['score'] / $category_item['total'] * 10) : 0;

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

            if (!empty($none_category)) {

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

                        $none_category['score'],

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

                $value = isset($saved_categories) && isset($saved_categories[$cat_id]) ? $saved_categories[$cat_id]['count_questions'] : -1;

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

                $value = isset($saved_categories) && isset($saved_categories[$cat_id]) ? $saved_categories[$cat_id]['count_questions'] : -1;

The variable $question_id is not named in camelCase.
Open

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function returnCategoryAndTitle($questionId, $in_display_category_name = 1)
    {
        $is_student = !(api_is_allowed_to_edit(null, true) || api_is_session_admin());
        $objExercise = Session::read('objExercise');
        if (!empty($objExercise)) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function returnCategoryAndTitle($questionId, $in_display_category_name = 1)
    {
        $is_student = !(api_is_allowed_to_edit(null, true) || api_is_session_admin());
        $objExercise = Session::read('objExercise');
        if (!empty($objExercise)) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function removeCategory($id)
    {
        $tbl_question_rel_cat = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
        $id = (int) $id;
        $course_id = api_get_course_int_id();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function returnCategoryAndTitle($questionId, $in_display_category_name = 1)
    {
        $is_student = !(api_is_allowed_to_edit(null, true) || api_is_session_admin());
        $objExercise = Session::read('objExercise');
        if (!empty($objExercise)) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesForTest(Exercise $exercise)
    {
        $result = [];
        $categories = self::getListOfCategoriesIDForTestObject($exercise);
        foreach ($categories as $cat_id) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function sortTabByBracketLabel($in_tab)
    {
        $tabResult = [];
        $tabCatName = []; // tab of category name
        foreach ($in_tab as $cat_id => $tabquestion) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function sortTabByBracketLabel($in_tab)
    {
        $tabResult = [];
        $tabCatName = []; // tab of category name
        foreach ($in_tab as $cat_id => $tabquestion) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getNumberMaxQuestionByCat($exerciseId)
    {
        $res_num_max = 0;
        $categories = self::getListOfCategoriesIDForTest($exerciseId);
        foreach ($categories as $category) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function sortTabByBracketLabel($in_tab)
    {
        $tabResult = [];
        $tabCatName = []; // tab of category name
        foreach ($in_tab as $cat_id => $tabquestion) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function returnCategoryAndTitle($questionId, $in_display_category_name = 1)
    {
        $is_student = !(api_is_allowed_to_edit(null, true) || api_is_session_admin());
        $objExercise = Session::read('objExercise');
        if (!empty($objExercise)) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_category_id_for_title($title, $courseId = 0)
    {
        $out_res = 0;
        $tableCategory = Database::get_course_table(TABLE_QUIZ_QUESTION_CATEGORY);
        $sql = "SELECT iid FROM $tableCategory
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesForTest(Exercise $exercise)
    {
        $result = [];
        $categories = self::getListOfCategoriesIDForTestObject($exercise);
        foreach ($categories as $cat_id) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getNumberMaxQuestionByCat($exerciseId)
    {
        $res_num_max = 0;
        $categories = self::getListOfCategoriesIDForTest($exerciseId);
        foreach ($categories as $category) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_category_id_for_title($title, $courseId = 0)
    {
        $out_res = 0;
        $tableCategory = Database::get_course_table(TABLE_QUIZ_QUESTION_CATEGORY);
        $sql = "SELECT iid FROM $tableCategory
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function sortTabByBracketLabel($in_tab)
    {
        $tabResult = [];
        $tabCatName = []; // tab of category name
        foreach ($in_tab as $cat_id => $tabquestion) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function removeCategory($id)
    {
        $tbl_question_rel_cat = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
        $id = (int) $id;
        $course_id = api_get_course_int_id();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function removeCategory($id)
    {
        $tbl_question_rel_cat = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
        $id = (int) $id;
        $course_id = api_get_course_int_id();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getNumberMaxQuestionByCat($exerciseId)
    {
        $res_num_max = 0;
        $categories = self::getListOfCategoriesIDForTest($exerciseId);
        foreach ($categories as $category) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getNumberMaxQuestionByCat($exerciseId)
    {
        $res_num_max = 0;
        $categories = self::getListOfCategoriesIDForTest($exerciseId);
        foreach ($categories as $category) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_category_id_for_title($title, $courseId = 0)
    {
        $out_res = 0;
        $tableCategory = Database::get_course_table(TABLE_QUIZ_QUESTION_CATEGORY);
        $sql = "SELECT iid FROM $tableCategory
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function sortTabByBracketLabel($in_tab)
    {
        $tabResult = [];
        $tabCatName = []; // tab of category name
        foreach ($in_tab as $cat_id => $tabquestion) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function sortTabByBracketLabel($in_tab)
    {
        $tabResult = [];
        $tabCatName = []; // tab of category name
        foreach ($in_tab as $cat_id => $tabquestion) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function removeCategory($id)
    {
        $tbl_question_rel_cat = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
        $id = (int) $id;
        $course_id = api_get_course_int_id();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function getListOfCategoriesIDForTestObject(Exercise $exercise)
    {
        // parcourir les questions d'un test, recup les categories uniques dans un tableau
        $categories_in_exercise = [];
        $question_list = $exercise->getQuestionOrderedListByName();
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function getForm(&$form, $action = 'new')
    {
        switch ($action) {
            case 'new':
                $header = get_lang('Add category');
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public function returnCategoryForm(Exercise $exercise)
    {
        $categories = $this->getListOfCategoriesForTest($exercise);
        $sortedCategories = [];
        foreach ($categories as $catId => $cat) {
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_stats_table_by_attempt($exercise, $category_list = [])
    {
        if (empty($category_list) || empty($exercise)) {
            return '';
        }
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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

    public static function get_category_id_for_title($title, $courseId = 0)
    {
        $out_res = 0;
        $tableCategory = Database::get_course_table(TABLE_QUIZ_QUESTION_CATEGORY);
        $sql = "SELECT iid FROM $tableCategory
Severity: Minor
Found in public/main/exercise/TestCategory.php by phpmd

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