chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/fileDisplay.lib.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $image['audio'] = 'file_sound.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['image'] = 'file_image.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

    if (!$type || !$image) {

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['video'] = 'film.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['acrobat'] = 'file_pdf.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['image_vect'] = 'file_svg.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['text'] = 'icons/22/mime_text.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['epub'] = 'file_epub.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['excel'] = 'excel.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['compressed'] = 'file_zip.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['flash'] = 'file_flash.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['oo_impress'] = 'file_oo_impress.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

                    return $image[$generic_type];

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['oo_draw'] = 'file_oo_draw.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['web'] = 'file_html.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['code'] = 'icons/22/mime_code.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['powerpoint'] = 'powerpoint.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['oo_calc'] = 'file_oo_calc.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['java'] = 'file_java.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['word'] = 'word.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['oo_writer'] = 'file_oo_writer.png';

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 using undefined variables such as '$image' which will lead to PHP notices.
Open

        $image['freemind'] = 'file_freemind.png';

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

The parameter $file_name is not named in camelCase.
Open

function choose_image($file_name)
{
    static $type, $image;

    /* TABLES INITIALISATION */

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

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

function choose_image($file_name)

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

        if (preg_match('/\.([[:alnum:]]+)(\?|$)/', $file_name, $extension)) {

Consider putting global function "chooseFolderIcon" in a static class
Open

function chooseFolderIcon($folderPath)

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

            foreach ($type as $generic_type => $extension_list) {

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

                    return $image[$generic_type];

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

            foreach ($type as $generic_type => $extension_list) {

Consider putting global function "choose_image" in a static class
Open

function choose_image($file_name)

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

    if (!is_array($file_name)) {

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

                if (in_array($extension[1], $extension_list)) {

The variable $generic_type is not named in camelCase.
Open

function choose_image($file_name)
{
    static $type, $image;

    /* TABLES INITIALISATION */

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

function choose_image($file_name)
{
    static $type, $image;

    /* TABLES INITIALISATION */

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

function choose_image($file_name)
{
    static $type, $image;

    /* TABLES INITIALISATION */

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

function choose_image($file_name)
{
    static $type, $image;

    /* TABLES INITIALISATION */

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

function choose_image($file_name)
{
    static $type, $image;

    /* TABLES INITIALISATION */

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

function choose_image($file_name)
{
    static $type, $image;

    /* TABLES INITIALISATION */

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