chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '82', column '28').
Open

                return new ExerciseLink();

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 '86', column '28').
Open

                return new DropboxLink();

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 '94', column '28').
Open

                return new AttendanceLink();

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 '84', column '28').
Open

                return new ExerciseLink(1);

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 '90', column '28').
Open

                return new LearnpathLink();

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 '88', column '28').
Open

                return new StudentPublicationLink();

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 '96', column '28').
Open

                return new SurveyLink();

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 '92', column '28').
Open

                return new ForumThreadLink();

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

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

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $eval_id is not named in camelCase.
Open

    public static function get_evaluation_link($eval_id)
    {
        $links = AbstractLink::load(null, null, $eval_id);
        foreach ($links as $link) {
            if (is_a($link, 'EvalLink')) {

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $category_id is not named in camelCase.
Open

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

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $user_id is not named in camelCase.
Open

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

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

Expected 1 spaces after parameter type; 4 found
Open

     * @param int    $type        link type

Method name "LinkFactory::get_evaluation_link" is not in camel caps format
Open

    public static function get_evaluation_link($eval_id)

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

    public static function get_evaluation_link($eval_id)

Expected 1 spaces after parameter type; 4 found
Open

     * @param int    $category_id parent category

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

            $ref_id,

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

    public static function find_links($name, $selectcat)

Expected 1 spaces after parameter type; 4 found
Open

     * @param int    $ref_id      reference id

Expected 1 spaces after parameter type; 4 found
Open

     * @param int    $visible     visible

Expected 1 spaces after parameter type; 4 found
Open

     * @param int    $courseId    course ID

Expected 1 spaces after parameter type; 4 found
Open

     * @param int    $user_id     user id (link owner)

Missing function doc comment
Open

    public function delete()

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

        $user_id = null,

Method name "LinkFactory::get_all_types" is not in camel caps format
Open

    public static function get_all_types()

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

        $category_id = null,

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

        $links = AbstractLink::load(null, null, $eval_id);

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

        $ref_id = null,

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

            $category_id,

Expected 1 spaces after parameter type; 4 found
Open

     * @param int    $id          link id

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

            $user_id,

The variable $eval_id is not named in camelCase.
Open

    public static function get_evaluation_link($eval_id)
    {
        $links = AbstractLink::load(null, null, $eval_id);
        foreach ($links as $link) {
            if (is_a($link, 'EvalLink')) {

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

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

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

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

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $category_id is not named in camelCase.
Open

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

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The method find_links is not named in camelCase.
Open

    public static function find_links($name, $selectcat)
    {
        return AbstractLink::find_links($name, $selectcat);
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_evaluation_link is not named in camelCase.
Open

    public static function get_evaluation_link($eval_id)
    {
        $links = AbstractLink::load(null, null, $eval_id);
        foreach ($links as $link) {
            if (is_a($link, 'EvalLink')) {

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_all_types is not named in camelCase.
Open

    public static function get_all_types()
    {
        //LINK_DROPBOX,
        return [
            LINK_EXERCISE,

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