include/runtime/JavaScript.php
Avoid using static access to class 'Vtiger_Loader' in method 'getFilePath'. Open
Open
$completeFilePath = Vtiger_Loader::resolveNameToPath('~' . $filePath);
- Read upRead up
- Exclude checks
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
Open
* @return <string / Boolean> - file path , false if not exists
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Vtiger_JavaScript extends Vtiger_Viewer
- Exclude checks
The class Vtiger_JavaScript is not named in CamelCase. Open
Open
class Vtiger_JavaScript extends Vtiger_Viewer
{
/**
* Function to get the path of a given style sheet or default style sheet.
*
- Read upRead up
- Exclude checks
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
Open
* @return <string / Boolean> - file path , false if not exists
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$filePath = self::getBaseJavaScriptPath() . '/' . $fileName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static function getFilePath($fileName = '')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Function to get the path of a given style sheet or default style sheet.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (empty($fileName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return 'layouts' . '/' . self::getLayoutName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $filePath;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static function getBaseJavaScriptPath()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param string $fileName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return string - theme folder
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$completeFilePath = Vtiger_Loader::resolveNameToPath('~' . $filePath);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (file_exists($completeFilePath)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Function to get the Base Theme Path, until theme folder not selected theme folder.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Class name "Vtiger_JavaScript" is not in camel caps format Open
Open
class Vtiger_JavaScript extends Vtiger_Viewer
- Exclude checks