chamilo/chamilo-lms

View on GitHub
public/main/gradebook/lib/be/evaluation.class.php

Summary

Maintainability
A
0 mins
Test Coverage

The method load() has an NPath complexity of 1152. The configured NPath complexity threshold is 200.
Open

    public static function load(
        ?int $id = 0,
        ?int $userId = 0,
        ?int $courseId = 0,
        ?int $categoryId = 0,

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 calc_score() has an NPath complexity of 3825. The configured NPath complexity threshold is 200.
Open

    public function calc_score($studentId = null, $type = null): array
    {
        $allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));

        if ($allowStats) {

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 '422', column '25').
Open

        $eval_log = new Evaluation();

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 '364', column '25').
Open

            $eval = new Evaluation();

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 '966', column '29').
Open

                $eval = new Evaluation();

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

            } else {
                $sql .= ' WHERE';
            }

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

        } else {
            $sql .= ' AND user_id = '.api_get_user_id();
        }

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

            } else {
                $sql .= ' WHERE';
            }

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

        } else {
            $sql .= ' AND category_id = '.intval($parent);
        }

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

        } else {
            $sql .= '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 setCourseId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $this->course_code = null;
            $this->courseId = 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 save uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $sql .= '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 calc_score uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $count = 0;
            $sum = 0;
            $bestResult = 0;
            $weight = 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 does_name_exist uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $sql .= ' AND user_id = '.api_get_user_id();
            }

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

            } else {
                $sql .= ' WHERE';
            }

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

            } else {
                $sql .= ' WHERE';
            }

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

        } else {
            $sql .= ' AND category_id >= 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 save uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $sql .= '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 load uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $sql .= ' WHERE';
            }

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

        } else {
            if ($this->is_locked()) {
                api_not_allowed();
            }
        }

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

                        } else {
                            $studentCount = count($evaluation->getUserScoreList());
                            $sumResult = array_sum($evaluation->getUserScoreList());
                            $result = [$sumResult, $studentCount];
                        }

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

    public static function findEvaluations($name_mask, $selectcat)
    {
        $rootcat = Category::load($selectcat);
        $evals = $rootcat[0]->get_evaluations(
            (api_is_allowed_to_create_course() ? null : api_get_user_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 property $user_id is not named in camelCase.
Open

class Evaluation implements GradebookItem
{
    public $studentList;
    public GradebookEvaluation $entity;
    private int $id;

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $course_code is not named in camelCase.
Open

class Evaluation implements GradebookItem
{
    public $studentList;
    public GradebookEvaluation $entity;
    private int $id;

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $category_id is not named in camelCase.
Open

    public function set_category_id($category_id)
    {
        $categories = Category::load($category_id);
        if (isset($categories[0])) {
            $this->setCategory($categories[0]);

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

    public function set_user_id($user_id)
    {
        $this->user_id = $user_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 $cat_id is not named in camelCase.
Open

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

class Evaluation implements GradebookItem
{
    public $studentList;
    public GradebookEvaluation $entity;
    private int $id;

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $stud_id is not named in camelCase.
Open

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

class Evaluation implements GradebookItem
{
    public $studentList;
    public GradebookEvaluation $entity;
    private int $id;

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $first_letter_user is not named in camelCase.
Open

    public function get_not_subscribed_students($first_letter_user = '')
    {
        $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

Member variable "created_at" is not in valid camel caps format
Open

    private string $created_at;

Method name "Evaluation::set_name" is not in camel caps format
Open

    public function set_name($name)

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

        $this->user_id = $user_id;

Method name "Evaluation::set_date" is not in camel caps format
Open

    public function set_date($date)

Method name "Evaluation::set_locked" is not in camel caps format
Open

    public function set_locked($locked)

Expected 5 spaces after parameter name; 2 found
Open

     * @param ?int  $locked  Whether it is locked or not

Method name "Evaluation::does_name_exist" is not in camel caps format
Open

    public function does_name_exist($name, $parent)

Method name "Evaluation::has_results" is not in camel caps format
Open

    public function has_results(): bool

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

        if (isset($cat_id)) {

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

    public function get_not_subscribed_students($first_letter_user = '')

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

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

Missing function doc comment
Open

    public function get_user_id()

Method name "Evaluation::set_session_id" is not in camel caps format
Open

    public function set_session_id($sessionId)

Expected 1 spaces after parameter type; 2 found
Open

     * @param ?int  $locked  Whether it is locked or not

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

            $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);

Method name "Evaluation::get_icon_name" is not in camel caps format
Open

    public function get_icon_name()

Missing parameter name
Open

     * @param int locked 1 or unlocked 0

Method name "Evaluation::check_lock_permissions" is not in camel caps format
Open

    public function check_lock_permissions()

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

            isset($this->eval_max) &&

Expected 17 spaces after parameter type; 1 found
Open

     * @param string $name to check (if not given, the name property of this object will be checked)

Method name "Evaluation::move_to_cat" is not in camel caps format
Open

    public function move_to_cat(GradebookCategory $cat)

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

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array

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

        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);

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

                    SELECT evaluation_id FROM '.$tbl_grade_results.'

Method name "Evaluation::get_not_subscribed_students" is not in camel caps format
Open

    public function get_not_subscribed_students($first_letter_user = '')

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

    public static function findEvaluations($name_mask, $selectcat)

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

            $this->course_code = null;

Method name "Evaluation::create_evaluation_objects_from_sql_result" is not in camel caps format
Open

    private static function create_evaluation_objects_from_sql_result($result)

Missing function doc comment
Open

    public function get_course_code()

Missing function doc comment
Open

    public function get_date()

Method name "Evaluation::get_date" is not in camel caps format
Open

    public function get_date()

Method name "Evaluation::get_locked" is not in camel caps format
Open

    public function get_locked()

Missing function doc comment
Open

    public function set_visible($visible)

Missing function doc comment
Open

    public function set_session_id($sessionId)

Expected 1 spaces after parameter type; 2 found
Open

     * @param ?int  $categoryId parent category

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

                    'weight' => $row_old_weight['weight'],

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

        $eval_log = new Evaluation();

Method name "Evaluation::delete_results" is not in camel caps format
Open

    public function delete_results(): void

Method name "Evaluation::delete_with_results" is not in camel caps format
Open

    public function delete_with_results(): void

Method name "Evaluation::calc_score" is not in camel caps format
Open

    public function calc_score($studentId = null, $type = null): array

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

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array

Missing function doc comment
Open

    public function get_item_type()

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

        $this->user_id = $user_id;

Missing function doc comment
Open

    public function set_weight($weight)

Missing function doc comment
Open

    public function set_max($max)

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

            $tbl_grade_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);

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

                $row_old_weight = Database::fetch_assoc($rs);

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

                    lastname LIKE '".Database::escape_string($first_letter_user)."%' AND

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

            if (!(false === api_strpos(api_strtolower($eval->get_name()), api_strtolower($name_mask)))) {

Member variable "course_code" is not in valid camel caps format
Open

    private ?string $course_code;

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

        $this->created_at = $date;

Method name "Evaluation::set_type" is not in camel caps format
Open

    public function set_type($type)

Expected 9 spaces after parameter name; 1 found
Open

     * @param ?int $id evaluation id

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

                $sql = 'SELECT weight from '.$tbl_grade_evaluations.'

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

                    'created_at' => $current_date,

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

        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);

Method name "Evaluation::get_evaluations_with_result_for_student" is not in camel caps format
Open

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array

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

                    WHERE user_id = '.$stud_id.' AND score IS NOT NULL

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

        $tbl_user = Database::get_main_table(TABLE_MAIN_USER);

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

            $this->course_code = $courseInfo['code'];

Method name "Evaluation::get_category_id" is not in camel caps format
Open

    public function get_category_id()

Method name "Evaluation::get_description" is not in camel caps format
Open

    public function get_description()

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

        return $this->created_at;

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

        return $this->eval_max;

Method name "Evaluation::is_visible" is not in camel caps format
Open

    public function is_visible()

Missing function doc comment
Open

    public function is_locked()

Method name "Evaluation::set_user_id" is not in camel caps format
Open

    public function set_user_id($user_id)

Missing function doc comment
Open

    public function set_date($date)

Method name "Evaluation::set_weight" is not in camel caps format
Open

    public function set_weight($weight)

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

        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);

Method name "Evaluation::get_target_categories" is not in camel caps format
Open

    public function get_target_categories(): array

Missing function doc comment
Open

    public function get_icon_name()

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

    public function set_category_id($category_id)

Method name "Evaluation::get_name" is not in camel caps format
Open

    public function get_name()

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

    public function set_user_id($user_id)

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

                FROM $tbl_grade_evaluations

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

        return is_numeric($score) && $score >= 0 && $score <= $this->eval_max;

Method name "Evaluation::get_item_type" is not in camel caps format
Open

    public function get_item_type()

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

        $sql = "UPDATE $table_evaluation

Missing function doc comment
Open

    public function delete_linked_data()

Method name "Evaluation::get_user_id" is not in camel caps format
Open

    public function get_user_id()

Method name "Evaluation::set_id" is not in camel caps format
Open

    public function set_id($id)

Method name "Evaluation::set_description" is not in camel caps format
Open

    public function set_description($description)

Expected 1 spaces after parameter type; 2 found
Open

     * @param ?int  $visible Whether it is visible or not

Missing parameter name
Open

     * @param        $parent parent category

Missing function doc comment
Open

    public function check_lock_permissions()

Missing function doc comment
Open

    public function get_max()

Method name "Evaluation::is_locked" is not in camel caps format
Open

    public function is_locked()

Method name "Evaluation::set_category_id" is not in camel caps format
Open

    public function set_category_id($category_id)

Missing function doc comment
Open

    public function set_description($description)

Expected 5 spaces after parameter name; 1 found
Open

     * @param ?int $userId user id (evaluation owner)

Method name "Evaluation::get_id" is not in camel caps format
Open

    public function get_id()

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

        $sql = 'SELECT * FROM '.$tbl_grade_evaluations.'

Method name "Evaluation::get_course_code" is not in camel caps format
Open

    public function get_course_code()

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

            $sql .= ' AND category_id = '.$cat_id;

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

        return $this->course_code;

Method name "Evaluation::get_weight" is not in camel caps format
Open

    public function get_weight()

Missing function doc comment
Open

    public function get_type()

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

        $this->eval_max = $max;

Missing function doc comment
Open

    public function set_type($type)

Blank line found at start of control structure
Open

        ) {

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

                $current_date = api_get_utc_datetime();

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

        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

Method name "Evaluation::get_max" is not in camel caps format
Open

    public function get_max()

Method name "Evaluation::get_type" is not in camel caps format
Open

    public function get_type()

Missing function doc comment
Open

    public function get_locked()

Missing function doc comment
Open

    public function getCourseId()

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

        $sql = 'UPDATE '.$tbl_grade_evaluations

Missing parameter name
Open

     * @param $list

Missing function doc comment
Open

    public function get_weight()

Missing function doc comment
Open

    public function is_visible()

Method name "Evaluation::set_visible" is not in camel caps format
Open

    public function set_visible($visible)

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

                Database::insert($tbl_grade_linkeval_log, $params);

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

                FROM $tbl_user

Method name "Evaluation::delete_linked_data" is not in camel caps format
Open

    public function delete_linked_data()

Member variable "user_id" is not in valid camel caps format
Open

    private int $user_id;

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

        return $this->user_id;

Missing function doc comment
Open

    public function set_id($id)

Missing function doc comment
Open

    public function set_name($name)

Missing function doc comment
Open

    public function set_user_id($user_id)

Method name "Evaluation::set_max" is not in camel caps format
Open

    public function set_max($max)

Expected 3 spaces after parameter name; 1 found
Open

     * @param ?int $courseId course code

Expected 2 spaces after parameter name; 1 found
Open

     * @param ?int $cat_id parent category (use 'null' to retrieve them in all categories)

Missing function doc comment
Open

    public function set_locked($locked)

Expected 4 spaces after parameter name; 1 found
Open

     * @param ?int  $visible Whether it is visible or not

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

        $eval_log->addEvaluationLog($this->id);

Method name "Evaluation::is_valid_score" is not in camel caps format
Open

    public function is_valid_score(mixed $score): bool

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

        $table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);

The variable $current_date is not named in camelCase.
Open

    public function addEvaluationLog($id)
    {
        if (!empty($id)) {
            $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
            $tbl_grade_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);

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

    public function save()
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $sql = 'UPDATE '.$tbl_grade_evaluations
            ." SET title = '".Database::escape_string($this->get_name())."'"

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

    public function get_not_subscribed_students($first_letter_user = '')
    {
        $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public function lock($locked)
    {
        $table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $sql = "UPDATE $table_evaluation
                SET locked = '".intval($locked)."'

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

    public function addEvaluationLog($id)
    {
        if (!empty($id)) {
            $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
            $tbl_grade_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);

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

    public function does_name_exist($name, $parent)
    {
        if (!isset($name)) {
            $name = $this->name;
            $parent = $this->category;

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

    public function addEvaluationLog($id)
    {
        if (!empty($id)) {
            $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
            $tbl_grade_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);

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

    public function addEvaluationLog($id)
    {
        if (!empty($id)) {
            $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
            $tbl_grade_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);

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

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public function addEvaluationLog($id)
    {
        if (!empty($id)) {
            $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
            $tbl_grade_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);

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

    public function does_name_exist($name, $parent)
    {
        if (!isset($name)) {
            $name = $this->name;
            $parent = $this->category;

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

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public function addEvaluationLog($id)
    {
        if (!empty($id)) {
            $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
            $tbl_grade_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);

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

    public function save()
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $sql = 'UPDATE '.$tbl_grade_evaluations
            ." SET title = '".Database::escape_string($this->get_name())."'"

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

    public function addEvaluationLog($id)
    {
        if (!empty($id)) {
            $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
            $tbl_grade_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);

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

    public function get_not_subscribed_students($first_letter_user = '')
    {
        $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public static function findEvaluations($name_mask, $selectcat)
    {
        $rootcat = Category::load($selectcat);
        $evals = $rootcat[0]->get_evaluations(
            (api_is_allowed_to_create_course() ? null : api_get_user_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 $tbl_grade_evaluations is not named in camelCase.
Open

    public function addEvaluationLog($id)
    {
        if (!empty($id)) {
            $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
            $tbl_grade_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);

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

    public function save()
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $sql = 'UPDATE '.$tbl_grade_evaluations
            ." SET title = '".Database::escape_string($this->get_name())."'"

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

    public function save()
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $sql = 'UPDATE '.$tbl_grade_evaluations
            ." SET title = '".Database::escape_string($this->get_name())."'"

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

    public function lock($locked)
    {
        $table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $sql = "UPDATE $table_evaluation
                SET locked = '".intval($locked)."'

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

    public function set_user_id($user_id)
    {
        $this->user_id = $user_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 $cat_id is not named in camelCase.
Open

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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 function set_category_id($category_id)
    {
        $categories = Category::load($category_id);
        if (isset($categories[0])) {
            $this->setCategory($categories[0]);

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

    public function get_not_subscribed_students($first_letter_user = '')
    {
        $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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 get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public function is_visible()
    {
        return $this->visible;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_user_id is not named in camelCase.
Open

    public function set_user_id($user_id)
    {
        $this->user_id = $user_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 delete_results is not named in camelCase.
Open

    public function delete_results(): void
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
        $sql = 'DELETE FROM '.$table.'
                WHERE evaluation_id = '.$this->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_not_subscribed_students is not named in camelCase.
Open

    public function get_not_subscribed_students($first_letter_user = '')
    {
        $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public function get_item_type()
    {
        return 'E';
    }

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

    public function get_id()
    {
        return (int) $this->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 set_weight is not named in camelCase.
Open

    public function set_weight($weight)
    {
        $this->weight = $weight;
    }

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

    public function get_icon_name()
    {
        return $this->has_results() ? 'evalnotempty' : 'evalempty';
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_category_id is not named in camelCase.
Open

    public function set_category_id($category_id)
    {
        $categories = Category::load($category_id);
        if (isset($categories[0])) {
            $this->setCategory($categories[0]);

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

    public function move_to_cat(GradebookCategory $cat)
    {
        $this->set_category_id($cat->getId());
        $categoryCourseId = $cat->getCourse()->getId();
        if ($this->getCourseId() != $categoryCourseId) {

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_name is not named in camelCase.
Open

    public function set_name($name)
    {
        $this->name = $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 set_locked is not named in camelCase.
Open

    public function set_locked($locked)
    {
        $this->locked = $locked;
    }

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

    public function get_weight()
    {
        return $this->weight;
    }

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

    private static function create_evaluation_objects_from_sql_result($result)
    {
        $alleval = [];
        $allow = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
        if ($allow) {

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

    public function get_type()
    {
        return $this->type ?? '';
    }

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

    public function get_date()
    {
        return $this->created_at;
    }

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

    public function does_name_exist($name, $parent)
    {
        if (!isset($name)) {
            $name = $this->name;
            $parent = $this->category;

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_visible is not named in camelCase.
Open

    public function set_visible($visible)
    {
        $this->visible = $visible;
    }

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

    public function get_category_id()
    {
        return $this->category->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_max is not named in camelCase.
Open

    public function get_max()
    {
        return $this->eval_max;
    }

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

    public function check_lock_permissions()
    {
        if (api_is_platform_admin()) {
            return true;
        } 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_locked is not named in camelCase.
Open

    public function get_locked()
    {
        return $this->locked ?? 0;
    }

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

    public function is_locked()
    {
        return isset($this->locked) && 1 == $this->locked ? true : 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 delete_with_results is not named in camelCase.
Open

    public function delete_with_results(): void
    {
        $this->delete_results();
        $this->delete();
    }

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

    public function is_valid_score(mixed $score): bool
    {
        return is_numeric($score) && $score >= 0 && $score <= $this->eval_max;
    }

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

    public function calc_score($studentId = null, $type = null): array
    {
        $allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));

        if ($allowStats) {

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

    public function get_target_categories(): array
    {
        // - course independent evaluation
        //   -> movable to root or other course independent categories
        // - evaluation inside a course

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

    public function get_name()
    {
        return $this->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 set_max is not named in camelCase.
Open

    public function set_max($max)
    {
        $this->eval_max = $max;
    }

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

    public static function get_evaluations_with_result_for_student(int $stud_id, ?int $cat_id = null): array
    {
        $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
        $tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);

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

    public function delete_linked_data()
    {
    }

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

    public function get_user_id()
    {
        return $this->user_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_code is not named in camelCase.
Open

    public function get_course_code()
    {
        return $this->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 set_description is not named in camelCase.
Open

    public function set_description($description)
    {
        $this->description = $description;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_date is not named in camelCase.
Open

    public function set_date($date)
    {
        $this->created_at = $date;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_type is not named in camelCase.
Open

    public function set_type($type)
    {
        $this->type = $type;
    }

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

    public function get_description()
    {
        return $this->description;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_session_id is not named in camelCase.
Open

    public function set_session_id($sessionId)
    {
        $this->setSessionId($sessionId);
    }

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

    public function has_results(): bool
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
        $sql = 'SELECT count(id) AS number
                FROM '.$table.'

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_id is not named in camelCase.
Open

    public function set_id($id)
    {
        $this->id = (int) $id;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status