chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/formvalidator/Rule/HTML.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using undefined variables such as '$fullpage' which will lead to PHP notices.
Open

        $allowed_tags = self::get_allowed_tags($mode, $fullpage);

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

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

        $allowed_tags = self::get_allowed_tags($mode, $fullpage);

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 class HTML_QuickForm_Rule_HTML is not named in CamelCase.
Open

class HTML_QuickForm_Rule_HTML extends HTML_QuickForm_Rule
{
    /**
     * Function to validate HTML.
     *

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

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

                return array_merge($allowed_tags_teacher, $allowed_tags_teacher_full_page);

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

        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

                return array_merge($allowed_tags_student, $allowed_tags_student_full_page);

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

                return $allowed_tags_teacher;

Method name "HTML_QuickForm_Rule_HTML::get_allowed_tags" is not in camel caps format
Open

    public static function get_allowed_tags($mode)

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

                return $allowed_tags_student;

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

        $cleaned_html = kses($html, $allowed_tags);

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

                return array_merge($allowed_tags_student, $allowed_tags_student_full_page);

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

                return array_merge($allowed_tags_teacher, $allowed_tags_teacher_full_page);

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

        $allowed_tags = self::get_allowed_tags($mode, $fullpage);

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

        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

        return $html == $cleaned_html;

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

        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

        $cleaned_html = kses($html, $allowed_tags);

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

        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

Class name "HTML_QuickForm_Rule_HTML" is not in camel caps format
Open

class HTML_QuickForm_Rule_HTML extends HTML_QuickForm_Rule

The variable $allowed_tags_student_full_page is not named in camelCase.
Open

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public function validate($html, $mode = NO_HTML)
    {
        $allowed_tags = self::get_allowed_tags($mode, $fullpage);
        $cleaned_html = kses($html, $allowed_tags);

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

    public function validate($html, $mode = NO_HTML)
    {
        $allowed_tags = self::get_allowed_tags($mode, $fullpage);
        $cleaned_html = kses($html, $allowed_tags);

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

    public function validate($html, $mode = NO_HTML)
    {
        $allowed_tags = self::get_allowed_tags($mode, $fullpage);
        $cleaned_html = kses($html, $allowed_tags);

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public function validate($html, $mode = NO_HTML)
    {
        $allowed_tags = self::get_allowed_tags($mode, $fullpage);
        $cleaned_html = kses($html, $allowed_tags);

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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

    public static function get_allowed_tags($mode)
    {
        // Include the allowed tags.
        //include __DIR__.'/allowed_tags.inc.php';
        global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;

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