chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/SkillModel.php

Summary

Maintainability
A
0 mins
Test Coverage

The method processSkillListSimple() has an NPath complexity of 390. The configured NPath complexity threshold is 200.
Open

    public function processSkillListSimple($skills, string $imageSize = 'mini', string $style = '', bool $showBadge = true, bool $showTitle = true): string
    {
        if (empty($skills)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

NPathComplexity

Since: 0.1

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

Example

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

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

The method getUserSkillsTable() has an NPath complexity of 98000. The configured NPath complexity threshold is 200.
Open

    public function getUserSkillsTable(int $userId, int $courseId = 0, int $sessionId = 0, bool $addTitle = true): array
    {
        $skills = $this->getUserSkills($userId, true, $courseId, $sessionId);
        $courseTempList = [];
        $tableRows = [];
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

NPathComplexity

Since: 0.1

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

Example

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

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

The method getSkillsTree() has an NPath complexity of 222000. The configured NPath complexity threshold is 200.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

NPathComplexity

Since: 0.1

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

Example

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

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

The method saveSkillsToCourse() has an NPath complexity of 480. The configured NPath complexity threshold is 200.
Open

    public static function saveSkillsToCourse($skills, $courseId, $sessionId)
    {
        $allowSkillInTools = ('true' === api_get_setting('skill.allow_skill_rel_items'));
        if (!$allowSkillInTools) {
            return false;
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

NPathComplexity

Since: 0.1

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

Example

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

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

The class SkillModel has a coupling between objects value of 37. Consider to reduce the number of dependencies under 13.
Open

class SkillModel extends Model
{
    public $columns = [
        'id',
        'title',
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

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

Missing class import via use statement (line '251', column '30').
Open

        $skillRelSkill = new SkillRelSkillModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '429', column '30').
Open

        $skillRelSkill = new SkillRelSkillModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '561', column '31').
Open

        $skill_rel_user = new SkillRelUserModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '447', column '30').
Open

        $skillRelSkill = new SkillRelSkillModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '409', column '30').
Open

        $skillRelSkill = new SkillRelSkillModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '359', column '38').
Open

                $skillRelSkill = new SkillRelSkillModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '625', column '30').
Open

        $skillRelSkill = new SkillRelSkillModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '626', column '34').
Open

        $skillRelGradebook = new SkillRelGradebookModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '465', column '30').
Open

        $skillRelSkill = new SkillRelSkillModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '502', column '30').
Open

        $skillRelSkill = new SkillRelSkillModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '1812', column '27').
Open

        $extraField = new ExtraField('skill');
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '2396', column '20').
Open

        $png = new PNGImageBaker($imageContent);
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '1752', column '29').
Open

        $objGradebook = new Gradebook();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '1889', column '33').
