chamilo/chamilo-lms

View on GitHub
public/main/gradebook/lib/fe/catform.class.php

Summary

Maintainability
A
0 mins
Test Coverage

The method build_basic_form() has an NPath complexity of 414720. The configured NPath complexity threshold is 200.
Open

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category name'),

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 '357', column '24').
Open

            $obj = new GradeModel();

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

            } else {
                $questionWeighting = $value;
                $defaultCertification = api_number_format($this->category_object->getCertificateMinScore(), 2);
                $select = $this->addSelect(
                    'certif_min_score',

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $this->addElement('checkbox', 'visible', null, get_lang('Visible'));
        }

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $this->addElement('hidden', 'editcat', (int) $_GET['editcat']);
            $this->addButtonUpdate(get_lang('Edit this category'));
        }

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            } else {
                $select->addOption($line.' '.$cat[1], $cat[0], 'disabled');
            }

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $this->setDefaults(
                [
                    'hid_user_id' => $this->category_object->get_user_id(),
                    'hid_parent_id' => $this->category_object->get_parent_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 property $category_object is not named in camelCase.
Open

class CatForm extends FormValidator
{
    public const TYPE_ADD = 1;
    public const TYPE_EDIT = 2;
    public const TYPE_MOVE = 3;

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

    public function __construct(
        $form_type,
        $category_object,
        $form_name,
        $method = 'post',

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

    public function __construct(
        $form_type,
        $category_object,
        $form_name,
        $method = 'post',

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

    public function __construct(
        $form_type,
        $category_object,
        $form_name,
        $method = 'post',

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

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

            if ($cat[0] != $this->category_object->get_parent_id()) {

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

        if (!empty($this->category_object) && 0 == $this->category_object->get_parent_id()) {

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

                'is_requirement' => $this->category_object->getIsRequirement(),

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

        $this->addElement('hidden', 'hid_id', $this->category_object->get_id());

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

                $skills = $this->category_object->get_skills();

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

        if ('0' == $this->category_object->get_parent_id()) {

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

        $test_cats = Category::load(

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

            'hid_user_id' => $this->category_object->get_user_id(),

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

            $value = $global_weight;

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

            $session_id,

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

        $category_name = $this->category_object->get_name();

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

        $category_name = $this->category_object->get_name();

Method name "CatForm::build_basic_form" is not in camel caps format
Open

    private function build_basic_form()

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

        if (!empty($this->category_object) && 0 == $this->category_object->get_parent_id()) {

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

                $defaultCertification = api_number_format($this->category_object->getCertificateMinScore(), 2);

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

        $form_type,

Method name "CatForm::build_add_form" is not in camel caps format
Open

    protected function build_add_form()

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

            $this->category_object->getCourseId()

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

        if (isset($global_weight)) {

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

        parent::__construct($form_name, $method, $action);

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

            '"'.$this->category_object->get_name().'" '

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

                'visible' => $this->category_object->is_visible(),

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

            'hid_parent_id' => $this->category_object->get_parent_id(),

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

        $category_object,

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

                $category_name = $course_code;

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

                'description' => $this->category_object->get_description(),

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

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

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

        $form_name,

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

            $this->category_object = $category_object;

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

                $this->category_object->getCourseId()

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

        $this->form_type = $form_type;

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

        if (isset($category_object)) {

Method name "CatForm::build_editing_form" is not in camel caps format
Open

    protected function build_editing_form()

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

        $grade_model_id = $this->category_object->get_grade_model_id();

Method name "CatForm::build_move_form" is not in camel caps format
Open

    protected function build_move_form()

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

                $category_name = $course_code;

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

                    'select_course' => $this->category_object->get_course_code(),

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

            $this->category_object->get_course_code()

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

        $course_code = api_get_course_id();

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

        if (!empty($this->category_object) && 0 == $this->category_object->get_parent_id()) {

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

        $session_id = api_get_session_id();

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

                'hid_parent_id' => $this->category_object->get_parent_id(),

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

            0 == $this->category_object->get_parent_id()

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

                'weight' => $this->category_object->get_weight(),

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

            $this->category_object = $category_object;

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

                    'hid_parent_id' => $this->category_object->get_parent_id(),

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

        foreach ($this->category_object->get_target_categories() as $cat) {

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

            $links = $test_cats[0]->get_links();

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

                    'hid_user_id' => $this->category_object->get_user_id(),

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

        $grade_model_id = $this->category_object->get_grade_model_id();

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

                'hid_user_id' => $this->category_object->get_user_id(),

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

                'generate_certificates' => $this->category_object->getGenerateCertificates(),

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

            $grade_model_id = 0;

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

        $global_weight = api_get_setting('gradebook_default_weight');

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

        if (!empty($this->category_object) && 0 == $this->category_object->get_parent_id()) {

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

        if (!empty($this->category_object) &&

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

        if (!empty($this->category_object) &&

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

        $this->form_type = $form_type;

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

                    'hid_user_id' => $this->category_object->get_user_id(),

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

                'name' => $category_name,

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

                'certif_min_score' => $this->category_object->getCertificateMinScore(),

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

        switch ($this->form_type) {

Method name "CatForm::build_select_course_form" is not in camel caps format
Open

    protected function build_select_course_form()

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

            $defaultCertification = $this->category_object->getCertificateMinScore();

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

                    'hid_parent_id' => $this->category_object->get_parent_id(),

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

                $this->category_object->get_course_code()

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

            0 == $this->category_object->get_parent_id() &&

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

        $skills = $this->category_object->getSkillsForSelect();

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

        if (isset($test_cats[0])) {

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

            if (empty($category_name)) {

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

                'grade_model_id' => $grade_model_id,

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

                $links = $test_cats[0]->get_links();

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

        $visibility_default = 1;

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

            $test_cats = Category::load(

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

            if ($this->category_object->getGenerateCertificates()) {

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

            $session_id = api_get_session_id();

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

            if (count($test_cats) > 1 || !empty($links)) {

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

            $visibility_default = 0;

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

        $documentId = $this->category_object->getDocumentId();

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

                'visible' => $visibility_default,

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

                $this->category_object->get_grade_model_id()

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

                $session_id,

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

            if (!empty($test_cats[0])) {

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

        if ($this->category_object->getIsRequirement()) {

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

        if (self::TYPE_ADD == $this->form_type) {

The variable $test_cats is not named in camelCase.
Open

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $visibility_default is not named in camelCase.
Open

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $visibility_default is not named in camelCase.
Open

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $session_id is not named in camelCase.
Open

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

        $course_code = api_get_course_id();

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $category_name is not named in camelCase.
Open

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    public function __construct(
        $form_type,
        $category_object,
        $form_name,
        $method = 'post',

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $course_code is not named in camelCase.
Open

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

        $course_code = api_get_course_id();

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $category_name is not named in camelCase.
Open

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

        $course_code = api_get_course_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 function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $session_id is not named in camelCase.
Open

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $test_cats is not named in camelCase.
Open

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $category_object is not named in camelCase.
Open

    public function __construct(
        $form_type,
        $category_object,
        $form_name,
        $method = 'post',

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

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $test_cats is not named in camelCase.
Open

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $test_cats is not named in camelCase.
Open

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $session_id is not named in camelCase.
Open

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $form_name is not named in camelCase.
Open

    public function __construct(
        $form_type,
        $category_object,
        $form_name,
        $method = 'post',

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

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

        $course_code = api_get_course_id();

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $category_name is not named in camelCase.
Open

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 $category_object is not named in camelCase.
Open

    public function __construct(
        $form_type,
        $category_object,
        $form_name,
        $method = 'post',

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

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

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

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 method build_move_form is not named in camelCase.
Open

    protected function build_move_form()
    {
        $renderer = &$this->defaultRenderer();
        $renderer->setCustomElementTemplate('<span>{element}</span> ');
        $this->addElement(

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method build_select_course_form is not named in camelCase.
Open

    protected function build_select_course_form()
    {
        $select = $this->addSelect(
            'select_course',
            [get_lang('Pick a course'), 'test'],

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method build_basic_form is not named in camelCase.
Open

    private function build_basic_form()
    {
        $this->addText(
            'name',
            get_lang('Category 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 build_add_form is not named in camelCase.
Open

    protected function build_add_form()
    {
        // check if we are a root category
        // if so, you can only choose between courses
        if ('0' == $this->category_object->get_parent_id()) {

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method build_editing_form is not named in camelCase.
Open

    protected function build_editing_form()
    {
        $skills = $this->category_object->getSkillsForSelect();

        $course_code = api_get_course_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