chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

Remove error control operator '@' on line 25.
Open

    public function validate($elementValue, $maxSize)
    {
        if (!empty($elementValue['error']) &&
            (UPLOAD_ERR_FORM_SIZE == $elementValue['error'] || UPLOAD_ERR_INI_SIZE == $elementValue['error'])
        ) {

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

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

The class HTML_QuickForm_Rule_MaxFileSize is not named in CamelCase.
Open

class HTML_QuickForm_Rule_MaxFileSize extends HTML_QuickForm_Rule
{
    /**
     * @return bool
     */

CamelCaseClassName

Since: 0.2

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

Example

class class_name {
}

Source

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

class HTML_QuickForm_Rule_MaxFileSize extends HTML_QuickForm_Rule

There are no issues that match your filters.

Category
Status