Function getComponentClassName
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
{
$cacheKey = "$componentType|$componentName|$moduleName";
if (isset(self::$componentClassCache[$cacheKey])) {
return self::$componentClassCache[$cacheKey];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getComponentClassName
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
{
$cacheKey = "$componentType|$componentName|$moduleName";
if (isset(self::$componentClassCache[$cacheKey])) {
return self::$componentClassCache[$cacheKey];
Function getRealPathFile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getRealPathFile(string $filePath, string $fileExtension, array $layoutPaths): string
{
$realPath = '';
$checkMin = \vtlib\Functions::getMinimizationOptions($fileExtension);
foreach ($layoutPaths as $layoutPath) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function autoLoad
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function autoLoad($className)
{
$parts = explode('_', $className);
$noOfParts = \count($parts);
if ($noOfParts > 2) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method getComponentClassName has a boolean flag argument $throwException, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '188', column '14'). Open
throw new \App\Exceptions\AppException('LBL_HANDLER_NOT_FOUND');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\vtlib\Functions' in method 'getRealPathFile'. Open
$checkMin = \vtlib\Functions::getMinimizationOptions($fileExtension);
- 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
The method resolveRelativePath uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$file = str_replace('.', DIRECTORY_SEPARATOR, $qualifiedName) . '.' . $fileExtension;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Log' in method 'getComponentClassName'. Open
\App\Log::error("Error Vtiger_Loader::getComponentClassName($componentType, $componentName, $moduleName): Handler not found");
- 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
Avoid using static access to class '\vtlib\Deprecated' in method 'includeOnce'. Open
\vtlib\Deprecated::checkFileAccessForInclusion($file);
- 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
Avoid assigning values to variables in if clauses and the like (line '32', column '7'). Open
public static function resolveNameToPath($qualifiedName, $fileExtension = 'php')
{
if ($file = self::resolveRelativePath($qualifiedName, $fileExtension)) {
$file = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . ('php' !== $fileExtension ? 'public_html' . DIRECTORY_SEPARATOR : '') . $file;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method getComponentClassName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$load = [
$moduleName => $moduleName,
'Vtiger' => 'Vtiger',
];
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Define a constant instead of duplicating this literal "Vtiger" 5 times. Open
public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Call to method error
from undeclared class \App\Log
Open
\App\Log::error("Error Vtiger_Loader::getComponentClassName($componentType, $componentName, $moduleName): Handler not found");
- Exclude checks
Returning type false
but getComponentClassName()
is declared to return string
Open
return false;
- Exclude checks
Avoid excessively long variable names like $componentTypeDirectory. Keep variable name length under 20. Open
$componentTypeDirectory = strtolower($componentType) . 's';
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Vtiger_Loader
- Exclude checks
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 12 and the first side effect is on line 223. Open
<?php
- Exclude checks
The class Vtiger_Loader is not named in CamelCase. Open
class Vtiger_Loader
{
protected static $includeCache = [];
protected static $includePathCache = [];
protected static $componentClassCache = [];
- 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
protected static $includePathCache = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'custom.modules.',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $qualifiedName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $loaderDirs = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string Absolute File Name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Static function to resolve the qualified php filename to absolute path.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modules.',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $includeCache = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $componentClassCache = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $fileExtension
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Static function to resolve the qualified php filename to relative path.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function resolveRelativePath(string $qualifiedName, string $fileExtension = 'php'): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$realPaths[] = $completeFilePath;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($realPaths as $path) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($success) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(self::$includePathCache[$qualifiedName])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string Required Class Name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(self::$componentClassCache[$cacheKey])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::$componentClassCache[$cacheKey];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Change component type from view to views, action to actions to navigate to the right path.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$baseModule = $moduleHierarchyParts[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$checkMin = \vtlib\Functions::getMinimizationOptions($fileExtension);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($checkMin && false === strpos($completeFilePath, '.min.')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!file_exists($file)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function includePath($qualifiedName)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
set_include_path($path . PATH_SEPARATOR . get_include_path());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleHierarchyParts = explode(':', $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$baseModule = 'Settings:Vtiger';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function resolveNameToPath($qualifiedName, $fileExtension = 'php')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strpos($qualifiedName, '~')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$includeCache[$qualifiedName] = $file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$load = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
str_replace(':', '_', $moduleName) => str_replace(':', '.', $moduleName),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists(self::resolveNameToPath("$dir$classDir.$componentTypeDirectory.$componentName"))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$file = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . ('php' !== $fileExtension ? 'public_html' . DIRECTORY_SEPARATOR : '') . $file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\in_array($fileExtension, $allowedExtensions)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $layoutPaths
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($path && is_file($path)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$componentTypeDirectory = strtolower($componentType) . 's';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$load['Vtiger'] = 'Vtiger';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::error("Error Vtiger_Loader::getComponentClassName($componentType, $componentName, $moduleName): Handler not found");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Returns canonicalized absolute pathname for css/js files.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $fileExtension
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getRealPathFile(string $filePath, string $fileExtension, array $layoutPaths): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Check file inclusion before including it
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
// Change the Module directory & class, along with intermediate fall back directory and class, if module names has submodule as well
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$load[$actualModule] = $actualModule;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($file = self::resolveRelativePath($qualifiedName, $fileExtension)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Already included?
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $className
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file = str_replace('.', DIRECTORY_SEPARATOR, $qualifiedName) . '.' . $fileExtension;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Change the Module directory & class, along with intermediate fall back directory and class, if module names has submodule as well
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName => $moduleName,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (self::$loaderDirs as $dir) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (self::$loaderDirs as $filePath) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . ('php' !== $fileExtension ? 'public_html' . DIRECTORY_SEPARATOR : '') . $file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$completeFilePath = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $layoutPath . self::resolveRelativePath($filePath, $fileExtension);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break 2;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $realPath;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to include a given php file through qualified file name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the class name of a given Component, of given Type, for a given Module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($load as $classPath => $classDir) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::$componentClassCache[$cacheKey] = "{$classPath}_{$componentName}_{$componentType}";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
* Function to auto load the required class files matching the directory pattern modules/xyz/types/Abc.php for class xyz_Abc_Type.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::includeOnce($filePath);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$realPath = '';
- Exclude checks
Line exceeds 120 characters; contains 176 characters Open
$completeFilePath = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $layoutPath . self::resolveRelativePath($filePath, $fileExtension);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file = self::resolveNameToPath($qualifiedName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\vtlib\Deprecated::checkFileAccessForInclusion($file);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$status = include_once $file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePath .= $fileComponentName . '.' . $fileName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists(self::resolveNameToPath($filePath))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $qualifiedName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $fileExtension
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $success;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $componentType
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cacheKey = "$componentType|$componentName|$moduleName";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Users' !== $actualModule) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$load[str_replace(':', '_', $baseModule)] = str_replace(':', '.', $baseModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function autoLoad($className)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$realPath = $path;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $qualifiedName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Settings' === $baseModule) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$allowedExtensions = ['php', 'js', 'css', 'less'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($layoutPaths as $layoutPath) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$realPaths[] = substr($completeFilePath, 0, -(\strlen($fileExtension) + 1)) . ".min.{$fileExtension}";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function includeOnce($qualifiedName)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$includePathCache[$qualifiedName] = $path;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Append modules and sub modules names to the path
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$realPaths = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$path = realpath(self::resolveNameToPath($qualifiedName));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $componentName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $throwException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$actualModule = $moduleHierarchyParts[\count($moduleHierarchyParts) - 1];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Vtiger' => 'Vtiger',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($throwException) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(self::$includeCache[$qualifiedName])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== strpos($moduleName, ':')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$load = [
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
\App\Log::error("Error Vtiger_Loader::getComponentClassName($componentType, $componentName, $moduleName): Handler not found");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to auto load the required class files matching the directory pattern modules/xyz/types/Abc.php for class xyz_Abc_Type.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($noOfParts > 2) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file = str_replace('~', '', $qualifiedName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $filePath
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$success = (0 !== $status);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\AppException('LBL_HANDLER_NOT_FOUND');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parts = explode('_', $className);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileComponentName = strtolower($parts[$noOfParts - 1]) . 's';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileName = $parts[$noOfParts - 2];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$noOfParts = \count($parts);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
for ($i = 0; $i < ($noOfParts - 2); ++$i) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePath .= $parts[$i] . '.';
- Exclude checks
Class name "Vtiger_Loader" is not in camel caps format Open
class Vtiger_Loader
- Exclude checks