chamilo/chamilo-lms

View on GitHub
public/main/gradebook/lib/user_data_generator.class.php

Summary

Maintainability
A
0 mins
Test Coverage

The method get_data() has an NPath complexity of 1848. The configured NPath complexity threshold is 200.
Open

    public function get_data(
        $sorting = 0,
        $start = 0,
        $count = null,
        $ignore_score_color = false

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

        } else {
            $cat = Category::load($category_id);
            if (isset($cat)) {
                $this->categorycache[$category_id] = $cat[0];

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

        } else {
            $avgscore = $item->calc_score('', 'average');
        }

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

        } else {
            $name = CourseManager::getCourseNameFromCode($courseCode);
            $this->coursecodecache[$courseCode] = $name;

            return $name;

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

            } else {
                return null;
            }

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

            } else {
                return $cat->get_name();
            }

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

        } else {
            return $item1->get_item_type() < $item2->get_item_type() ? -1 : 1;
        }

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

                } else {
                    $avgscore = $item->calc_score();
                }

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

        } else {
            $evals_filtered = $evals_filtered_copy;
        }

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

        } else {
            return ($score1[0] / $score1[1]) < ($score2[0] / $score2[1]) ? -1 : 1;
        }

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

            } else {
                $row[] = $this->build_average_column($item, $ignore_score_color);
                $row[] = $this->build_result_column($item, $ignore_score_color);
                if ($scoredisplay->is_custom()) {
                    $row[] = $this->build_mask_column($item, $ignore_score_color);

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 parameters such as '$ignore_score_color'.
Open

    private function build_average_column($item, $ignore_score_color)

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

    private function get_category_cached(int $category_id)
    {
        if (isset($this->categorycache) &&
            isset($this->categorycache[$category_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 $ignore_score_color is not named in camelCase.
Open

    private function build_average_column($item, $ignore_score_color)
    {
        if (isset($this->avgcache)) {
            $avgscore = $this->avgcache[$item->get_item_type().$item->get_id()];
        } else {

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

    private function build_result_column($item, $ignore_score_color)
    {
        $studscore = $this->scorecache[$item->get_item_type().$item->get_id()];
        $scoredisplay = ScoreDisplay::instance();
        $displaytype = SCORE_DIV_PERCENT;

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

    private function build_mask_column($item, $ignore_score_color)
    {
        $studscore = $this->scorecache[$item->get_item_type().$item->get_id()];
        $scoredisplay = ScoreDisplay::instance();
        $displaytype = SCORE_DIV_PERCENT;

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

    public function get_data(
        $sorting = 0,
        $start = 0,
        $count = null,
        $ignore_score_color = false

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

            $evals_filtered = $evals_filtered_copy;

Method name "UserDataGenerator::get_total_items_count" is not in camel caps format
Open

    public function get_total_items_count()

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

        $ignore_score_color = false

Missing parameter name
Open

     * @param $item2

Missing parameter name
Open

     * @param $item2

Method name "UserDataGenerator::build_average_column" is not in camel caps format
Open

    private function build_average_column($item, $ignore_score_color)

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

        if ($ignore_score_color) {

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

    private function build_mask_column($item, $ignore_score_color)

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

                $this->categorycache[$category_id] = $cat[0];

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

                    $row[] = $this->build_mask_column($item, $ignore_score_color);

Missing parameter name
Open

     * @param $item2

Method name "UserDataGenerator::sort_by_type" is not in camel caps format
Open

    public function sort_by_type($item1, $item2)

Method name "UserDataGenerator::sort_by_name" is not in camel caps format
Open

    public function sort_by_name($item1, $item2)

Missing parameter name
Open

     * @param $item1

Method name "UserDataGenerator::build_category_name" is not in camel caps format
Open

    private function build_category_name($item)

Method name "UserDataGenerator::get_course_name_from_code_cached" is not in camel caps format
Open

    private function get_course_name_from_code_cached(string $courseCode): string

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

            isset($this->categorycache[$category_id])

Missing parameter name
Open

     * @param $item2

Missing parameter name
Open

     * @param $item1

Missing parameter name
Open

     * @param $score2

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

    private function get_category_cached(int $category_id)

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

            $cat = Category::load($category_id);

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

                $evals_filtered_copy = $evals;

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

            $evals_filtered = $evals_filtered_copy;

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

        $this->items = array_merge($evals_filtered, $links);

Missing parameter name
Open

     * @param $item1

Missing parameter name
Open

     * @param $item1

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

                $row[] = $this->build_average_column($item, $ignore_score_color);

Missing parameter name
Open

     * @param $item2

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

    private function build_result_column($item, $ignore_score_color)

Method name "UserDataGenerator::get_category_name_to_display" is not in camel caps format
Open

    private function get_category_name_to_display($cat)

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

            $evals_filtered = $evals;

Method name "UserDataGenerator::get_data" is not in camel caps format
Open

    public function get_data(

Method name "UserDataGenerator::compare_scores" is not in camel caps format
Open

    public function compare_scores($score1, $score2)

Method name "UserDataGenerator::build_course_name" is not in camel caps format
Open

    private function build_course_name($item)

Method name "UserDataGenerator::get_category_cached" is not in camel caps format
Open

    private function get_category_cached(int $category_id)

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

    private function build_average_column($item, $ignore_score_color)

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

            return $this->categorycache[$category_id];

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

        if ($ignore_score_color) {

Missing parameter name
Open

     * @param $item1

Method name "UserDataGenerator::sort_by_average" is not in camel caps format
Open

    public function sort_by_average($item1, $item2)

Missing parameter name
Open

     * @param $score1

Method name "UserDataGenerator::build_result_column" is not in camel caps format
Open

    private function build_result_column($item, $ignore_score_color)

Missing parameter name
Open

     * @param $item1

Missing parameter name
Open

     * @param $item1

Missing parameter name
Open

     * @param $item2

Method name "UserDataGenerator::sort_by_category" is not in camel caps format
Open

    public function sort_by_category($item1, $item2)

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

                $row[] = $this->build_result_column($item, $ignore_score_color);

Missing parameter name
Open

     * @param $item2

Method name "UserDataGenerator::sort_by_mask" is not in camel caps format
Open

    public function sort_by_mask($item1, $item2)

Method name "UserDataGenerator::sort_by_course" is not in camel caps format
Open

    public function sort_by_course($item1, $item2)

Method name "UserDataGenerator::sort_by_score" is not in camel caps format
Open

    public function sort_by_score($item1, $item2)

Method name "UserDataGenerator::build_mask_column" is not in camel caps format
Open

    private function build_mask_column($item, $ignore_score_color)

The variable $evals_filtered is not named in camelCase.
Open

    public function __construct($userid, $evals = [], $links = [])
    {
        $this->userid = $userid;
        $result = [];
        /** @var Evaluation $eval */

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

    private function build_result_column($item, $ignore_score_color)
    {
        $studscore = $this->scorecache[$item->get_item_type().$item->get_id()];
        $scoredisplay = ScoreDisplay::instance();
        $displaytype = SCORE_DIV_PERCENT;

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

    private function get_category_cached(int $category_id)
    {
        if (isset($this->categorycache) &&
            isset($this->categorycache[$category_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 $category_id is not named in camelCase.
Open

    private function get_category_cached(int $category_id)
    {
        if (isset($this->categorycache) &&
            isset($this->categorycache[$category_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 $evals_filtered is not named in camelCase.
Open

    public function __construct($userid, $evals = [], $links = [])
    {
        $this->userid = $userid;
        $result = [];
        /** @var Evaluation $eval */

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

    public function get_data(
        $sorting = 0,
        $start = 0,
        $count = null,
        $ignore_score_color = false

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

    public function get_data(
        $sorting = 0,
        $start = 0,
        $count = null,
        $ignore_score_color = false

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

    public function __construct($userid, $evals = [], $links = [])
    {
        $this->userid = $userid;
        $result = [];
        /** @var Evaluation $eval */

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

    private function get_category_cached(int $category_id)
    {
        if (isset($this->categorycache) &&
            isset($this->categorycache[$category_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 $ignore_score_color is not named in camelCase.
Open

    public function get_data(
        $sorting = 0,
        $start = 0,
        $count = null,
        $ignore_score_color = false

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

    public function __construct($userid, $evals = [], $links = [])
    {
        $this->userid = $userid;
        $result = [];
        /** @var Evaluation $eval */

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

    private function build_mask_column($item, $ignore_score_color)
    {
        $studscore = $this->scorecache[$item->get_item_type().$item->get_id()];
        $scoredisplay = ScoreDisplay::instance();
        $displaytype = SCORE_DIV_PERCENT;

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

    private function get_category_cached(int $category_id)
    {
        if (isset($this->categorycache) &&
            isset($this->categorycache[$category_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 $evals_filtered_copy is not named in camelCase.
Open

    public function __construct($userid, $evals = [], $links = [])
    {
        $this->userid = $userid;
        $result = [];
        /** @var Evaluation $eval */

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

    private function build_course_name($item)
    {
        return $this->get_course_name_from_code_cached($item->get_course_code());
    }

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

    private function build_result_column($item, $ignore_score_color)
    {
        $studscore = $this->scorecache[$item->get_item_type().$item->get_id()];
        $scoredisplay = ScoreDisplay::instance();
        $displaytype = SCORE_DIV_PERCENT;

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

    private function build_mask_column($item, $ignore_score_color)
    {
        $studscore = $this->scorecache[$item->get_item_type().$item->get_id()];
        $scoredisplay = ScoreDisplay::instance();
        $displaytype = SCORE_DIV_PERCENT;

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

    public function sort_by_name($item1, $item2)
    {
        return api_strnatcmp($item1->get_name(), $item2->get_name());
    }

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

    public function compare_scores($score1, $score2)
    {
        if (!isset($score1)) {
            return isset($score2) ? 1 : 0;
        } elseif (!isset($score2)) {

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

    private function get_category_name_to_display($cat)
    {
        if (isset($cat)) {
            if ('0' == $cat->get_parent_id() || null == $cat->get_parent_id()) {
                return '';

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

    public function sort_by_type($item1, $item2)
    {
        if ($item1->get_item_type() == $item2->get_item_type()) {
            return $this->sort_by_name($item1, $item2);
        } else {

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

    public function sort_by_score($item1, $item2)
    {
        $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()];
        $score2 = $this->scorecache[$item2->get_item_type().$item2->get_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

The method build_category_name is not named in camelCase.
Open

    private function build_category_name($item)
    {
        $cat = $this->get_category_cached($item->get_category_id());

        return $this->get_category_name_to_display($cat);

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

    public function get_total_items_count()
    {
        return count($this->items);
    }

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

    public function sort_by_average($item1, $item2)
    {
        $score1 = $this->avgcache[$item1->get_item_type().$item1->get_id()];
        $score2 = $this->avgcache[$item2->get_item_type().$item2->get_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

The method get_course_name_from_code_cached is not named in camelCase.
Open

    private function get_course_name_from_code_cached(string $courseCode): string
    {
        if (isset($this->coursecodecache) &&
            isset($this->coursecodecache[$courseCode])
        ) {

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

    public function sort_by_course($item1, $item2)
    {
        $name1 = api_strtolower(
            $this->get_course_name_from_code_cached($item1->get_course_code())
        );

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

    private function build_average_column($item, $ignore_score_color)
    {
        if (isset($this->avgcache)) {
            $avgscore = $this->avgcache[$item->get_item_type().$item->get_id()];
        } else {

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

    public function get_data(
        $sorting = 0,
        $start = 0,
        $count = null,
        $ignore_score_color = false

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

    public function sort_by_mask($item1, $item2)
    {
        $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()];
        $score2 = $this->scorecache[$item2->get_item_type().$item2->get_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

The method get_category_cached is not named in camelCase.
Open

    private function get_category_cached(int $category_id)
    {
        if (isset($this->categorycache) &&
            isset($this->categorycache[$category_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

The method sort_by_category is not named in camelCase.
Open

    public function sort_by_category($item1, $item2)
    {
        $cat1 = $this->get_category_cached($item1->get_category_id());
        $cat2 = $this->get_category_cached($item2->get_category_id());
        $name1 = api_strtolower($this->get_category_name_to_display($cat1));

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