chamilo/chamilo-lms

View on GitHub
src/CoreBundle/Controller/AssetController.php

Summary

Maintainability
A
0 mins
Test Coverage

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

                    fclose($fileStream);

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 '$fileStream'.
Open

                    fclose($fileStream);

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

You must use "/**" style comments for a function comment
Open

    public function showFile(

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Route(path: '/{category}/{path}', methods: ['GET'], requirements: ['path' => '.+'], name: 'chamilo_core_asset_showfile')]

Add a single space around assignment operators
Open

declare(strict_types=1);

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

#[Route('/assets')]

You must use "/**" style comments for a class comment
Open

class AssetController

There are no issues that match your filters.

Category
Status