File Functions.php
has 464 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* +**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
Function throwNewException
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
{
if (!headers_sent() && \App\Config::security('cspHeaderActive')) {
header("content-security-policy: default-src 'self' 'nonce-" . \App\Session::get('CSP_TOKEN') . "'; object-src 'none';base-uri 'self'; frame-ancestors 'self';");
}
- 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 class Functions has 12 public methods. Consider refactoring Functions to keep number of public methods under 10. Open
class Functions
{
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
{
if (\App\Cache::has('moduleTabs', 'all')) {
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class Functions has an overall complexity of 135 which is very high. The configured complexity threshold is 50. Open
class Functions
{
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
{
if (\App\Cache::has('moduleTabs', 'all')) {
- Exclude checks
Function getAllModules
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
{
if (\App\Cache::has('moduleTabs', 'all')) {
$moduleList = \App\Cache::get('moduleTabs', 'all');
} else {
- 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
Functions
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Functions
{
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
{
if (\App\Cache::has('moduleTabs', 'all')) {
Method throwNewException
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
{
if (!headers_sent() && \App\Config::security('cspHeaderActive')) {
header("content-security-policy: default-src 'self' 'nonce-" . \App\Session::get('CSP_TOKEN') . "'; object-src 'none';base-uri 'self'; frame-ancestors 'self';");
}
Method getAllModules
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
{
if (\App\Cache::has('moduleTabs', 'all')) {
$moduleList = \App\Cache::get('moduleTabs', 'all');
} else {
Function arrayDiffAssocRecursive
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function arrayDiffAssocRecursive($array1, $array2)
{
$difference = [];
foreach ($array1 as $key => $value) {
if (\is_array($value)) {
- 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 transformFieldTypeOfData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
Method getCRMRecordMetadata
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getCRMRecordMetadata($mixedid)
{
$multimode = \is_array($mixedid);
$ids = $multimode ? $mixedid : [$mixedid];
Function getCRMRecordMetadata
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getCRMRecordMetadata($mixedid)
{
$multimode = \is_array($mixedid);
$ids = $multimode ? $mixedid : [$mixedid];
- 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 getModuleData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getModuleData($mixed)
{
if (empty($mixed)) {
\App\Log::error(__METHOD__ . ' - Required parameter missing');
Function getModuleData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getModuleData($mixed)
{
if (empty($mixed)) {
\App\Log::error(__METHOD__ . ' - Required parameter missing');
- 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 recurseDelete
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseDelete($src, $outsideRoot = false): int
{
$rootDir = ($outsideRoot || 0 === strpos($src, ROOT_DIRECTORY)) ? '' : ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
if (!file_exists($rootDir . $src)) {
return 0;
- 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 getAllModules
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
Function recurseCopy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy($src, $dest)
{
$rootDir = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
if (!file_exists($rootDir . $src)) {
return 0;
- 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 parseBytes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function parseBytes($str): float
{
if (is_numeric($str)) {
return (float) $str;
}
- 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
Avoid too many return
statements within this method. Open
return $id ? \App\Cache::get('moduleTabById', $id) : null;
The method getAllModules() has an NPath complexity of 1464. The configured NPath complexity threshold is 200. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
{
if (\App\Cache::has('moduleTabs', 'all')) {
$moduleList = \App\Cache::get('moduleTabs', 'all');
} else {
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method throwNewException() has an NPath complexity of 2340. The configured NPath complexity threshold is 200. Open
public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
{
if (!headers_sent() && \App\Config::security('cspHeaderActive')) {
header("content-security-policy: default-src 'self' 'nonce-" . \App\Session::get('CSP_TOKEN') . "'; object-src 'none';base-uri 'self'; frame-ancestors 'self';");
}
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method getCRMRecordMetadata() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
public static function getCRMRecordMetadata($mixedid)
{
$multimode = \is_array($mixedid);
$ids = $multimode ? $mixedid : [$mixedid];
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method throwNewException() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10. Open
public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
{
if (!headers_sent() && \App\Config::security('cspHeaderActive')) {
header("content-security-policy: default-src 'self' 'nonce-" . \App\Session::get('CSP_TOKEN') . "'; object-src 'none';base-uri 'self'; frame-ancestors 'self';");
}
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getAllModules() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
{
if (\App\Cache::has('moduleTabs', 'all')) {
$moduleList = \App\Cache::get('moduleTabs', 'all');
} else {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Reduce the number of returns of this function 5, down to the maximum allowed 3. Open
public static function getModuleData($mixed)
- Read upRead up
- Exclude checks
Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.
Noncompliant Code Example
With the default threshold of 3:
function myFunction(){ // Noncompliant as there are 4 return statements if (condition1) { return true; } else { if (condition2) { return false; } else { return true; } } return false; }
Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 36 to the 15 allowed. Open
public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Class "Functions" has 24 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class Functions
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
The class Functions has a coupling between objects value of 21. Consider to reduce the number of dependencies under 13. Open
class Functions
{
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
{
if (\App\Cache::has('moduleTabs', 'all')) {
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Missing class import via use statement (line '85', column '16'). Open
$rows = (new \App\Db\Query())->from('vtiger_tab')->all();
- 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
The method getAllModules has a boolean flag argument $colorActive, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
- 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 '417', column '17'). Open
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDir . $src, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST) as $filename => $file) {
- 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
Duplicated array key , first declared at line 198. Open
$popup_toHtml = [
'"' => '"',
"'" => ''',
];
- Read upRead up
- Exclude checks
DuplicatedArrayKey
Defining another value for the same key in an array literal overrides the previous key/value, which makes it effectively an unused code. If it's known from the beginning that the key will have different value, there is usually no point in defining first one.
Example
function createArray() {
return [
'non-associative 0element', // not applied
0 => 'associative 0-element', // applied
false => 'associative 0-element', // applied
'foo' => 'bar', // not applied
"foo" => 'baz', // applied
];
}
Source http://phpmd.org/rules/cleancode.html#duplicatedarraykey
The method getAllModules has a boolean flag argument $isEntityType, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
- 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 '227', column '15'). Open
return (new \App\Db\Query())->select([$fieldName])->from($tableName)->where([$idName => $id])->scalar();
- 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
Missing class import via use statement (line '365', column '19'). Open
$viewer = new \Vtiger_Viewer();
- 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
Missing class import via use statement (line '380', column '15'). Open
throw new \App\Exceptions\AppException($message['message']);
- 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
Missing class import via use statement (line '452', column '28'). Open
foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($src, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
- 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
The method getAllModules has a boolean flag argument $showRestricted, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
- 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 '132', column '18'). Open
$query = (new \App\Db\Query())
- 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
Missing class import via use statement (line '339', column '14'). Open
throw new \App\Exceptions\ApiException($message, 401);
- 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
The method getAllModules has a boolean flag argument $presence, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
- 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
The method getAllModules has a boolean flag argument $ownedby, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
- 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
The method throwNewException has a boolean flag argument $die, which is a certain sign of a Single Responsibility Principle violation. Open
public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
- 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 '382', column '14'). Open
throw new \App\Exceptions\AppException($message);
- 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
The method getModuleFieldId has a boolean flag argument $onlyactive, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getModuleFieldId($moduleId, $mixed, $onlyactive = 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 '23', column '17'). Open
$rows = (new \App\Db\Query())->from('vtiger_tab')->all();
- 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
Missing class import via use statement (line '417', column '48'). Open
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDir . $src, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST) as $filename => $file) {
- 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
Missing class import via use statement (line '452', column '59'). Open
foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($src, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
- 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
The method fromHtmlPopup has a boolean flag argument $encode, which is a certain sign of a Single Responsibility Principle violation. Open
public static function fromHtmlPopup($string, $encode = 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 '342', column '20'). Open
$response = new \Vtiger_Response();
- 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
The method recurseDelete has a boolean flag argument $outsideRoot, which is a certain sign of a Single Responsibility Principle violation. Open
public static function recurseDelete($src, $outsideRoot = false): int
- 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
Avoid using static access to class '\App\Fields\Currency' in method 'getConversionRateInfo'. Open
}
- 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 '\App\Cache' in method 'getAllModules'. Open
if (!\App\Cache::has('moduleTabById', $row['tabid'])) {
- 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 '\App\Cache' in method 'getModuleData'. Open
return \App\Cache::get('moduleTabByName', $name);
- 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 getCRMRecordMetadata uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$result[$id] = null;
}
- 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\Utils' in method 'getHtmlOrPlainText'. Open
if (\App\Utils::isHtml($content)) {
- 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 '\App\Cache' in method 'getAllModules'. Open
$moduleList = \App\Cache::get('moduleTabs', 'all');
- 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 '\App\Log' in method 'getModuleData'. Open
\App\Log::error(__METHOD__ . ' - Required parameter missing');
- 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 '\App\Field' in method 'getModuleFieldId'. Open
$field = \App\Field::getFieldInfo($mixed, $moduleId);
- 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 getArrayFromValue uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$array = explode(',', $values);
}
- 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\Cache' in method 'getModuleData'. Open
return \App\Cache::get('moduleTabById', $mixed);
- 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 '\App\Cache' in method 'getModuleData'. Open
return \App\Cache::get('moduleTabByName', $name);
- 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 '\App\Config' in method 'throwNewException'. Open
if (\App\Config::debug('DISPLAY_EXCEPTION_BACKTRACE') && \is_object($e)) {
- 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 throwNewException uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (\PHP_SAPI !== 'cli') {
if (\App\Config::debug('DISPLAY_EXCEPTION_BACKTRACE') && \is_object($e)) {
$message = [
'message' => $message,
- 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\Cache' in method 'getAllModules'. Open
\App\Cache::save('moduleTabByName', $row['name'], $row);
- 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 '\App\Cache' in method 'getModuleData'. Open
\App\Cache::save('moduleTabs', 'all', $moduleList);
- 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 '\App\Language' in method 'throwNewException'. Open
echo(\Config\Debug::$EXCEPTION_ERROR_TO_SHOW ? $message : \App\Language::translate('ERR_OCCURRED_ERROR')) . PHP_EOL;
- 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 recurseDelete uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
rmdir($filename);
}
- 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\Language' in method 'throwNewException'. Open
$viewer->assign('MESSAGE', \Config\Debug::$EXCEPTION_ERROR_TO_SHOW ? $message : \App\Language::translate('ERR_OCCURRED_ERROR'));
- 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 recurseDelete uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
unlink($rootDir . $src);
++$i;
}
- 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 assigning values to variables in if clauses and the like (line '606', column '23'). Open
public static function getQueryParams($url): array
{
$queryParams = [];
if (!empty($url) && $queryStr = parse_url(htmlspecialchars_decode($url), PHP_URL_QUERY)) {
parse_str($queryStr, $queryParams);
- 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
Avoid using static access to class '\App\Cache' in method 'getAllModules'. Open
\App\Cache::save('moduleTabById', $row['tabid'], $row);
- 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 '\App\Cache' in method 'getAllModules'. Open
\App\Cache::save('moduleTabs', 'all', $moduleList);
- 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 '\App\Record' in method 'getCRMRecordLabel'. Open
$label = \App\Record::getLabel($id);
- 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 '\App\Request' in method 'throwNewException'. Open
if (\App\Request::_isAjax() && \App\Request::_isJSON()) {
- 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 throwNewException uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$trace = '';
if (\App\Config::debug('DISPLAY_EXCEPTION_BACKTRACE') && \is_object($e)) {
$trace = str_replace(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR, '', "->{$e->getFile()}:{$e->getLine()}\n{$e->getTraceAsString()}");
}
- 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
The method getLastWorkingDay uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$lastWorkingDay = date('Y-m-d', $date);
}
- 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\Cache' in method 'getAllModules'. Open
if (!\App\Cache::has('moduleTabByName', $row['name'])) {
- 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 '\App\Cache' in method 'getModuleData'. Open
\App\Cache::save('moduleTabByName', $row['name'], $row);
- 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 '\App\Language' in method 'throwNewException'. Open
$label = \App\Language::translateSingleMod(array_shift($params), 'Other.Exceptions');
- 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 '\App\Request' in method 'throwNewException'. Open
if (\App\Request::_isAjax() && \App\Request::_isJSON()) {
- 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 throwNewException uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
echo(\Config\Debug::$EXCEPTION_ERROR_TO_SHOW ? $message : \App\Language::translate('ERR_OCCURRED_ERROR')) . PHP_EOL;
}
- 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
The method getConversionRateInfo uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$value = \Settings_CurrencyUpdate_Module_Model::getCleanInstance()->getCRMConversionRate($currencyId, $defaultCurrencyId, $date);
$info['value'] = empty($value) ? 1.0 : round($value, 5);
$info['conversion'] = empty($value) ? 1.0 : round(1 / $value, 5);
}
- 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\Cache' in method 'getModuleData'. Open
if (\App\Cache::has('moduleTabByName', $name)) {
- 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 '\App\Cache' in method 'getModuleData'. Open
if ($name && \App\Cache::has('moduleTabByName', $name)) {
- 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 throwNewException uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$params = explode('||', $message);
$label = \App\Language::translateSingleMod(array_shift($params), 'Other.Exceptions');
$params = array_pad($params, substr_count($label, '%'), '');
$message = \call_user_func_array('vsprintf', [$label, $params]);
- 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
The method showBytes uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$unit = 'B';
$str = sprintf('%d ', $bytes) . $unit;
}
- 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\Cache' in method 'getModuleData'. Open
\App\Cache::save('moduleTabById', $row['tabid'], $row);
- 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 '\App\Language' in method 'throwNewException'. Open
$message = \App\Language::translateSingleMod($message, 'Other.Exceptions');
- 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 '\App\Config' in method 'getMinimizationOptions'. Open
$return = \App\Config::developer('MINIMIZE_JS');
- 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 arrayDiffAssocRecursive uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$newDiff = self::arrayDiffAssocRecursive($value, $array2[$key]);
if (!empty($newDiff)) {
$difference[$key] = $newDiff;
}
- 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
The method getAllModules uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$moduleList = [];
$rows = (new \App\Db\Query())->from('vtiger_tab')->all();
foreach ($rows as $row) {
if (!\App\Cache::has('moduleTabById', $row['tabid'])) {
- 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\Session' in method 'throwNewException'. Open
header("content-security-policy: default-src 'self' 'nonce-" . \App\Session::get('CSP_TOKEN') . "'; object-src 'none';base-uri 'self'; frame-ancestors 'self';");
- 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 '\App\Config' in method 'getMinimizationOptions'. Open
$return = \App\Config::developer('MINIMIZE_CSS');
- 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 getModuleData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$name = (string) $mixed;
if (\App\Cache::has('moduleTabByName', $name)) {
return \App\Cache::get('moduleTabByName', $name);
}
- 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\Language' in method 'throwNewException'. Open
$viewer->assign('HEADER_MESSAGE', \App\Language::translate($messageHeader));
- 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 '\App\Purifier' in method 'getHtmlOrPlainText'. Open
$content = \App\Purifier::decodeHtml($content);
- 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 '\App\Cache' in method 'getModuleData'. Open
if (\App\Cache::has('moduleTabById', $mixed)) {
- 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 '\App\Config' in method 'throwNewException'. Open
if (\App\Config::debug('DISPLAY_EXCEPTION_BACKTRACE') && \is_object($e)) {
- 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 getHtmlOrPlainText uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$content = nl2br($content);
}
- 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\Cache' in method 'getAllModules'. Open
if (\App\Cache::has('moduleTabs', 'all')) {
- 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 '\App\Cache' in method 'getModuleData'. Open
return $id ? \App\Cache::get('moduleTabById', $id) : null;
- 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 '\App\Config' in method 'throwNewException'. Open
if (!headers_sent() && \App\Config::security('cspHeaderActive')) {
- 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
Define a constant instead of duplicating this literal "presence" 5 times. Open
$row['presence'] = (int) $row['presence'];
- 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.
Define a constant instead of duplicating this literal "crmid" 5 times. Open
->select(['crmid', 'setype', 'deleted', 'smcreatorid', 'smownerid', 'createdtime', 'private'])
- 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.
Define a constant instead of duplicating this literal "tabid" 7 times. Open
if (!\App\Cache::has('moduleTabById', $row['tabid'])) {
- 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.
Define a constant instead of duplicating this literal "isentitytype" 3 times. Open
$row['isentitytype'] = (int) $row['isentitytype'];
- 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.
Define a constant instead of duplicating this literal "coloractive" 3 times. Open
$row['coloractive'] = (int) $row['coloractive'];
- 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.
Define a constant instead of duplicating this literal "deleted" 3 times. Open
->select(['crmid', 'setype', 'deleted', 'smcreatorid', 'smownerid', 'createdtime', 'private'])
- 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.
Define a constant instead of duplicating this literal "moduleTabByName" 7 times. Open
if (!\App\Cache::has('moduleTabByName', $row['name'])) {
- 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.
Define a constant instead of duplicating this literal "Y-m-d" 5 times. Open
$date = date('Y-m-d');
- 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.
Define a constant instead of duplicating this literal "moduleTabs" 4 times. Open
if (\App\Cache::has('moduleTabs', 'all')) {
- 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.
Define a constant instead of duplicating this literal "smownerid" 3 times. Open
->select(['crmid', 'setype', 'deleted', 'smcreatorid', 'smownerid', 'createdtime', 'private'])
- 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.
Define a constant instead of duplicating this literal "moduleTabById" 6 times. Open
if (!\App\Cache::has('moduleTabById', $row['tabid'])) {
- 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.
Define a constant instead of duplicating this literal "smcreatorid" 3 times. Open
->select(['crmid', 'setype', 'deleted', 'smcreatorid', 'smownerid', 'createdtime', 'private'])
- 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.
Define a constant instead of duplicating this literal "private" 3 times. Open
->select(['crmid', 'setype', 'deleted', 'smcreatorid', 'smownerid', 'createdtime', 'private'])
- 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.
Define a constant instead of duplicating this literal "ownedby" 3 times. Open
$row['ownedby'] = (int) $row['ownedby'];
- 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 undeclared method \App\Db\Query::from
Open
$rows = (new \App\Db\Query())->from('vtiger_tab')->all();
- Exclude checks
Expected @param annotation for column_name
to be before the @param annotation for type_of_data
Open
* * @param string $type_of_data - current type of data of the field. It is to return the same TypeofData
- Exclude checks
Call to undeclared method \RecursiveIteratorIterator::getSubPathName
Open
copy($item->getRealPath(), $dest . $iterator->getSubPathName());
- Exclude checks
Saw unextractable annotation for comment '* @param <integer> $currencyId - id of currency for which we want to retrieve conversion rate to default currency'</integer>
Open
* @param <Integer> $currencyId - id of currency for which we want to retrieve conversion rate to default currency
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$rows = (new \App\Db\Query())->from('vtiger_tab')->all();
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$query = (new \App\Db\Query())
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('HEADER_MESSAGE', \App\Language::translate($messageHeader));
- Exclude checks
Argument 2 (str)
is float
but \explode()
takes string
Open
$fld_value = explode('.', $value);
- Exclude checks
Saw unextractable annotation for comment '* @return <date> - last working y'</date>
Open
* @return <Date> - last working y
- Exclude checks
Argument 1 (str)
is float
but \rtrim()
takes string
Open
$fld_value = rtrim($value, '0');
- Exclude checks
Call to method getLine
from undeclared class \yii\db\Exception
(Did you mean class \Exception) Open
'trace' => str_replace(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR, '', "-> {$e->getFile()}:{$e->getLine()}\n{$e->getTraceAsString()}"),
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MESSAGE_EXPANDED', \is_array($message));
- Exclude checks
Call to method getTraceAsString
from undeclared class \yii\db\Exception
(Did you mean class \Exception) Open
'trace' => str_replace(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR, '', "-> {$e->getFile()}:{$e->getLine()}\n{$e->getTraceAsString()}"),
- Exclude checks
Call to undeclared method \RecursiveIteratorIterator::getSubPathName
Open
mkdir($dest . $iterator->getSubPathName(), 0755);
- Exclude checks
Saw unextractable annotation for comment '* @return <array> - array containing:'</array>
Open
* @return <Array> - array containing:
- Exclude checks
Saw unextractable annotation for comment '* @param <date> $date'</date>
Open
* @param <Date> $date
- Exclude checks
Saw unextractable annotation for comment '* @param <date> $date - date of exchange rates, if empty then rate from yesterday'</date>
Open
* @param <Date> $date - date of exchange rates, if empty then rate from yesterday
- Exclude checks
Call to method getFile
from undeclared class \yii\db\Exception
(Did you mean class \Exception) Open
'trace' => str_replace(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR, '', "-> {$e->getFile()}:{$e->getLine()}\n{$e->getTraceAsString()}"),
- Exclude checks
Variable $array
was undeclared, but array fields are being added to it. Open
$array[] = $values;
- Exclude checks
Saw an @param annotation for column_nametable_name,
but it was not found in the param list of function transformFieldTypeOfData(string $table_name, mixed $column_name, string $type_of_data)
Open
* * @param string $column_nametable_name - columnname value from field table
- Exclude checks
Call to method error
from undeclared class \App\Log
Open
\App\Log::error(__METHOD__ . ' - Required parameter missing');
- Exclude checks
Call to method getMessage
from undeclared class \yii\db\Exception
(Did you mean class \Exception) Open
$message = \is_object($e) ? $e->getMessage() : $e;
- Exclude checks
Call to method getCode
from undeclared class \yii\db\Exception
(Did you mean class \Exception) Open
$code = $e->getCode();
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MESSAGE', \Config\Debug::$EXCEPTION_ERROR_TO_SHOW ? $message : \App\Language::translate('ERR_OCCURRED_ERROR'));
- Exclude checks
Call to undeclared method \RecursiveIteratorIterator::getSubPathName
Open
if ($item->isDir() && !file_exists($dest . $iterator->getSubPathName())) {
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
return (new \App\Db\Query())->select([$fieldName])->from($tableName)->where([$idName => $id])->scalar();
- Exclude checks
Avoid excessively long variable names like $crmRecordIdMetadataCache. Keep variable name length under 20. Open
protected static $crmRecordIdMetadataCache = [];
- 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
The parameter $table_name is not named in camelCase. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
- Read upRead up
- Exclude checks
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
Avoid variables with short names like $id. Configured minimum length is 3. Open
public static function getSingleFieldValue($tableName, $fieldName, $idName, $id)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $gb. Configured minimum length is 3. Open
$gb = $bytes / 1073741824;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The parameter $column_name is not named in camelCase. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
- Read upRead up
- Exclude checks
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
Avoid variables with short names like $id. Configured minimum length is 3. Open
public static function clearCacheMetaDataRecord($id)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $i. Configured minimum length is 3. Open
$i = 0;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The parameter $type_of_data is not named in camelCase. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
- Read upRead up
- Exclude checks
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
Avoid variables with short names like $id. Configured minimum length is 3. Open
public static function getCRMRecordLabel($id, $default = '')
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $e. Configured minimum length is 3. Open
public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $mb. Configured minimum length is 3. Open
$mb = $bytes / 1048576;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $i. Configured minimum length is 3. Open
$i = 0;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $id. Configured minimum length is 3. Open
$id = $name = null;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Spaces must be used to indent lines; tabs are not allowed Open
if (is_numeric($mixed)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Cache::get('moduleTabByName', $name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $crmRecordIdMetadataCache = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $id
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(static::$crmRecordIdMetadataCache[$id])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result[$id] = self::$crmRecordIdMetadataCache[$id];
- Exclude checks
Line exceeds 120 characters; contains 146 characters Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['tabid'] = (int) $row['tabid'];
- 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 array|int $mixedid
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Cache::has('moduleTabs', 'all')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\App\Cache::has('moduleTabByName', $row['name'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['type'] = (int) $row['type'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($moduleList as $id => $module) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($moduleList[$id]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Cache::get('moduleTabById', $mixed);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$name = (string) $mixed;
- 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
\App\Cache::save('moduleTabs', 'all', $moduleList);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($ids as $id) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['private'] = (int) $row['private'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(self::$crmRecordIdMetadataCache[$id])) {
- 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
$row['presence'] = (int) $row['presence'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$restrictedModules = ['Dashboard', 'ModComments'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($isEntityType && 0 === (int) $module['isentitytype']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $colorActive && 1 !== (int) $module['coloractive']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($moduleList[$id]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $moduleList;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$missing = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($missing) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result[$id] = null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getAllModules($isEntityType = true, $showRestricted = false, $presence = false, $colorActive = false, $ownedby = false)
- 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
\App\Cache::save('moduleTabs', 'all', $moduleList);
- 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 (empty($mixed)) {
- 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
unset(static::$crmRecordIdMetadataCache[$id]);
- 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
$row['premium'] = (int) $row['premium'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$showRestricted && \in_array($module['name'], $restrictedModules)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$id = $mixed;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::save('moduleTabById', $row['tabid'], $row);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleList[$row['tabid']] = $row;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($name && \App\Cache::has('moduleTabByName', $name)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// MODULE RECORD
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Clear cache meta data for records.
- 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
->select(['crmid', 'setype', 'deleted', 'smcreatorid', 'smownerid', 'createdtime', 'private'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['smcreatorid'] = (int) $row['smcreatorid'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$crmRecordIdMetadataCache[$row['crmid']] = $row;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rows = (new \App\Db\Query())->from('vtiger_tab')->all();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $presence && (int) $module['presence'] !== $presence) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($moduleList[$id]);
- 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
$result = [];
- 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
$id = $name = null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rows = (new \App\Db\Query())->from('vtiger_tab')->all();
- 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
$missing[] = $id;
- 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
$row['crmid'] = (int) $row['crmid'];
- 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 (\App\Cache::has('moduleTabByName', $name)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleList = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($rows as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function clearCacheMetaDataRecord($id)
- 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
->from('vtiger_crmentity')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = $query->createCommand()->query();
- 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
if (false !== $ownedby && (int) $module['ownedby'] !== $ownedby) {
- 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 $id ? \App\Cache::get('moduleTabById', $id) : null;
- 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
\App\Log::error(__METHOD__ . ' - Required parameter missing');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::save('moduleTabByName', $row['name'], $row);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ids = $multimode ? $mixedid : [$mixedid];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['in', 'crmid', $missing]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($ids as $id) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::save('moduleTabByName', $row['name'], $row);
- 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 getModuleData($mixed)
- 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 gets record metadata.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($id && !isset(self::$crmRecordIdMetadataCache[$id])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::save('moduleTabById', $row['tabid'], $row);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleList[$row['tabid']] = $row;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($moduleList[$id]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Cache::has('moduleTabById', $mixed)) {
- 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
$row['deleted'] = (int) $row['deleted'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleList = \App\Cache::get('moduleTabs', 'all');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['tabsequence'] = (int) $row['tabsequence'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['ownedby'] = (int) $row['ownedby'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['isentitytype'] = (int) $row['isentitytype'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($moduleList[$id]);
- 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 \App\Cache::get('moduleTabByName', $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
public static function getCRMRecordMetadata($mixedid)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$multimode = \is_array($mixedid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['smownerid'] = (int) $row['smownerid'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field = null;
- 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
* * "vtiger_quotes:potentialid"=>"V",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleList = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['customized'] = (int) $row['customized'];
- 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
*/
- 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 bool $onlyactive
- 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 $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($encode && \is_string($string)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return preg_replace('/"/', ' ', $str);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_contactsubdetails:birthday' => 'D',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_account:email2' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Faq Related Fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_senotesrel:crmid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('' === $values) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $multimode ? $result : array_shift($result);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field = \App\Field::getFieldInfo($mixed, $moduleId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function br2nl($str)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* * @param string $table_name - tablename value from field table
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* * Now in customview and report's advance filter this field's criteria will be show like string.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_account:email1' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_leaddetails:email' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//HelpDesk Related Fields
- 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 ($field && $onlyactive && ('0' !== $field['presence'] && '2' !== $field['presence'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fld_value = rtrim($value, '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
$str = preg_replace("/'/", ' ', $str);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function suppressHTMLTags($string)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* * @param string $column_nametable_name - columnname value from field table
- 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 $new_field_details = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_activityproductrel:activityid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $array;
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
$trace = str_replace(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR, '', "->{$e->getFile()}:{$e->getLine()}\n{$e->getTraceAsString()}");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('HEADER_MESSAGE', \App\Language::translate($messageHeader));
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
echo(\Config\Debug::$EXCEPTION_ERROR_TO_SHOW ? $message : \App\Language::translate('ERR_OCCURRED_ERROR')) . PHP_EOL;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\AppException($message['message']);
- 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
* @param string $dest
- 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 ($rows as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\App\Cache::has('moduleTabById', $row['tabid'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['coloractive'] = (int) $row['coloractive'];
- 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
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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 preg_replace(['/</', '/>/', '/"/'], ['<', '>', '"'], $string);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $idName - idname which is the name of the entity id in the table like, inoviceid, etc.,
- 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
$field = $table_name . ':' . $column_name;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_contactdetails:parentid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_seproductsrel:crmid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = explode('||', $message);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$label = \App\Language::translateSingleMod(array_shift($params), 'Other.Exceptions');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $outsideRoot
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function recurseDelete($src, $outsideRoot = false): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($src, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
- 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
* @param int|string $mixed
- 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
$string = addslashes(str_replace(array_values($popup_toHtml), array_keys($popup_toHtml), $string));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getSingleFieldValue($tableName, $fieldName, $idName, $id)
- 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
* * fieldlabel | typeofdata | tablename | columnname |
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Documents Related Fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_senotesrel:crmid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_campaign_records:crmid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($new_field_details[$field])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type_of_data = $new_field_details[$field];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
header("content-security-policy: default-src 'self' 'nonce-" . \App\Session::get('CSP_TOKEN') . "'; object-src 'none';base-uri 'self'; frame-ancestors 'self';");
- Exclude checks
Line exceeds 120 characters; contains 173 characters Open
header("content-security-policy: default-src 'self' 'nonce-" . \App\Session::get('CSP_TOKEN') . "'; object-src 'none';base-uri 'self'; frame-ancestors 'self';");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\is_array($message)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\ApiException($message, 401);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$trace = '';
- 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 $src
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dest = $dest . \DIRECTORY_SEPARATOR;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dest = $rootDir . $dest;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
copy($item->getRealPath(), $dest . $iterator->getSubPathName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translateSingleMod($message, 'Other.Exceptions');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \call_user_func_array('vsprintf', [$label, $params]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$response->emit();
- 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
$viewer->view('Exceptions/ExceptionError.tpl', '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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $src
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rootDir = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
- Exclude checks
Line exceeds 120 characters; contains 190 characters Open
foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($src, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getCRMRecordLabel($id, $default = '')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return empty($label) ? $default : $label;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function formatDecimal($value)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = rtrim($fld_value, '.');
- 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
//Lead Related Fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_pricebookproductrel:pricebookid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getArrayFromValue($values)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$array = explode(',', $values);
- 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 (!headers_sent() && \App\Config::security('cspHeaderActive')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\PHP_SAPI !== 'cli') {
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
'trace' => str_replace(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR, '', "-> {$e->getFile()}:{$e->getLine()}\n{$e->getTraceAsString()}"),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer = new \Vtiger_Viewer();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rootDir = ($outsideRoot || 0 === strpos($src, ROOT_DIRECTORY)) ? '' : ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
- 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
mkdir($dest . $iterator->getSubPathName(), 0755);
- 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
public static function getModuleFieldId($moduleId, $mixed, $onlyactive = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Utility
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fld_value = explode('.', $value);
- 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
$str = preg_replace("/(\r\n)/", '\\r\\n', $str);
- 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 $type_of_data - If the string matched with the $new_field_details array then the Changed
- 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
'vtiger_leaddetails:secondaryemail' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_troubletickets:product_id' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Related List Entries(For Report Module)
- 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
$code = $e->getCode();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getHtmlOrPlainText(string $content)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* The function copies files.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $i;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool|int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $field ? $field['fieldid'] : false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$popup_toHtml = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (new \App\Db\Query())->select([$fieldName])->from($tableName)->where([$idName => $id])->scalar();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_contactdetails:secondaryemail' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Product Related Fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_products:parentid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Vendor Related Fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_vendor:email' => 'V',
- 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 $type_of_data;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = array_pad($params, substr_count($label, '%'), '');
- 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
$label = \App\Record::getLabel($id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $content;
- 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 $type_of_data - current type of data of the field. It is to return the same TypeofData
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to delete files and dirs.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* * EXAMPLE: If you have a field entry like this:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!file_exists($rootDir . $src)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Account Related Fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDir . $src, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST) as $filename => $file) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_activityproductrel:productid' => 'V',
- Exclude checks
Line exceeds 120 characters; contains 207 characters Open
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDir . $src, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST) as $filename => $file) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_campaign_records:campaignid' => 'V',
- 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
'vtiger_pricebookproductrel:productid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return [];
- 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
if (\is_object($e)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
$viewer->assign('MESSAGE', \Config\Debug::$EXCEPTION_ERROR_TO_SHOW ? $message : \App\Language::translate('ERR_OCCURRED_ERROR'));
- 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
trigger_error(print_r($message, true), E_USER_ERROR);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get html rr plain text.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
rmdir($rootDir . $src);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$i;
- 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
* * Potential Name | I~O | vtiger_quotes | potentialid |
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Contacts Related Fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new $message();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\is_array($message)) {
- 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->isFile()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$i;
- 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 int|string $moduleId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function fromHtmlPopup($string, $encode = 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
* * if the field is not matched with the $new_field_details array.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Add the field details in this array if you want to change the advance filter field details
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_contactdetails:email' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_troubletickets:parent_id' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Campaign Related Fields
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_seproductsrel:productid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $values;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$response->setEmitType(\Vtiger_Response::$EMIT_JSON);
- 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
$response->setError($code, $message, $trace);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('MESSAGE', \Config\Debug::$EXCEPTION_ERROR_TO_SHOW ? $message : \App\Language::translate('ERR_OCCURRED_ERROR'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($die) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $content
- 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 (\App\Utils::isHtml($content)) {
- 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 recurseCopy($src, $dest)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($dest && '/' !== substr($dest, -1) && '\\' !== substr($dest, -1)) {
- 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
/** Function used to retrieve a single field value from database.
- 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
'vtiger_account:parentid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//If the Fields details does not match with the array, then we return the same typeofdata
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false === strpos($values, ',')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$array[] = $values;
- 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
$trace = str_replace(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR, '', "->{$e->getFile()}:{$e->getLine()}\n{$e->getTraceAsString()}");
- 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
http_response_code($code);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('MESSAGE_EXPANDED', \is_array($message));
- 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
$content = \App\Purifier::decodeHtml($content);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (is_dir($rootDir . $src)) {
- 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
$i = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to gets mudule field ID.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $id - entity id
- 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 mixed $column_name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_products:discontinued' => 'C',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_pricebook:currency_id' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \is_object($e) ? $e->getMessage() : $e;
- 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
'trace' => str_replace(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR, '', "-> {$e->getFile()}:{$e->getLine()}\n{$e->getTraceAsString()}"),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unlink($filename);
- 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
} elseif (!$item->isDir()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$i;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $tableName - tablename from which we will retrieve the field value
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* return mixed $fieldval - field value of the needed fieldname from database will be returned
- 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 used to change the Type of Data for advanced filters in custom view and Reports.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* * typeofdata will return, else the same typeofdata will return.
- 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
'vtiger_products:vendor_id' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_faq:product_id' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_senotesrel:notesid' => 'V',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 500;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false === strpos($message, '||')) {
- 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 (!empty($fld_value[1])) {
- 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 $fieldName - fieldname to which we want to get the value from database
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
* return mixed $fieldval - field value of the needed fieldname from database will be returned
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* * Then put an entry in $new_field_details like this:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_campaign:product_id' => 'V',
- 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 (\is_array($values)) {
- 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 (\App\Request::_isAjax() && \App\Request::_isJSON()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$response->setException($e);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Config::debug('DISPLAY_EXCEPTION_BACKTRACE') && \is_object($e)) {
- 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
rmdir($filename);
- 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 (is_numeric($str)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (float) $bytes;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$str = sprintf('%d ', round($bytes / 1024)) . $unit;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Sat' === date('D', $date)) { // switch to friday the day before
- 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 (empty($date)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('API' === \App\Process::$requestMode) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'message' => $message,
- 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
echo(\Config\Debug::$EXCEPTION_ERROR_TO_SHOW ? $message : \App\Language::translate('ERR_OCCURRED_ERROR')) . PHP_EOL;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\is_object($message)) {
- 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
{
- 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
return $i;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!file_exists($rootDir . $src)) {
- 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 ($item->isDir() && !file_exists($dest . $iterator->getSubPathName())) {
- 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
$unit = 'MB';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'css':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('Sun' === date('D', $date)) { // switch to friday two days before
- 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
* conversion - 1 $currencyId -> default currency
- 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
$response = new \Vtiger_Response();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Config::debug('DISPLAY_EXCEPTION_BACKTRACE') && \is_object($e)) {
- 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($message);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content = nl2br($content);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$i = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unlink($rootDir . $src);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return float
- 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
} elseif ($bytes >= 1024) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($type) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Checks if given date is working day, if not returns last working day.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param <Date> $date - date of exchange rates, if empty then rate from yesterday
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$defaultCurrencyId = \App\Fields\Currency::getDefault()['id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$info['conversion'] = empty($value) ? 1.0 : round(1 / $value, 5);
- 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
case 'g':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'k':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$date = strtotime($date);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lastWorkingDay = date('Y-m-d', $date);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($currencyId == $defaultCurrencyId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parse_str($queryStr, $queryParams);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$str = sprintf($gb >= 10 ? '%d ' : '%.2f ', $gb) . $unit;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return = \App\Config::developer('MINIMIZE_JS');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getLastWorkingDay($date)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
$value = \Settings_CurrencyUpdate_Module_Model::getCleanInstance()->getCRMConversionRate($currencyId, $defaultCurrencyId, $date);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Getting parameters from URL.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\is_array($value)) {
- 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
case 'm':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$unit = 'GB';
- 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 getConversionRateInfo($currencyId, $date = '')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$info['value'] = 1.0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getQueryParams($url): array
- 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 <Date> - last working y
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <Array> - array containing:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* date - date of rate
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$info = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$date = self::getLastWorkingDay($yesterday);
- 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
$bytes = (float) ($regs[1]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch (strtolower($regs[2])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$bytes *= 1073741824;
- 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 mixed $bytes
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$gb = $bytes / 1073741824;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param <Date> $date
- 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
$lastWorkingDay = date('Y-m-d', strtotime('-1 day', $date));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function that returns conversion info from default system currency to chosen one.
- 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($array2[$key]) || !\is_array($array2[$key])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $str
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'gb':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- 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
$unit = 'B';
- 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
case 'js':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lastWorkingDay = date('Y-m-d', strtotime('-2 day', $date));
- 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 $info;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function arrayDiffAssocRecursive($array1, $array2)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$difference = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($array1 as $key => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (float) $str;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$bytes *= 1048576;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$unit = 'KB';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- 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 array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($url) && $queryStr = parse_url(htmlspecialchars_decode($url), PHP_URL_QUERY)) {
- 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
case 'kb':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$bytes *= 1024;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$mb = $bytes / 1048576;
- 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
$return = \App\Config::developer('MINIMIZE_CSS');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $return;
- 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
* @param <Integer> $currencyId - id of currency for which we want to retrieve conversion rate to default currency
- 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
$info['conversion'] = 1.0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$info['value'] = empty($value) ? 1.0 : round($value, 5);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryParams = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $queryParams;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function parseBytes($str): float
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- 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
$value = \Settings_CurrencyUpdate_Module_Model::getCleanInstance()->getCRMConversionRate($currencyId, $defaultCurrencyId, $date);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$difference[$key] = $newDiff;
- 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
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $unit
- 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 showBytes($bytes, &$unit = null): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$bytes = self::parseBytes($bytes);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($bytes >= 1073741824) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $lastWorkingDay;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$yesterday = date('Y-m-d', strtotime('-1 day'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($newDiff)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$difference[$key] = $value;
- 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
* Parse bytes.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$bytes = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'mb':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $str;
- 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
$date = date('Y-m-d');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* value - conversion 1 default currency -> $currencyId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newDiff = self::arrayDiffAssocRecursive($value, $array2[$key]);
- 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
} elseif (!\array_key_exists($key, $array2) || $array2[$key] !== $value) {
- 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 (preg_match('/([0-9\.]+)\s*([a-z]*)/i', $str, $regs)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$str = sprintf($mb >= 10 ? '%d ' : '%.2f ', $mb) . $unit;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getMinimizationOptions($type = 'js')
- 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|null $url
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$difference[$key] = $value;
- 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
return $difference;
- 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
* Show bytes.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ($bytes >= 1048576) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$str = sprintf('%d ', $bytes) . $unit;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($date)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$info['date'] = $date;
- 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
The variable $fld_value is not named in camelCase. Open
public static function formatDecimal($value)
{
$fld_value = explode('.', $value);
if (!empty($fld_value[1])) {
$fld_value = rtrim($value, '0');
- Read upRead up
- Exclude checks
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 $popup_toHtml is not named in camelCase. Open
public static function fromHtmlPopup($string, $encode = true)
{
$popup_toHtml = [
'"' => '"',
"'" => ''',
- Read upRead up
- Exclude checks
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 $fld_value is not named in camelCase. Open
public static function formatDecimal($value)
{
$fld_value = explode('.', $value);
if (!empty($fld_value[1])) {
$fld_value = rtrim($value, '0');
- Read upRead up
- Exclude checks
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 $table_name is not named in camelCase. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
- Read upRead up
- Exclude checks
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 $column_name is not named in camelCase. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
- Read upRead up
- Exclude checks
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 $new_field_details is not named in camelCase. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
- Read upRead up
- Exclude checks
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 $fld_value is not named in camelCase. Open
public static function formatDecimal($value)
{
$fld_value = explode('.', $value);
if (!empty($fld_value[1])) {
$fld_value = rtrim($value, '0');
- Read upRead up
- Exclude checks
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 $type_of_data is not named in camelCase. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
- Read upRead up
- Exclude checks
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 $popup_toHtml is not named in camelCase. Open
public static function fromHtmlPopup($string, $encode = true)
{
$popup_toHtml = [
'"' => '"',
"'" => ''',
- Read upRead up
- Exclude checks
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 $popup_toHtml is not named in camelCase. Open
public static function fromHtmlPopup($string, $encode = true)
{
$popup_toHtml = [
'"' => '"',
"'" => ''',
- Read upRead up
- Exclude checks
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 $type_of_data is not named in camelCase. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
- Read upRead up
- Exclude checks
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 $new_field_details is not named in camelCase. Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
- Read upRead up
- Exclude checks
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 $fld_value is not named in camelCase. Open
public static function formatDecimal($value)
{
$fld_value = explode('.', $value);
if (!empty($fld_value[1])) {
$fld_value = rtrim($value, '0');
- Read upRead up
- Exclude checks
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();
}
}