chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

The class HTML_QuickForm_Compare_Fields is not named in CamelCase.
Open

class HTML_QuickForm_Compare_Fields extends HTML_QuickForm_Rule_Compare
{
    /**
     * Function to check an array of fields.
     *

CamelCaseClassName

Since: 0.2

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

Example

class class_name {
}

Source

The parameter $operator_and_max_value is not named in camelCase.
Open

    public function validate($values = [], $operator_and_max_value = null)
    {
        if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
            $final_value = 0;
            foreach ($values as $value) {

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

Missing parameter name
Open

     * @param   array of field names

Missing parameter name
Open

     * @param   string operator ==, >=, etc

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

    public function validate($values = [], $operator_and_max_value = null)

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

        if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {

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

            return parent::validate([$final_value, $max_value], $operator);

Missing parameter name
Open

     * @param   string the value to compare

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

                $final_value += $value;

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

            $final_value = 0;

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

            return parent::validate([$final_value, $max_value], $operator);

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

            $max_value = $params[1];

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

            $params = explode('@', $operator_and_max_value);

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

class HTML_QuickForm_Compare_Fields extends HTML_QuickForm_Rule_Compare

The variable $final_value is not named in camelCase.
Open

    public function validate($values = [], $operator_and_max_value = null)
    {
        if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
            $final_value = 0;
            foreach ($values as $value) {

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

    public function validate($values = [], $operator_and_max_value = null)
    {
        if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
            $final_value = 0;
            foreach ($values as $value) {

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

    public function validate($values = [], $operator_and_max_value = null)
    {
        if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
            $final_value = 0;
            foreach ($values as $value) {

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

    public function validate($values = [], $operator_and_max_value = null)
    {
        if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
            $final_value = 0;
            foreach ($values as $value) {

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

    public function validate($values = [], $operator_and_max_value = null)
    {
        if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
            $final_value = 0;
            foreach ($values as $value) {

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

    public function validate($values = [], $operator_and_max_value = null)
    {
        if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
            $final_value = 0;
            foreach ($values as $value) {

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

    public function validate($values = [], $operator_and_max_value = null)
    {
        if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
            $final_value = 0;
            foreach ($values as $value) {

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

There are no issues that match your filters.

Category
Status