YetiForceCompany/YetiForceCRM

View on GitHub
include/runtime/JavaScript.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class 'Vtiger_Loader' in method 'getFilePath'.
Open

        $completeFilePath = Vtiger_Loader::resolveNameToPath('~' . $filePath);
Severity: Minor
Found in include/runtime/JavaScript.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Saw unextractable annotation for comment '* @return <string boolean> - file path , false if not exists'</string>
Open

     * @return <string / Boolean> - file path , false if not exists
Severity: Info
Found in include/runtime/JavaScript.php by phan

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Vtiger_JavaScript extends Vtiger_Viewer

The class Vtiger_JavaScript is not named in CamelCase.
Open

class Vtiger_JavaScript extends Vtiger_Viewer
{
    /**
     * Function to get the path of a given style sheet or default style sheet.
     *
Severity: Minor
Found in include/runtime/JavaScript.php by phpmd

CamelCaseClassName

Since: 0.2

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

Example

class class_name {
}

Source

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return <string / Boolean> - file path , false if not exists

Spaces must be used to indent lines; tabs are not allowed
Open

            return false;

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        $filePath = self::getBaseJavaScriptPath() . '/' . $fileName;

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getFilePath($fileName = '')

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to get the path of a given style sheet or default style sheet.

Spaces must be used to indent lines; tabs are not allowed
Open

        if (empty($fileName)) {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        return 'layouts' . '/' . self::getLayoutName();

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

            return $filePath;

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getBaseJavaScriptPath()

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $fileName

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        return false;

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string - theme folder

Spaces must be used to indent lines; tabs are not allowed
Open

        $completeFilePath = Vtiger_Loader::resolveNameToPath('~' . $filePath);

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        if (file_exists($completeFilePath)) {

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to get the Base Theme Path, until theme folder not selected theme folder.

Spaces must be used to indent lines; tabs are not allowed
Open

    }

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

class Vtiger_JavaScript extends Vtiger_Viewer

There are no issues that match your filters.

Category
Status