Open

            $skillRelUser = new SkillRelUserModel();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

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

            } else {
                $html .= $item;
            }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $imageSize = "img_$imageSize";
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            } else {
                $html .= Display::url($item, '#', ['target' => '_blank', 'style' => $style]);
            }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

                } else {
                    $courseInfo = api_get_course_info_by_id($courseId);
                    $courseTempList[$courseId] = $courseInfo;
                }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

                            } else {
                                $nextVertex = $graph->createVertex($old['id']);
                                $nextVertex->setAttribute('graphviz.data', $old['data']);
                            }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

                } else {
                    // Getting "root" vertex
                    $root = $graph->getVertex(1);
                    $table = '';
                    /** @var Vertex $vertex */
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

                } else {
                    if ($skill['parent_id'] == $skill_id) {
                        $family[$skill['id']] = $this->getAllChildren($skill['id']);
                    }
                    /*if ($skill_id == $skill['id']) {
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            } else {
                // Moving node to the children index of their parents
                foreach ($skills as $my_skill_id => &$skill) {
                    if (isset($new_family_array[$skill['id']])) {
                        $skill['data']['family_id'] = $new_family_array[$skill['id']];
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            } else {
                $id_condition = " AND ss.parent_id = $parent_id";
            }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            } else {
                $graph = new Graph();
                $graph->setAttribute('graphviz.graph.rankdir', 'LR');
                foreach ($skillParents as $parentList) {
                    $old = null;
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $skills = $skillRelSkill->getChildren($skill_id);
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

                        } else {
                            $current = $graph->createVertex($parent['id']);
                            $current->setAttribute('graphviz.data', $parent['data']);
                        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

                } else {
                    $imageSize = 'mini';
                    if (2 == $level) {
                        $imageSize = 'small';
                    }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $tableResult .= get_lang('Without achieved skills');
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

                } else {
                    $skillList[$skill['id']] = $skill['id'];
                }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            } else {
                $courseInfo = [];
            }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $skills = $this->getAllSkills(false, false, null, $skill_id);
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $defaultBadge = api_get_path(SYS_PUBLIC_PATH).'img/icons/128/badges-default.png';
            $imageContent = file_get_contents($defaultBadge);
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $form->addButtonUpdate(get_lang('Update'));
            $form->addHidden('id', $skillInfo['id']);
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            } else {
                $parents = self::get_parents($skill->getId());
                // +2 because it takes into account the root
                if (count($parents) == $level + 1) {
                    $skills[] = [
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        $path = '';
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

UnusedLocalVariable

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$id'.
Open

    public function delete($id)
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

UnusedFormalParameter

Since: 0.2

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

Example

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

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

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

        $em = Database::getManager();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

UnusedLocalVariable

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$sord'.
Open

        $sord,
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$sidx'.
Open

        $sidx,
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

UnusedFormalParameter

Since: 0.2

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

Example

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

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

The parameter $skill_list is not named in camelCase.
Open

    public function getSkillsInfo(array $skill_list): array
    {
        $skillRepo = Container::getSkillRepository();
        $skill_list = array_map('intval', $skill_list);

Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $skill_id is not named in camelCase.
Open

    public function getGradebooksBySkill($skill_id)
    {
        $skill_id = (int) $skill_id;
        $sql = "SELECT g.* FROM {$this->table_gradebook} g
                INNER JOIN {$this->table_skill_rel_gradebook} sg
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $add_root is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $skill_id is not named in camelCase.
Open

    public function getChildren($skill_id, $load_user_data = false)
    {
        $skillRelSkill = new SkillRelSkillModel();
        if ($load_user_data) {
            $user_id = api_get_user_id();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $skill_id is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $user_id is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $parent_id is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $return_flat_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $user_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $return_flat_array is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $user_id is not named in camelCase.
Open

    public function getUserSkillRanking($user_id)
    {
        $user_id = (int) $user_id;
        $sql = "SELECT count(skill_id) count
                FROM {$this->table} s
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $load_user_data is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $user_id is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $load_user_data is not named in camelCase.
Open

    public function getChildren($skill_id, $load_user_data = false)
    {
        $skillRelSkill = new SkillRelSkillModel();
        if ($load_user_data) {
            $user_id = api_get_user_id();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $main_depth is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $max_depth is not named in camelCase.
Open

    public function getSkillToJson($subtree, $depth = 1, $max_depth = 2)
    {
        $simple_sub_tree = [];
        if (is_array($subtree)) {
            $counter = 1;
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $where_condition is not named in camelCase.
Open

    public function getUserListSkillRanking(
        $start,
        $limit,
        $sidx,
        $sord,
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

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

        $user_id = false,

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

        $skill_id = (int) $skill_id;

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

                $parentId = isset($skill_info2['parent_id']) ? isset($skill_info2['parent_id']) : 0;

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

        if (isset($user_id) && !empty($user_id)) {

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

                    $skills[$skill_id]['data']['parent_id'] = $skillInfo['extra']['parent_id'];

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

            $new_family_array = [];

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

                if (!empty($family_items)) {

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

                $new_family_array[$main_family_id] = $family_id;

Missing class doc comment
Open

class SkillModel extends Model

Expected 3 spaces after parameter type; 1 found
Open

     * @param bool $showBadge

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

                $id_condition = " WHERE ss.parent_id = $parent_id";

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

        $skills_tree = null;

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

            return $skill_id;

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

                    $skill_rel_user->save($params);

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

            foreach ($family as $main_family_id => $family_items) {

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

                $new_family_array[$main_family_id] = $family_id;

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

            if (empty($original_skill)) {

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

            $user_id = api_get_user_id();

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

                            ->setParent($repo->find($parent_id))

Doc comment for parameter $level does not match actual variable name $skills
Open

     * @param int   $level

Expected 2 spaces after parameter type; 1 found
Open

     * @param int $sessionId

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

        $return_flat_array = false,

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

        $original_skill = $this->list = $skills;

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

                $new_family_array[$main_family_id] = $family_id;

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

                $flat_array[$skill_id] = $skills[$skill_id];

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

            $parent_id = (int) $parent_id;

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

    public function getGradebooksBySkill($skill_id)

Method name "SkillModel::get_parents" is not in camel caps format
Open

    public function get_parents($skillId)

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

                    $skills[$skill_id] = $skillInfo;

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

                        $new_family_array[$item['id']] = $family_id;

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

                $flat_array[$skill_id] = $skills[$skill_id];

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

                foreach ($skills as $my_skill_id => &$skill) {

You must use "/**" style comments for a function comment
Open

    public function __construct()

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

        $this->table_user = Database::get_main_table(TABLE_MAIN_USER);

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

        $this->table_skill_rel_gradebook = Database::get_main_table(TABLE_MAIN_SKILL_REL_GRADEBOOK);

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

        $load_user_data = false,

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

        $id_condition = '';

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

            $parent_id = (int) $parent_id;

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

                ON (s.id = ss.skill_id) $id_condition

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

                $parentId = isset($skill_info2['parent_id']) ? isset($skill_info2['parent_id']) : 0;

Expected 2 spaces after parameter type; 1 found
Open

     * @param int $userId

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

                $family_id++;

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

        if (!empty($parent_id)) {

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

                $relation_exists = $skillRelSkill->relationExists($skill_id, $parent_id);

Doc comment for parameter $courseId does not match actual variable name $category
Open

     * @param int $courseId

Doc comment for parameter $skills does not match actual variable name $vertex
Open

     * @param array $skills

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

        if (1 == $skill_id) {

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

                if ($user_id) {

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

        $this->table_gradebook = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);

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

        $skills = $skillRepo->findBy(['id' => $skill_list]);

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

                $id_condition = " WHERE ss.parent_id = $parent_id";

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

        if ($load_user_data) {

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

                $skill_info2 = $skillRelSkill->getSkillInfo($skill['skill_id']);

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

                $relation_exists = $skillRelSkill->relationExists($skill_id, $parent_id);

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

        $skill_id = null,

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

        $skill_list = array_map('intval', $skill_list);

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

    public function getChildren($skill_id, $load_user_data = false)

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

            $skill = $repo->find($skill_id);

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

                if (!$relation_exists) {

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

            $skills = $this->getAllSkills(true, $user_id, null, $skill_id);

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

                $refs[1]['children'][0]['children'][0] = $skills[$skill_id];

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

        $this->table_course = Database::get_main_table(TABLE_MAIN_COURSE);

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

                $id_condition = " AND ss.parent_id = $parent_id";

Missing function doc comment
Open

    public function edit(array $params)

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

                $relation_exists = $skillRelSkill->relationExists($skillId, $parent_id);

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

                $relation_exists = $skillRelSkill->relationExists($skillId, $parent_id);

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

                    $skills[$skill_id]['parent_id'] = 1;

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

            $family_id = 1;

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

        $parent_id = null

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

            $id_condition = " WHERE s.id = $id";

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

                $children = self::get_all($load_user_data, $user_id, $id, $skill['id']);

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

    public function getChildren($skill_id, $load_user_data = false)

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

            $skills = $skillRelSkill->getChildren($skill_id, true, $user_id);

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

                $relation_exists = $skillRelSkill->relationExists($skill_id, $parent_id);

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

                        ->setGradeBookCategory($repoGradebook->find($gradebook_id))

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

            $skill_id = 0;

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

        if (!empty($skill_id)) {

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

        $flat_array = [];

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

                        $user_id,

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

                    foreach ($family_items as $item) {

Expected 3 spaces after parameter type; 1 found
Open

     * @param bool $showTitle

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

            $skills = $this->getAllSkills(true, $user_id, null, $skill_id);

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

        $this->table_skill_rel_skill = Database::get_main_table(TABLE_MAIN_SKILL_REL_SKILL);

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

                WHERE sg.skill_id = $skill_id";

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

        if ($skill_id) {

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

                if (!$relation_exists) {

Expected 2 spaces after parameter type; 1 found
Open

     * @param int $courseId

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

        if (isset($user_id) && !empty($user_id)) {

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

                    if ($skill['parent_id'] == $skill_id) {

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

            foreach ($family as $main_family_id => $family_items) {

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

                $flat_array[$skill_id] = $skills[$skill_id];

Missing parameter name
Open

     * @param $skills

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

    public function getSkillsInfo(array $skill_list): array

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

                $id_condition = " AND ss.parent_id = $parent_id";

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

                $children = self::get_all($load_user_data, $user_id, $id, $skill['id']);

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

            $skills = $skillRelSkill->getChildren($skill_id);

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

        $user_id = null,

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

            $skills = $this->getAllSkills(false, false, null, $skill_id);

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

            if ($add_root) {

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

        $skill_list = array_map('intval', $skill_list);

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

        $skill_id = (int) $skill_id;

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

        $skill_id = $this->save($params);

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

        $skill_rel_user = new SkillRelUserModel();

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

                    $skillInfo = $this->getSkillInfo($skill_id);

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

                        $new_family_array[$item['id']] = $family_id;

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

        $this->table_skill_rel_user = Database::get_main_table(TABLE_MAIN_SKILL_REL_USER);

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

            if (empty($id_condition)) {

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

        if (!empty($skills) && !empty($parent_id)) {

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

            $skills = $skillRelSkill->getChildren($skill_id, true, $user_id);

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

            foreach ($params['parent_id'] as $parent_id) {

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

                foreach ($params['gradebook_id'] as $gradebook_id) {

Doc comment for parameter $sessionId does not match actual variable name $courseId
Open

     * @param int $sessionId

You must use "/**" style comments for a function comment
Open

    public function delete($id)

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

            foreach ($params['parent_id'] as $parent_id) {

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

                        'parent_id' => $parent_id,

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

                FROM '.$this->table_skill_rel_user.' u

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

        $add_root = false

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

                if (!empty($skill_id)) {

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

                if (empty($skill_id)) {

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

                $flat_array[$skill['id']] = &$skill;

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

                $skills[$skill_id]['data']['family_id'] = 1;

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

    public function getUserSkillRanking($user_id)

Missing parameter name
Open

     * @param $limit

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

            $this->table_skill_rel_user,

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

        if ($return_flat_array) {

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

            $skill_id,

CASE statements must be defined using a colon
Open

            case SESSIONADMIN:

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

                    $children = $this->getSkillToJson($element['children'], 1, $main_depth);

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

    public function getSkillToJson($subtree, $depth = 1, $max_depth = 2)

Missing parameter name
Open

     * @param int depth of the skills

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

                        $max_depth

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

        $user_id = (int) $user_id;

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

                WHERE user_id = $user_id";

Missing parameter name
Open

     * @param int level

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

            $skills_tree = [

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

        return $skills_tree;

Missing parameter name
Open

     * @param int skill id

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

        return json_encode($simple_tree);

Missing parameter name
Open

     * @param $sord

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

                    $flat_array[$my_skill_id] = $skill;

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

                    $flat_array[$my_skill_id] = $skill;

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

            $return_flat_array,

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

                    WHERE 1=1 AND u.active <> ".USER_SOFT_DELETED." $where_condition

Doc comment for parameter $itemId does not match actual variable name $typeId
Open

     * @param int $itemId

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

                        $skill['data']['family_id'] = $new_family_array[$skill['id']];

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

        $simple_tree = [];

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

                if ($depth > $max_depth) {

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

                    if (isset($new_family_array[$skill['id']])) {

Missing parameter name
Open

     * @param int user id

Missing parameter name
Open

     * @param bool return a flat array or not

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

            $user_id,

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

        $simple_sub_tree = [];

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

            return $simple_sub_tree;

Missing parameter name
Open

     * @param $where_condition

Expected 7 spaces after parameter type; 1 found
Open

     * @param int $userId

Doc comment for parameter $typeId does not match actual variable name $form
Open

     * @param int $typeId see ITEM_TYPE_* constants

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

        $return_flat_array = false,

Missing parameter name
Open

     * @param $sidx

Doc comment for parameter $typeId does not match actual variable name $form
Open

     * @param int $typeId see ITEM_TYPE_* constants

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

        $skill_id = null,

Doc comment for parameter $skillInfo does not match actual variable name $form
Open

     * @param array $skillInfo

The closing brace for the class must go on the next line after the body
Open

}

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

            return $flat_array;

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

        $main_depth = 2

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

                $simple_tree[] = [

Missing function doc comment
Open

    public static function exportBadge(Skill $skill, SkillRelUser $skillRelUser, string $urlToRedirect)

Doc comment for parameter $userId does not match actual variable name $itemId
Open

     * @param int $userId

Missing function doc comment
Open

    public static function setBackPackJs(&$htmlHeadXtra)

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

                $simple_sub_tree[] = $tmp;

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

        $user_id = (int) $user_id;

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

        $user_id = null,

Missing parameter name
Open

     * @param $start

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

        $where_condition

Doc comment for parameter $itemId does not match actual variable name $typeId
Open

     * @param int $itemId

The 'getUserSkillRanking()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getUserSkillRanking($user_id)
    {
        $user_id = (int) $user_id;
        $sql = "SELECT count(skill_id) count
                FROM {$this->table} s
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

Source https://phpmd.org/rules/naming.html#booleangetmethodname

Line indented incorrectly; expected at least 16 spaces, found 15
Open

               continue;

Line indented incorrectly; expected 12 spaces, found 16
Open

                }

Line indented incorrectly; expected 12 spaces, found 16
Open

                foreach ($sessionAdmins as $sessionAdmin) {

Line indented incorrectly; expected 12 spaces, found 16
Open

                }

Line indented incorrectly; expected 16 spaces, found 20
Open

                    if ($sessionAdmin->getId() !== $fromUser->getId()) {

Line indented incorrectly; expected 16 spaces, found 20
Open

                    if ($toUser->getCreatorId() === $fromUser->getId()) {

Line indented incorrectly; expected 12 spaces, found 16
Open

                if ('true' === api_get_setting('allow_session_admins_to_manage_all_sessions')) {

Line indented incorrectly; expected 16 spaces, found 20
Open

                    }

Line indented incorrectly; expected 16 spaces, found 20
Open

                    }

The variable $skill_list is not named in camelCase.
Open

    public function getSkillsInfo(array $skill_list): array
    {
        $skillRepo = Container::getSkillRepository();
        $skill_list = array_map('intval', $skill_list);

Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_list is not named in camelCase.
Open

    public function getSkillsInfo(array $skill_list): array
    {
        $skillRepo = Container::getSkillRepository();
        $skill_list = array_map('intval', $skill_list);

Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_list is not named in camelCase.
Open

    public function getSkillsInfo(array $skill_list): array
    {
        $skillRepo = Container::getSkillRepository();
        $skill_list = array_map('intval', $skill_list);

Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getGradebooksBySkill($skill_id)
    {
        $skill_id = (int) $skill_id;
        $sql = "SELECT g.* FROM {$this->table_gradebook} g
                INNER JOIN {$this->table_skill_rel_gradebook} sg
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function edit(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $family_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $family_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $my_skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $flat_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $main_depth is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $simple_sub_tree is not named in camelCase.
Open

    public function getSkillToJson($subtree, $depth = 1, $max_depth = 2)
    {
        $simple_sub_tree = [];
        if (is_array($subtree)) {
            $counter = 1;
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $id_condition is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $id_condition is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $id_condition is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getGradebooksBySkill($skill_id)
    {
        $skill_id = (int) $skill_id;
        $sql = "SELECT g.* FROM {$this->table_gradebook} g
                INNER JOIN {$this->table_skill_rel_gradebook} sg
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $new_family_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $family_items is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $flat_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $max_depth is not named in camelCase.
Open

    public function getSkillToJson($subtree, $depth = 1, $max_depth = 2)
    {
        $simple_sub_tree = [];
        if (is_array($subtree)) {
            $counter = 1;
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $id_condition is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $load_user_data is not named in camelCase.
Open

    public function getChildren($skill_id, $load_user_data = false)
    {
        $skillRelSkill = new SkillRelSkillModel();
        if ($load_user_data) {
            $user_id = api_get_user_id();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $relation_exists is not named in camelCase.
Open

    public function edit(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $flat_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $my_skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_info2 is not named in camelCase.
Open

    public function getDirectParents($skillId)
    {
        $skillRelSkill = new SkillRelSkillModel();
        $skills = $skillRelSkill->getDirectParents($skillId, true);
        if (!empty($skills)) {
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $gradebook_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_rel_user is not named in camelCase.
Open

    public function addSkillToUser(
        $userId,
        GradebookCategory $category,
        $courseId,
        $sessionId
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function edit(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $simple_tree is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_rel_user is not named in camelCase.
Open

    public function addSkillToUser(
        $userId,
        GradebookCategory $category,
        $courseId,
        $sessionId
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $family_items is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $main_family_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $simple_tree is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $load_user_data is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_info2 is not named in camelCase.
Open

    public function getDirectParents($skillId)
    {
        $skillRelSkill = new SkillRelSkillModel();
        $skills = $skillRelSkill->getDirectParents($skillId, true);
        if (!empty($skills)) {
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skills_tree is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skills_tree is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getChildren($skill_id, $load_user_data = false)
    {
        $skillRelSkill = new SkillRelSkillModel();
        if ($load_user_data) {
            $user_id = api_get_user_id();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $flat_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $new_family_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $family_items is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $return_flat_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $max_depth is not named in camelCase.
Open

    public function getSkillToJson($subtree, $depth = 1, $max_depth = 2)
    {
        $simple_sub_tree = [];
        if (is_array($subtree)) {
            $counter = 1;
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getChildren($skill_id, $load_user_data = false)
    {
        $skillRelSkill = new SkillRelSkillModel();
        if ($load_user_data) {
            $user_id = api_get_user_id();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $simple_sub_tree is not named in camelCase.
Open

    public function getSkillToJson($subtree, $depth = 1, $max_depth = 2)
    {
        $simple_sub_tree = [];
        if (is_array($subtree)) {
            $counter = 1;
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $relation_exists is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $gradebook_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $new_family_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $original_skill is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skills_tree is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $simple_sub_tree is not named in camelCase.
Open

    public function getSkillToJson($subtree, $depth = 1, $max_depth = 2)
    {
        $simple_sub_tree = [];
        if (is_array($subtree)) {
            $counter = 1;
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $id_condition is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getChildren($skill_id, $load_user_data = false)
    {
        $skillRelSkill = new SkillRelSkillModel();
        if ($load_user_data) {
            $user_id = api_get_user_id();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $add_root is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $family_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $new_family_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_info2 is not named in camelCase.
Open

    public function getDirectParents($skillId)
    {
        $skillRelSkill = new SkillRelSkillModel();
        $skills = $skillRelSkill->getDirectParents($skillId, true);
        if (!empty($skills)) {
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $relation_exists is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function edit(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $original_skill is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $flat_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $return_flat_array is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $simple_tree is not named in camelCase.
Open

    public function getSkillsTreeToJson(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $main_depth = 2
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getUserSkillRanking($user_id)
    {
        $user_id = (int) $user_id;
        $sql = "SELECT count(skill_id) count
                FROM {$this->table} s
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $id_condition is not named in camelCase.
Open

    public function getAllSkills(
        $load_user_data = false,
        $user_id = false,
        $id = null,
        $parent_id = null
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getGradebooksBySkill($skill_id)
    {
        $skill_id = (int) $skill_id;
        $sql = "SELECT g.* FROM {$this->table_gradebook} g
                INNER JOIN {$this->table_skill_rel_gradebook} sg
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $relation_exists is not named in camelCase.
Open

    public function edit(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $main_family_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $family_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getChildren($skill_id, $load_user_data = false)
    {
        $skillRelSkill = new SkillRelSkillModel();
        if ($load_user_data) {
            $user_id = api_get_user_id();
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $parent_id is not named in camelCase.
Open

    public function add(array $params)
    {
        if (empty($params['parent_id'])) {
            $params['parent_id'] = 1;
        }
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $skill_id is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $new_family_array is not named in camelCase.
Open

    public function getSkillsTree(
        $user_id = null,
        $skill_id = null,
        $return_flat_array = false,
        $add_root = false
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $where_condition is not named in camelCase.
Open

    public function getUserListSkillRanking(
        $start,
        $limit,
        $sidx,
        $sord,
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getUserSkillRanking($user_id)
    {
        $user_id = (int) $user_id;
        $sql = "SELECT count(skill_id) count
                FROM {$this->table} s
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function getUserSkillRanking($user_id)
    {
        $user_id = (int) $user_id;
        $sql = "SELECT count(skill_id) count
                FROM {$this->table} s
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The method get_parents is not named in camelCase.
Open

    public function get_parents($skillId)
    {
        $skillRelSkill = new SkillRelSkillModel();
        $skills = $skillRelSkill->getSkillParents($skillId, true);
        foreach ($skills as &$skill) {
Severity: Minor
Found in public/main/inc/lib/SkillModel.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status