chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

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

        } else {
            $name_log = $nameLog;
        }

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

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

        } else {
            $this->set_category_id($cat->getId());
            $this->save();
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

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

            foreach ($studentList as $userId => $position) {

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Avoid unused parameters such as '$name'.
Open

    public function set_name($name)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$stud_id'.
Open

    public function get_view_url($stud_id)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$max'.
Open

    public function set_max($max)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$description'.
Open

    public function set_description($description)

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

abstract class AbstractLink implements GradebookItem
{
    public $course_id;
    public $studentList;
    /** @var GradebookLink */

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

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

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

abstract class AbstractLink implements GradebookItem
{
    public $course_id;
    public $studentList;
    /** @var GradebookLink */

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 static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

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

    public function get_view_url($stud_id)
    {
        return null;
    }

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

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

abstract class AbstractLink implements GradebookItem
{
    public $course_id;
    public $studentList;
    /** @var GradebookLink */

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

abstract class AbstractLink implements GradebookItem
{
    public $course_id;
    public $studentList;
    /** @var GradebookLink */

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

    public function set_ref_id($ref_id)
    {
        $this->ref_id = $ref_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 $created_at is not named in camelCase.
Open

abstract class AbstractLink implements GradebookItem
{
    public $course_id;
    public $studentList;
    /** @var GradebookLink */

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

    public static function find_links($name_mask, $selectcat)
    {
        $rootcat = Category::load($selectcat);
        $links = $rootcat[0]->get_links((api_is_allowed_to_edit() ? null : api_get_user_id()), true);
        $foundlinks = [];

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

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

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

abstract class AbstractLink implements GradebookItem
{
    public $course_id;
    public $studentList;
    /** @var GradebookLink */

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

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

            $this->course_id = $courseId;

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

    public function get_user_id()

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

    public function get_weight()

Method name "AbstractLink::set_ref_id" is not in camel caps format
Open

    public function set_ref_id($ref_id)

Method name "AbstractLink::is_valid_link" is not in camel caps format
Open

    abstract public function is_valid_link();

Method name "AbstractLink::get_type_name" is not in camel caps format
Open

    abstract public function get_type_name();

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

    public function is_visible()

Missing function doc comment
Open

    public function set_type($type)

Missing function doc comment
Open

    public function set_ref_id($ref_id)

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

        $this->ref_id = $ref_id;

Method name "AbstractLink::get_ref_id" is not in camel caps format
Open

    public function get_ref_id()

Missing function doc comment
Open

    public function set_visible($visible)

Method name "AbstractLink::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)

Missing parameter name
Open

     * @param $locked

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

    public function get_category_id()

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

    public function get_date()

Missing function doc comment
Open

    public function get_weight()

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

        $this->created_at = $date;

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

        return $this->course_code;

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

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

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

    public $course_id;

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

        $this->course_id = api_get_course_int_id();

Method name "AbstractLink::get_link" is not in camel caps format
Open

    abstract public function get_link();

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

    public function set_category_id($category_id)

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

    public function set_user_id($user_id)

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

        $this->user_id = $user_id;

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

    public function set_date($date)

Missing function doc comment
Open

    public function set_weight($weight)

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

        return $this->user_id;

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

    public function set_id($id)

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

    public function set_ref_id($ref_id)

Missing function doc comment
Open

    public function set_user_id($user_id)

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

        $this->user_id = $user_id;

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

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

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

    public function set_session_id($id)

Method name "AbstractLink::needs_name_and_description" is not in camel caps format
Open

    abstract public function needs_name_and_description();

Method name "AbstractLink::needs_results" is not in camel caps format
Open

    abstract public function needs_results();

Method name "AbstractLink::is_allowed_to_change_name" is not in camel caps format
Open

    abstract public function is_allowed_to_change_name();

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

        return (int) $this->ref_id;

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

    public function set_weight($weight)

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

    public function get_id()

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

    public function set_category_id($category_id)

Missing function doc comment
Open

    public function get_date()

Method name "AbstractLink::get_session_id" is not in camel caps format
Open

    public function get_session_id()

Missing function doc comment
Open

    public function is_locked()

Missing function doc comment
Open

    public function set_id($id)

Method name "AbstractLink::needs_max" is not in camel caps format
Open

    abstract public function needs_max();

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

    public function is_locked()

Missing function doc comment
Open

    public function is_visible()

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

            $this->course_code = null;

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

    public function set_visible($visible)

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

    abstract public function has_results();

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

    public function get_course_code()

Missing function doc comment
Open

    public function get_view_url($stud_id)

Method name "AbstractLink::create_objects_from_sql_result" is not in camel caps format
Open

    private static function create_objects_from_sql_result(\Doctrine\DBAL\Result $result): array

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

        $category_id = null,

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

                        c_id = '".$this->course_id."' AND

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

                    ->setCourse(api_get_course_entity($this->course_id))

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

                    $this->course_id

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

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

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

            $sql .= ' user_id = '.intval($user_id);

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

            !empty($this->course_id) &&

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

        $description_log = isset($arreval['description']) ? $arreval['description'] : '';

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

        $tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);

Missing function doc comment
Open

    public function get_all_links()

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

        $ref_id = null,

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

            !empty($this->ref_id) &&

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

                $name_log = $arreval['course_id'];

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

    public function set_locked($locked)

Expected 2 spaces after parameter type; 4 found
Open

     * @param int    $id

Expected 2 spaces after parameter type; 4 found
Open

     * @param int    $user_id

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

            $sql .= ' category_id = '.intval($category_id);

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

    public function delete_linked_data()

Expected 2 spaces after parameter type; 4 found
Open

     * @param int    $category_id

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

        if (isset($user_id)) {

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

                $name_log = isset($_POST['name_link']) ? $_POST['name_link'] : $arreval['course_id'];

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

    public function get_item_type()

Missing function doc comment
Open

    public function delete_linked_data()

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

    public function get_type()

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

        return (int) $this->session_id;

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

        return $this->created_at;

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

    public function set_type($type)

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

        $this->session_id = $id;

Expected 2 spaces after parameter type; 4 found
Open

     * @param int    $ref_id

Expected 2 spaces after parameter type; 4 found
Open

     * @param int    $visible

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

        $categories = Category::load(null, null, $this->course_id, 0);

Missing function doc comment
Open

    public function add_linked_data()

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

    public function set_max($max)

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

        $this->ref_id = $ref_id;

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

            $this->course_id = null;

Expected 2 spaces after parameter type; 4 found
Open

     * @param int    $type

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

        if (isset($ref_id)) {

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

            $name_log = $nameLog;

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

        return (int) $this->course_id;

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

            'description' => $description_log,

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

            $sql .= ' ref_id = '.intval($ref_id);

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

    public function move_to_cat(GradebookCategory $cat)

Method name "AbstractLink::add_link_log" is not in camel caps format
Open

    public static function add_link_log($evaluationId, $nameLog = null)

Method name "AbstractLink::get_all_links" is not in camel caps format
Open

    public function get_all_links()

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

    public static function find_links($name_mask, $selectcat)

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Open

    {

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

            $link->set_session_id($session_id);

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

        if (isset($category_id)) {

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

            'title' => $name_log,

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

    public function get_target_categories()

Method name "AbstractLink::save_linked_data" is not in camel caps format
Open

    public function save_linked_data()

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

    public function set_description($description)

Missing function doc comment
Open

    public function save_linked_data()

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

        $user_id = null,

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

            $session_id = api_get_session_id();

Expected 1 spaces after parameter type; 4 found
Open

     * @param ?int    $courseId

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

        $sql = 'SELECT * FROM '.$tbl_grade_links;

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

                $name_log = $_POST['link_'.$evaluationId];

Method name "AbstractLink::find_links" is not in camel caps format
Open

    public static function find_links($name_mask, $selectcat)

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

    public function get_icon_name()

Method name "AbstractLink::add_linked_data" is not in camel caps format
Open

    public function add_linked_data()

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

    public function set_name($name)

Method name "AbstractLink::get_view_url" is not in camel caps format
Open

    public function get_view_url($stud_id)

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

    public function get_view_url($stud_id)

Opening brace should be on a new line
Open

    public function setCourseId(?int $courseId = null): AbstractLink {

The variable $user_id is not named in camelCase.
Open

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $category_id is not named in camelCase.
Open

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

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

    public static function add_link_log($evaluationId, $nameLog = null)
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
        $dateobject = self::load($evaluationId, null, null, null, null);
        $now = api_get_utc_datetime();

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

    public static function add_link_log($evaluationId, $nameLog = null)
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
        $dateobject = self::load($evaluationId, null, null, null, null);
        $now = api_get_utc_datetime();

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

    public static function add_link_log($evaluationId, $nameLog = null)
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
        $dateobject = self::load($evaluationId, null, null, null, null);
        $now = api_get_utc_datetime();

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

    public static function add_link_log($evaluationId, $nameLog = null)
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
        $dateobject = self::load($evaluationId, null, null, null, null);
        $now = api_get_utc_datetime();

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

    public static function add_link_log($evaluationId, $nameLog = null)
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
        $dateobject = self::load($evaluationId, null, null, null, null);
        $now = api_get_utc_datetime();

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $category_id is not named in camelCase.
Open

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

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

    public static function add_link_log($evaluationId, $nameLog = null)
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
        $dateobject = self::load($evaluationId, null, null, null, null);
        $now = api_get_utc_datetime();

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

    public static function add_link_log($evaluationId, $nameLog = null)
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
        $dateobject = self::load($evaluationId, null, null, null, null);
        $now = api_get_utc_datetime();

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 static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

    public function set_ref_id($ref_id)
    {
        $this->ref_id = $ref_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_links is not named in camelCase.
Open

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

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

    private static function create_objects_from_sql_result(\Doctrine\DBAL\Result $result): array
    {
        $links = [];
        $allow = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
        if ($allow) {

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

    private static function create_objects_from_sql_result(\Doctrine\DBAL\Result $result): array
    {
        $links = [];
        $allow = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
        if ($allow) {

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

    public static function load(
        $id = null,
        $type = null,
        $ref_id = null,
        $user_id = null,

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 find_links($name_mask, $selectcat)
    {
        $rootcat = Category::load($selectcat);
        $links = $rootcat[0]->get_links((api_is_allowed_to_edit() ? null : api_get_user_id()), true);
        $foundlinks = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The method get_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_ref_id is not named in camelCase.
Open

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

    public function set_ref_id($ref_id)
    {
        $this->ref_id = $ref_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_target_categories is not named in camelCase.
Open

    public function get_target_categories()
    {
        // links can only be moved to categories inside this course
        $targets = [];
        $level = 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 get_item_type is not named in camelCase.
Open

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

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)
    {
    }

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

    private static function create_objects_from_sql_result(\Doctrine\DBAL\Result $result): array
    {
        $links = [];
        $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 needs_name_and_description is not named in camelCase.
Open

    abstract public function needs_name_and_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 get_id is not named in camelCase.
Open

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

    public static function add_link_log($evaluationId, $nameLog = null)
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
        $dateobject = self::load($evaluationId, null, null, null, null);
        $now = api_get_utc_datetime();

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

    public function add_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 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 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_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 is_valid_link is not named in camelCase.
Open

    abstract public function is_valid_link();

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

    abstract public function get_type_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 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_all_links is not named in camelCase.
Open

    public function get_all_links()
    {
        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 get_link is not named in camelCase.
Open

    abstract public function get_link();

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

    abstract public function needs_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 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 set_session_id is not named in camelCase.
Open

    public function set_session_id($id)
    {
        $this->session_id = $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 move_to_cat is not named in camelCase.
Open

    public function move_to_cat(GradebookCategory $cat)
    {
        if ($this->getCourseId() != $cat->getCourse()->getId()) {
            $this->delete();
        } 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 find_links is not named in camelCase.
Open

    public static function find_links($name_mask, $selectcat)
    {
        $rootcat = Category::load($selectcat);
        $links = $rootcat[0]->get_links((api_is_allowed_to_edit() ? null : api_get_user_id()), true);
        $foundlinks = [];

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)
    {
    }

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

    abstract public function needs_results();

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

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

    public function set_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 get_view_url is not named in camelCase.
Open

    public function get_view_url($stud_id)
    {
        return null;
    }

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

    abstract public function has_results();

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

    public function save_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_session_id is not named in camelCase.
Open

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

    public function get_icon_name()
    {
        return 'link';
    }

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