chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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

            } else {
                switch ($type) {
                    case 'best':
                        return [$bestResult, $weight];
                        break;

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 assigning values to variables in if clauses and the like (line '156', column '21').
Open

    public function calc_score($studentId = null, $type = null)
    {
        $threadInfo = $this->getThreadData();
        $thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
        $sessionId = $this->get_session_id();

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

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

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

        } else {
            $session_condition = '(session_id = 0 OR session_id IS NULL)';
        }

ElseExpression

Since: 1.4.0

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

Example

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

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

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

                } else {
                    // We sent the 0/thread_qualify_max instead of null for correct calculations
                    return [0, $assignment['thread_qualify_max']];
                }

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            } else {
                // Take average
                $score = 0;
                $counter = 0;
                if (Database::num_rows($scores)) {

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            // All students -> get average
            $students = []; // user list, needed to make sure we only
            // take first attempts into account
            $counter = 0;

ElseExpression

Since: 1.4.0

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

Example

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

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

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

        } else {
            $session_condition = '(tl.session_id = 0 OR tl.session_id IS NULL)';
        }

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            $session_condition = 'tl.session_id='.$sessionId;

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 local variables such as '$tbl_grade_links'.
Open

        $tbl_grade_links = Database::get_course_table(TABLE_FORUM_THREAD);

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

The property $forum_thread_table is not named in camelCase.
Open

class ForumThreadLink extends AbstractLink
{
    private $forum_thread_table;

    /**

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

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

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

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

        $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';

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

        return $thread_title;

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

    public function delete_linked_data()

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

    public function get_name()

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

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

Missing function doc comment
Open

    public function needs_max()

Missing function doc comment
Open

    public function save_linked_data()

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

                    WHERE c_id = '.$this->course_id.' AND iid = '.$ref_id;

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

    public function needs_results()

Missing function doc comment
Open

    public function delete_linked_data()

Missing function doc comment
Open

    public function needs_name_and_description()

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

                    WHERE c_id = '.$this->course_id.' AND iid = '.$ref_id;

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

    public function get_all_links()

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

            $session_condition = 'tl.session_id='.$sessionId;

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

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

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

        $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';

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

        return $this->exercise_data;

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

    public function is_allowed_to_change_name()

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

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

Missing function doc comment
Open

    public function get_link()

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

            $session_condition = 'session_id = '.$sessionId;

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

    public function is_valid_link()

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

        if (!empty($ref_id)) {

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

        $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';

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

            return $this->exercise_data['thread_title_qualify'];

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

            $forum_id = $row['forum_id'];

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

                '&thread='.$this->get_ref_id().'&gradebook=view&forum='.$forum_id;

Missing function doc comment
Open

    public function get_icon_name()

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

    public function get_icon_name()

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

                    WHERE c_id = '.$this->course_id.' AND iid = '.$ref_id;

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

    public function needs_max()

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

        if (!empty($ref_id)) {

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

                    WHERE c_id = '.$this->course_id.' AND iid = '.$ref_id;

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

            $session_condition = '(tl.session_id = 0 OR tl.session_id IS NULL)';

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

        return $this->forum_thread_table = Database::get_course_table(TABLE_FORUM_THREAD);

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

        $sql = "SELECT * FROM $thread_qualify

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

            $this->exercise_data = Database::fetch_array($query);

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

    public function needs_name_and_description()

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

    public function save_linked_data()

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

    public function get_type_name()

Missing function doc comment
Open

    public function needs_results()

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

    public function get_description()

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

        $ref_id = $this->get_ref_id();

Method name "ForumThreadLink::get_forum_thread_table" is not in camel caps format
Open

    private function get_forum_thread_table()

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

            $session_condition = '(session_id = 0 OR session_id IS NULL)';

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

        if (!isset($this->exercise_data)) {

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

                        '.$session_condition;

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

        $thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);

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

        $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';

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

        $tbl_grade_links = Database::get_course_table(TABLE_FORUM_THREAD);

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

    public function has_results()

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

        $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';

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

        if (isset($thread_title_qualify) && '' != $thread_title_qualify) {

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

        $course = api_get_course_entity($this->course_id);

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

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

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

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

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

        $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';

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

        if (isset($thread_title_qualify) && '' != $thread_title_qualify) {

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

    public function get_link()

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

        $ref_id = $this->get_ref_id();

The variable $thread_title_qualify is not named in camelCase.
Open

    public function get_name()
    {
        $this->getThreadData();
        $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
        $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $tbl_grade_links is not named in camelCase.
Open

    public function get_all_links()
    {
        if (empty($this->getCourseId())) {
            return [];
        }

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

    public function calc_score($studentId = null, $type = null)
    {
        $threadInfo = $this->getThreadData();
        $thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
        $sessionId = $this->get_session_id();

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $forum_id is not named in camelCase.
Open

    public function get_link()
    {
        $sessionId = $this->get_session_id();
        $sql = 'SELECT * FROM '.$this->get_forum_thread_table()."
                WHERE

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

    public function save_linked_data()
    {
        $weight = $this->get_weight();
        $ref_id = $this->get_ref_id();

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $session_condition is not named in camelCase.
Open

    public function get_all_links()
    {
        if (empty($this->getCourseId())) {
            return [];
        }

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $session_condition is not named in camelCase.
Open

    private function getThreadData()
    {
        $sessionId = $this->get_session_id();
        if ($sessionId) {
            $session_condition = 'session_id = '.$sessionId;

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $session_condition is not named in camelCase.
Open

    public function get_all_links()
    {
        if (empty($this->getCourseId())) {
            return [];
        }

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

    public function get_name()
    {
        $this->getThreadData();
        $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
        $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

    public function delete_linked_data()
    {
        $ref_id = $this->get_ref_id();
        if (!empty($ref_id)) {
            // Cleans forum

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

    public function calc_score($studentId = null, $type = null)
    {
        $threadInfo = $this->getThreadData();
        $thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
        $sessionId = $this->get_session_id();

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $forum_id is not named in camelCase.
Open

    public function get_link()
    {
        $sessionId = $this->get_session_id();
        $sql = 'SELECT * FROM '.$this->get_forum_thread_table()."
                WHERE

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

    public function get_name()
    {
        $this->getThreadData();
        $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
        $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';

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

    public function get_name()
    {
        $this->getThreadData();
        $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
        $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

    public function delete_linked_data()
    {
        $ref_id = $this->get_ref_id();
        if (!empty($ref_id)) {
            // Cleans forum

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

    public function save_linked_data()
    {
        $weight = $this->get_weight();
        $ref_id = $this->get_ref_id();

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

    public function save_linked_data()
    {
        $weight = $this->get_weight();
        $ref_id = $this->get_ref_id();

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $thread_title is not named in camelCase.
Open

    public function get_name()
    {
        $this->getThreadData();
        $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
        $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $ref_id is not named in camelCase.
Open

    public function delete_linked_data()
    {
        $ref_id = $this->get_ref_id();
        if (!empty($ref_id)) {
            // Cleans forum

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $session_condition is not named in camelCase.
Open

    private function getThreadData()
    {
        $sessionId = $this->get_session_id();
        if ($sessionId) {
            $session_condition = 'session_id = '.$sessionId;

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $session_condition is not named in camelCase.
Open

    private function getThreadData()
    {
        $sessionId = $this->get_session_id();
        if ($sessionId) {
            $session_condition = 'session_id = '.$sessionId;

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The method get_type_name is not named in camelCase.
Open

    public function get_type_name()
    {
        return get_lang('Forum threads');
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method has_results is not named in camelCase.
Open

    public function has_results()
    {
        $table = Database::get_course_table(TABLE_FORUM_POST);

        $sql = "SELECT count(*) AS number FROM $table

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_forum_thread_table is not named in camelCase.
Open

    private function get_forum_thread_table()
    {
        return $this->forum_thread_table = Database::get_course_table(TABLE_FORUM_THREAD);
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method needs_name_and_description is not named in camelCase.
Open

    public function needs_name_and_description()
    {
        return false;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_all_links is not named in camelCase.
Open

    public function get_all_links()
    {
        if (empty($this->getCourseId())) {
            return [];
        }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_name is not named in camelCase.
Open

    public function get_name()
    {
        $this->getThreadData();
        $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
        $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method needs_results is not named in camelCase.
Open

    public function needs_results()
    {
        return false;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_description is not named in camelCase.
Open

    public function get_description()
    {
        return ''; //$this->exercise_data['description'];
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method is_allowed_to_change_name is not named in camelCase.
Open

    public function is_allowed_to_change_name()
    {
        return false;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method delete_linked_data is not named in camelCase.
Open

    public function delete_linked_data()
    {
        $ref_id = $this->get_ref_id();
        if (!empty($ref_id)) {
            // Cleans forum

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method needs_max is not named in camelCase.
Open

    public function needs_max()
    {
        return false;
    }

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_icon_name is not named in camelCase.
Open

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

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_link is not named in camelCase.
Open

    public function get_link()
    {
        $sessionId = $this->get_session_id();
        $sql = 'SELECT * FROM '.$this->get_forum_thread_table()."
                WHERE

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method save_linked_data is not named in camelCase.
Open

    public function save_linked_data()
    {
        $weight = $this->get_weight();
        $ref_id = $this->get_ref_id();

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method calc_score is not named in camelCase.
Open

    public function calc_score($studentId = null, $type = null)
    {
        $threadInfo = $this->getThreadData();
        $thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
        $sessionId = $this->get_session_id();

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method is_valid_link is not named in camelCase.
Open

    public function is_valid_link()
    {
        $sessionId = $this->get_session_id();
        $sql = 'SELECT count(iid) FROM '.$this->get_forum_thread_table().'
                WHERE

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