getDefaultMailAccount accesses the super-global variable $_SESSION. Open
public static function getDefaultMailAccount($accounts)
{
return (isset($_SESSION['AutoLoginUser']) && \array_key_exists($_SESSION['AutoLoginUser'], $accounts)) ? $accounts[$_SESSION['AutoLoginUser']] : reset($accounts);
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getDefaultMailAccount accesses the super-global variable $_SESSION. Open
public static function getDefaultMailAccount($accounts)
{
return (isset($_SESSION['AutoLoginUser']) && \array_key_exists($_SESSION['AutoLoginUser'], $accounts)) ? $accounts[$_SESSION['AutoLoginUser']] : reset($accounts);
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getDefaultMailAccount accesses the super-global variable $_SESSION. Open
public static function getDefaultMailAccount($accounts)
{
return (isset($_SESSION['AutoLoginUser']) && \array_key_exists($_SESSION['AutoLoginUser'], $accounts)) ? $accounts[$_SESSION['AutoLoginUser']] : reset($accounts);
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Function getComposeParam
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
- 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 getExternalUrlForWidget
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
{
if (\is_object($record)) {
$body = $record->get('content');
$subject = $record->get('subject');
- 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 getComposeParam
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
The class OSSMail_Module_Model has an overall complexity of 84 which is very high. The configured complexity threshold is 50. Open
class OSSMail_Module_Model extends Vtiger_Module_Model
{
public function getDefaultViewName()
{
return 'Index';
- Exclude checks
Method getExternalUrlForWidget
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
{
if (\is_object($record)) {
$body = $record->get('content');
$subject = $record->get('subject');
File Module.php
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @copyright YetiForce S.A.
* @license YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
Method getExternalUrl
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
{
$url = 'mailto:';
$request = new App\Request([]);
if ($moduleName) {
Function getExternalUrl
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
{
$url = 'mailto:';
$request = new App\Request([]);
if ($moduleName) {
- 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
Consider simplifying this complex logical expression. Open
if (('Users' === $moduleName && $record === \App\User::getCurrentUserRealId()) || ('Users' !== $moduleName && !empty($record) && \App\Record::isExists($record) && \App\Privilege::isPermitted($moduleName, 'DetailView', $record))) {
$recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
$eventHandler = new App\EventHandler();
$eventHandler->setRecordModel($recordModel)->setModuleName($moduleName)->setParams($return);
$eventHandler->trigger('MailComposeParamBefore');
The method getComposeParam() has an NPath complexity of 49102848. The configured NPath complexity threshold is 200. Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
- 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 getExternalUrlForWidget() has an NPath complexity of 480. The configured NPath complexity threshold is 200. Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
{
if (\is_object($record)) {
$body = $record->get('content');
$subject = $record->get('subject');
- 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 getComposeParam() has 112 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
- Exclude checks
The method getExternalUrl() has an NPath complexity of 384. The configured NPath complexity threshold is 200. Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
{
$url = 'mailto:';
$request = new App\Request([]);
if ($moduleName) {
- 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 getExternalUrl() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
{
$url = 'mailto:';
$request = new App\Request([]);
if ($moduleName) {
- 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 getComposeParam() has a Cyclomatic Complexity of 42. The configured cyclomatic complexity threshold is 10. Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
- 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 getExternalUrlForWidget() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10. Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
{
if (\is_object($record)) {
$body = $record->get('content');
$subject = $record->get('subject');
- 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
Refactor this function to reduce its Cognitive Complexity from 69 to the 15 allowed. Open
public static function getComposeParam(App\Request $request)
- 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 33 to the 15 allowed. Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = 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
The class OSSMail_Module_Model has a coupling between objects value of 22. Consider to reduce the number of dependencies under 13. Open
class OSSMail_Module_Model extends Vtiger_Module_Model
{
public function getDefaultViewName()
{
return 'Index';
- 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 '73', column '24'). Open
$eventHandler = new App\EventHandler();
- 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 getComposeUrl has a boolean flag argument $type, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getComposeUrl($moduleName = false, $record = false, $view = false, $type = false): string
- 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 '209', column '18'). Open
$request = new App\Request([]);
- 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 getExternalUrlForWidget has a boolean flag argument $srecord, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = 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 getExternalUrl has a boolean flag argument $view, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
- 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 getComposeUrl has a boolean flag argument $view, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getComposeUrl($moduleName = false, $record = false, $view = false, $type = false): string
- 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 getComposeUrl has a boolean flag argument $moduleName, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getComposeUrl($moduleName = false, $record = false, $view = false, $type = false): string
- 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 getComposeUrl has a boolean flag argument $record, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getComposeUrl($moduleName = false, $record = false, $view = false, $type = false): string
- 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 getExternalUrl has a boolean flag argument $moduleName, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
- 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 getExternalUrl has a boolean flag argument $record, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
- 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 getExternalUrl has a boolean flag argument $type, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
- 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 getExternalUrlForWidget has a boolean flag argument $smoduleName, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = 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 '188', column '19'). Open
$config = (new \App\Db\Query())->select(['parameter', 'value'])->from('vtiger_ossmailscanner_config')
- 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 '297', column '19'). Open
$purifier = new HTMLPurifier($config);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\App\EmailParser' in method 'getComposeParam'. Open
$emailParser = \App\EmailParser::getInstanceByModel($recordModel);
- 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 'getExternalUrl'. Open
$url .= 'subject=' . \App\Purifier::encodeHtml($param['subject']) . '&';
- 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 'Settings_Vtiger_MenuItem_Model' in method 'getSettingLinks'. Open
if ($menu = Settings_Vtiger_MenuItem_Model::getInstance('Mail')) {
- 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 'getComposeParam'. Open
if (($templateId = $request->getInteger('template', 0)) && \App\Record::isExists($templateId, 'EmailTemplates')) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '21', column '7'). Open
public function getSettingLinks(): array
{
Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
$settingsLinks = [];
if ($menu = Settings_Vtiger_MenuItem_Model::getInstance('Mail')) {
- 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 'OSSMailView_Record_Model' in method 'getComposeParam'. Open
$recordModel_OSSMailView = OSSMailView_Record_Model::getCleanInstance('OSSMailView');
- 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 '\Vtiger_Record_Model' in method 'getComposeParam'. Open
$templateModel = \Vtiger_Record_Model::getInstanceById($templateId, 'EmailTemplates');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '79', column '36'). Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
- 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\Record' in method 'getComposeParam'. Open
if (('Users' === $moduleName && $record === \App\User::getCurrentUserRealId()) || ('Users' !== $moduleName && !empty($record) && \App\Record::isExists($record) && \App\Privilege::isPermitted($moduleName, 'DetailView', $record))) {
- 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\Privilege' in method 'getComposeParam'. Open
if (('Users' === $moduleName && $record === \App\User::getCurrentUserRealId()) || ('Users' !== $moduleName && !empty($record) && \App\Record::isExists($record) && \App\Privilege::isPermitted($moduleName, 'DetailView', $record))) {
- 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 'Users_Record_Model' in method 'getComposeParam'. Open
$currentUser = Users_Record_Model::getCurrentUserModel();
- 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\User' in method 'getComposeParam'. Open
if (('Users' === $moduleName && $record === \App\User::getCurrentUserRealId()) || ('Users' !== $moduleName && !empty($record) && \App\Record::isExists($record) && \App\Privilege::isPermitted($moduleName, 'DetailView', $record))) {
- 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\ModuleHierarchy' in method 'getComposeParam'. Open
if (!\in_array($moduleName, array_keys(array_merge(\App\ModuleHierarchy::getModulesByLevel(0), \App\ModuleHierarchy::getModulesByLevel(3)))) || 'Campaigns' === $moduleName) {
- 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\Fields\File' in method 'getComposeParam'. Open
$fileName = \App\Fields\File::sanitizeUploadFileName($recordModel->getName()) . '.ics';
- 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\ModuleHierarchy' in method 'getComposeParam'. Open
if (!\in_array($moduleName, array_keys(array_merge(\App\ModuleHierarchy::getModulesByLevel(0), \App\ModuleHierarchy::getModulesByLevel(3)))) || 'Campaigns' === $moduleName) {
- 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\TextParser' in method 'getComposeParam'. Open
$textParser = \App\TextParser::getInstanceByModel($recordModel);
- 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 'getComposeParam'. Open
$moduleConfig = App\Config::module($moduleName);
- 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 'Vtiger_Loader' in method 'getSettingLinks'. Open
Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
- 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 'getExternalUrl'. Open
$url .= 'body=' . \App\Purifier::encodeHtml($param['body']) . '&';
- 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 'getComposeParam'. Open
$filePath = \App\Config::main('tmp_dir');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '107', column '10'). Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
- 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 'Vtiger_Record_Model' in method 'getComposeParam'. Open
$recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
- 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 getExternalUrlForWidget uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$url = 'mailto:' . $from;
$subject = 'Re: ' . $subject;
}
- 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 getExternalUrlForWidget uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$content .= \App\Language::translateArgs('LBL_MAIL_REPLY_INTRO', 'OSSMailView', $date, $from) . PHP_EOL;
foreach (explode(PHP_EOL, $body) as $line) {
$line = trim($line);
if (!empty($line)) {
- 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\ModuleHierarchy' in method 'getExternalUrlForWidget'. Open
if (!\in_array($smoduleName, array_keys(array_merge(\App\ModuleHierarchy::getModulesByLevel(0), \App\ModuleHierarchy::getModulesByLevel(3))))) {
- 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 'HTMLPurifier_Config' in method 'getExternalUrlForWidget'. Open
$config = HTMLPurifier_Config::createDefault();
- 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 'getExternalUrlForWidget'. Open
$mailtoLimit = \App\Config::component('Mail', 'MAILTO_LIMIT');
- 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 'getExternalUrlForWidget'. Open
$content .= \App\Language::translate('Date', 'OSSMailView') . ': ' . $date . 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
Avoid using static access to class '\App\Language' in method 'getExternalUrlForWidget'. Open
$content .= \App\Language::translate('Subject', 'OSSMailView') . ': ' . $subject . 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
Avoid using static access to class 'Vtiger_Record_Model' in method 'getExternalUrlForWidget'. Open
$recordModel = Vtiger_Record_Model::getInstanceById($srecord);
- 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 'getExternalUrlForWidget'. Open
$content .= \App\Language::translate('From', 'OSSMailView') . ': ' . $from . 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
Avoid using static access to class '\App\Config' in method 'getExternalUrlForWidget'. Open
$config->set('Core.Encoding', \App\Config::main('default_charset'));
- 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\ModuleHierarchy' in method 'getExternalUrlForWidget'. Open
if (!\in_array($smoduleName, array_keys(array_merge(\App\ModuleHierarchy::getModulesByLevel(0), \App\ModuleHierarchy::getModulesByLevel(3))))) {
- 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 'getExternalUrlForWidget'. Open
$content .= \App\Language::translateArgs('LBL_MAIL_REPLY_INTRO', 'OSSMailView', $date, $from) . 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 getExternalUrlForWidget uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$body = $record['bodyRaw'];
$subject = $record['subjectRaw'];
$from = $record['fromRaw'];
$to = $record['toRaw'];
- 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 'getExternalUrlForWidget'. Open
$content .= \App\Language::translate('LBL_MAIL_FORWARD_INTRO', 'OSSMailView') . 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
Avoid using static access to class '\App\Language' in method 'getExternalUrlForWidget'. Open
$content .= \App\Language::translate('To', 'OSSMailView') . ': ' . $to . 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
Define a constant instead of duplicating this literal "mailto:" 3 times. Open
$url = 'mailto:';
- 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 "OSSMailView" 7 times. Open
$recordModel_OSSMailView = OSSMailView_Record_Model::getCleanInstance('OSSMailView');
- 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 "&body=" 3 times. Open
if (\strlen($url . '&body=' . rawurlencode($content . $line)) > $mailtoLimit) {
- 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 "AutoLoginUser" 3 times. Open
return (isset($_SESSION['AutoLoginUser']) && \array_key_exists($_SESSION['AutoLoginUser'], $accounts)) ? $accounts[$_SESSION['AutoLoginUser']] : reset($accounts);
- 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 "subject" 8 times. Open
$subject = $textParser->setContent($templateModel->get('subject'))->parse()->getContent();
- 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 "crmView" 3 times. Open
if (!$request->isEmpty('crmView')) {
- 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.
Suspicious array access to int
Open
$subject = $record['subjectRaw'];
- Exclude checks
Suspicious array access to int
Open
$to = $record['toRaw'];
- Exclude checks
Assigning array|array{popup:false|true}
to property but \OSSMail_Module_Model::$composeParam
is false
Open
self::$composeParam = $config;
- Exclude checks
Call to method createDefault
from undeclared class \HTMLPurifier_Config
Open
$config = HTMLPurifier_Config::createDefault();
- Exclude checks
Suspicious array access to int
Open
$from = $record['fromRaw'];
- Exclude checks
Call to method getInstanceByModel
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$textParser = \App\TextParser::getInstanceByModel($recordModel);
- Exclude checks
Call to undeclared method \Vtiger_Record_Model::getICal
Open
if (false !== file_put_contents($filePath, $recordModel->getICal())) {
- Exclude checks
Suspicious array access to int
Open
$date = $record['date'];
- Exclude checks
Call to method __construct
from undeclared class \HTMLPurifier
Open
$purifier = new HTMLPurifier($config);
- Exclude checks
Call to method getCurrentUserRealId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if (('Users' === $moduleName && $record === \App\User::getCurrentUserRealId()) || ('Users' !== $moduleName && !empty($record) && \App\Record::isExists($record) && \App\Privilege::isPermitted($moduleName, 'DetailView', $record))) {
- Exclude checks
Default value for string
$smoduleName
can't be false
Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
- Exclude checks
Static call to undeclared method \App\EmailParser::getInstanceByModel
Open
$emailParser = \App\EmailParser::getInstanceByModel($recordModel);
- Exclude checks
Default value for int
$srecord
can't be false
Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
- Exclude checks
Parameter $queryGenerator
has undeclared type \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
public function getModalRecordsListSourceFields(App\QueryGenerator $queryGenerator, Vtiger_Module_Model $baseModule, $popupFields)
- Exclude checks
Suspicious array access to int
Open
$cc = $record['ccRaw'];
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$config = (new \App\Db\Query())->select(['parameter', 'value'])->from('vtiger_ossmailscanner_config')
- Exclude checks
Returning type false
but getComposeParameters()
is declared to return array
Open
return self::$composeParam;
- Exclude checks
Suspicious array access to int
Open
$body = $record['bodyRaw'];
- Exclude checks
Call to method purify
from undeclared class \HTMLPurifier
Open
$body = $purifier->purify($body);
- Exclude checks
Identical blocks of code found in 2 locations. Consider refactoring. Open
foreach (explode(PHP_EOL, $body) as $line) {
$line = trim($line);
if (!empty($line)) {
$line = '> ' . $line . PHP_EOL;
if (\strlen($url . '&body=' . rawurlencode($content . $line)) > $mailtoLimit) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
foreach (explode(PHP_EOL, $body) as $line) {
$line = trim($line);
if (!empty($line)) {
$line = '> ' . $line . PHP_EOL;
if (\strlen($url . '&body=' . rawurlencode($content . $line)) > $mailtoLimit) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function getSettingLinks(): array
{
Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
$settingsLinks = [];
if ($menu = Settings_Vtiger_MenuItem_Model::getInstance('Mail')) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 95.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid excessively long variable names like $recordModel_OSSMailView. Keep variable name length under 20. Open
$recordModel_OSSMailView = OSSMailView_Record_Model::getCleanInstance('OSSMailView');
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class OSSMail_Module_Model extends Vtiger_Module_Model
- Exclude checks
The class OSSMail_Module_Model is not named in CamelCase. Open
class OSSMail_Module_Model extends Vtiger_Module_Model
{
public function getDefaultViewName()
{
return 'Index';
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Avoid variables with short names like $cc. Configured minimum length is 3. Open
$cc = $record->get('cc_email');
- 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 $to. Configured minimum length is 3. Open
$to = $record->get('to_email');
- 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
Expected 0 spaces before closing bracket; 1 found Open
if ('Calendar' === $moduleName && !$recordModel->isEmpty('meeting_url') && !\array_key_exists('meetingUrl', $params) ) {
- 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
$url = 'index.php?module=OSSMail&view=Compose';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 152 characters Open
'linkurl' => 'index.php?module=OSSMail&parent=Settings&view=Index&block=' . $menu->get('blockid') . '&fieldid=' . $menu->get('fieldid'),
- 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 mixed $record
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_MODULE_CONFIGURATION',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 'Index';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'LISTVIEWSETTING',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 170 characters Open
return (isset($_SESSION['AutoLoginUser']) && \array_key_exists($_SESSION['AutoLoginUser'], $accounts)) ? $accounts[$_SESSION['AutoLoginUser']] : reset($accounts);
- 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 function getSettingLinks(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $view
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['to'] = $email;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($recordNumber)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$textParser = \App\TextParser::getInstanceByModel($recordModel);
- 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 (!$request->isEmpty('mid') && !empty($type)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$request->isEmpty('emails')) {
- 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
$config = (new \App\Db\Query())->select(['parameter', 'value'])->from('vtiger_ossmailscanner_config')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getDefaultViewName()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($menu = Settings_Vtiger_MenuItem_Model::getInstance('Mail')) {
- 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 getComposeUrl($moduleName = false, $record = false, $view = false, $type = false): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url .= '&crmModule=' . $moduleName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (('Users' === $moduleName && $record === \App\User::getCurrentUserRealId()) || ('Users' !== $moduleName && !empty($record) && \App\Record::isExists($record) && \App\Privilege::isPermitted($moduleName, 'DetailView', $record))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($content) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fromEmailDetails) {
- 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 mixed $type
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Line exceeds 120 characters; contains 186 characters Open
if (!\in_array($moduleName, array_keys(array_merge(\App\ModuleHierarchy::getModulesByLevel(0), \App\ModuleHierarchy::getModulesByLevel(3)))) || 'Campaigns' === $moduleName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['body'] = $textParser->setContent($templateModel->get('content'))->parse()->getContent();
- 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
$eventHandler->trigger('MailComposeParamAfter');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['type'] = $type;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$request->isEmpty('subject')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $settingsLinks;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* URL generation for internal mail clients.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel_OSSMailView = OSSMailView_Record_Model::getCleanInstance('OSSMailView');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$emailParser->emailoptout = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['title'] = $recordModel->getName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePath = \App\Config::main('tmp_dir');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== file_put_contents($filePath, $recordModel->getICal())) {
- 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['crmrecord'] = $record;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleConfig = App\Config::module($moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- 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_Loader::includeOnce('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url .= '&crmView=' . $view;
- 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 $url;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $request->getByType('type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($return[$name])) {
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
if (($templateId = $request->getInteger('template', 0)) && \App\Record::isExists($templateId, 'EmailTemplates')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = $request->getArray('templateParams', \App\Purifier::TEXT, [], App\Purifier::ALNUM);
- 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['to'] = $request->get('to');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['subject'] = $request->get('subject');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::$composeParam;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getDefaultMailAccount($accounts)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (isset($_SESSION['AutoLoginUser']) && \array_key_exists($_SESSION['AutoLoginUser'], $accounts)) ? $accounts[$_SESSION['AutoLoginUser']] : reset($accounts);
- 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['filePath'] = [['path' => $filePath, 'name' => $fileName]];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['conf_type' => 'email_list'])->createCommand()->queryAllByGroup(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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$settingsLinks = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$settingsLinks[] = [
- 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 $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($moduleName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($record) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subject .= $recordModel->getName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordNumber = $recordModel->getRecordNumber();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($params as $key => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($moduleName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['bcc'] = implode(',', $request->get('emails'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $composeParam = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkurl' => 'index.php?module=OSSMail&parent=Settings&view=Index&block=' . $menu->get('blockid') . '&fieldid=' . $menu->get('fieldid'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkicon' => 'adminIcon-mail-download-history',
- 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
$moduleName = $request->getByType('crmModule');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$record = $request->getInteger('crmRecord');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$eventHandler = new App\EventHandler();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$emailParser = \App\EmailParser::getInstanceByModel($recordModel);
- 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['recordNumber'] = $recordNumber;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Calendar' === $moduleName && $request->getBoolean('ics')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return = $eventHandler->getParams();
- 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 ($moduleConfig && isset($moduleConfig['SEND_IDENTITY'][$currentUser->get('roleid')])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$request->isEmpty('to')) {
- 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
$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
if ('new' === $type || 'Campaigns' === $moduleName) {
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
if ('Calendar' === $moduleName && !$recordModel->isEmpty('meeting_url') && !\array_key_exists('meetingUrl', $params) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tmpFileName = tempnam($filePath, 'ics');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$composeParam = $config;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $view
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $type
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url .= '&crmRecord=' . $record;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subject = "[$recordNumber] $subject";
- 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
$templateModel = \Vtiger_Record_Model::getInstanceById($templateId, 'EmailTemplates');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($record)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentUser = Users_Record_Model::getCurrentUserModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['from'] = $moduleConfig['SEND_IDENTITY'][$currentUser->get('roleid')];
- 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 (!$request->isEmpty('bcc')) {
- 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
if ('Calendar' === $moduleName && !$recordModel->isEmpty('meeting_url') && !\array_key_exists('meetingUrl', $params) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($view) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 238 characters Open
if (('Users' === $moduleName && $record === \App\User::getCurrentUserRealId()) || ('Users' !== $moduleName && !empty($record) && \App\Record::isExists($record) && \App\Privilege::isPermitted($moduleName, 'DetailView', $record))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$eventHandler->trigger('MailComposeParamBefore');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subject = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (($templateId = $request->getInteger('template', 0)) && \App\Record::isExists($templateId, 'EmailTemplates')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['subject'] = $subject;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['crmview'] = $request->getByType('crmView');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($moduleName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$textParser->setParam('meetingUrl', $recordModel->get('meeting_url'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subject = $textParser->setContent($templateModel->get('subject'))->parse()->getContent();
- 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 (!$request->isEmpty('pdf_path')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['filePath'] = $request->get('pdf_path');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$request->isEmpty('cc')) {
- 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
$recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($request->isEmpty('to') && ($email = $recordModel_OSSMailView->findEmail($record, $moduleName))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return[substr($name, -2)] = $fromEmailDetails;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$textParser->setParam($key, $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileName = \App\Fields\File::sanitizeUploadFileName($recordModel->getName()) . '.ics';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['mailId'] = (int) $request->getInteger('mid');
- 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 getComposeParameters()
- 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 ($moduleName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $srecord
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = Vtiger_Record_Model::getInstanceById($srecord);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url .= '&type=' . $type;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (['_to', '_cc'] as $name) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fromEmailDetails = $emailParser->setContent($content)->parse()->getContent();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['html'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$eventHandler->setParams($return);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['crmmodule'] = $moduleName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $record
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$request->set('crmRecord', $record);
- 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 ($fieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url .= '&cc=' . $cc;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$purifier = new HTMLPurifier($config);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content .= \App\Language::translate('Date', 'OSSMailView') . ': ' . $date . PHP_EOL;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($line)) {
- 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 function getModalRecordsListSourceFields(App\QueryGenerator $queryGenerator, Vtiger_Module_Model $baseModule, $popupFields)
- 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
$url = 'mailto:';
- 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
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $smoduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$to = $record->get('to_email');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('replyAll' == $type && !empty($cc)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content .= \App\Language::translate('LBL_MAIL_FORWARD_INTRO', 'OSSMailView') . PHP_EOL;
- 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
$body = $record->get('content');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($srecord) && !empty($smoduleName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url .= '?subject=' . $subject;
- 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
$line = '> ' . $line . PHP_EOL;
- 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
$popupFields[$item->getName()] = $item->getName();
- 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($param['subject'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$from = $record['fromRaw'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\strlen($url . '&body=' . rawurlencode($content . $line)) > $mailtoLimit) {
- 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
$url .= '?';
- 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
$to = $record['toRaw'];
- 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 ('forward' == $type) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (explode(PHP_EOL, $body) as $line) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $url . '&body=' . rawurlencode($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
$url .= 'body=' . \App\Purifier::encodeHtml($param['body']) . '&';
- 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_object($record)) {
- 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
$subject = 'Fwd: ' . $subject;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$line = trim($line);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\strlen($url . '&body=' . rawurlencode($content . $line)) > $mailtoLimit) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content .= $line;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$request->set('crmModule', $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($param['body'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $url;
- 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
$subject = $record->get('subject');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\in_array($smoduleName, array_keys(array_merge(\App\ModuleHierarchy::getModulesByLevel(0), \App\ModuleHierarchy::getModulesByLevel(3))))) {
- Exclude checks
Line exceeds 120 characters; contains 212 characters Open
$body = str_replace(['<p> </p>', '<p></p>', '</p>', '<br />', '<p>', '<div>', '</div>', PHP_EOL . PHP_EOL, PHP_EOL . PHP_EOL], ['', '', PHP_EOL, PHP_EOL, '', '', PHP_EOL, PHP_EOL, PHP_EOL], nl2br($body));
- 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 .= $line;
- 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($param['to'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subject = $record['subjectRaw'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleModel = $recordModel->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = 'mailto:';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$config = HTMLPurifier_Config::createDefault();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$body = str_replace(['<p> </p>', '<p></p>', '</p>', '<br />', '<p>', '<div>', '</div>', PHP_EOL . PHP_EOL, PHP_EOL . PHP_EOL], ['', '', PHP_EOL, PHP_EOL, '', '', PHP_EOL, PHP_EOL, PHP_EOL], nl2br($body));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (explode(PHP_EOL, $body) as $line) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($type) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getComposeParam(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return = $eventHandler->getParams();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($return[$name]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\in_array($moduleName, array_keys(array_merge(\App\ModuleHierarchy::getModulesByLevel(0), \App\ModuleHierarchy::getModulesByLevel(3)))) || 'Campaigns' === $moduleName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$request->isEmpty('crmView')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return['cc'] = $request->get('cc');
- 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 (!self::$composeParam) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$config['popup'] = '_blank' == $config['target'] ? true : false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* URL generation for external mail clients.
- 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
$request = new App\Request([]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($view) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get mail url for widget.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$from = $record->get('from_email');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$config->set('Core.Encoding', \App\Config::main('default_charset'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$config->set('HTML.AllowedElements', 'div,p,br');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$body = $purifier->purify($body);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$mailtoLimit = \App\Config::component('Mail', 'MAILTO_LIMIT');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('forward' == $type) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content .= \App\Language::translate('Subject', 'OSSMailView') . ': ' . $subject . PHP_EOL;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content .= \App\Language::translateArgs('LBL_MAIL_REPLY_INTRO', 'OSSMailView', $date, $from) . PHP_EOL;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$eventHandler->setRecordModel($recordModel)->setModuleName($moduleName)->setParams($return);
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
public function getModalRecordsListSourceFields(App\QueryGenerator $queryGenerator, Vtiger_Module_Model $baseModule, $popupFields)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content = $request->has($name) ? $request->getRaw($name) : ($return[$name] ?? '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePath .= basename($tmpFileName);
- 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['bcc'] = $request->get('bcc');
- 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 get compose parameters.
- 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
* @param int $record
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subject = 'Re: ' . $subject;
- 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
include_once 'vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($record) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param = self::getComposeParam($request);
- 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
$cc = $record->get('cc_email');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cc = $record['ccRaw'];
- Exclude checks
Line exceeds 120 characters; contains 156 characters Open
if (!\in_array($smoduleName, array_keys(array_merge(\App\ModuleHierarchy::getModulesByLevel(0), \App\ModuleHierarchy::getModulesByLevel(3))))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subject = "[$fieldName] $subject";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$config->set('CSS.AllowTricky', false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$line = '> ' . $line . PHP_EOL;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$request->set('crmView', $view);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url .= $value . '=' . str_replace(',', ';', $param[$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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$config->set('Cache.SerializerPath', ROOT_DIRECTORY . '/cache/vtlib');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($line)) {
- 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
$request->set('type', $type);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url .= str_replace(',', ';', $param['to']);
- 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
$fieldName = $moduleModel->getSequenceNumberFieldName();
- 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
$config->set('HTML.AllowedAttributes', '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $popupFields;
- 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 = $record->get('date');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = 'mailto:' . $from;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content .= \App\Language::translate('From', 'OSSMailView') . ': ' . $from . PHP_EOL;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$content .= \App\Language::translate('To', 'OSSMailView') . ': ' . $to . PHP_EOL;
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($baseModule->getFieldsByType('email') as $item) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($type) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (['cc', 'bcc'] as $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($param[$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
$url .= 'subject=' . \App\Purifier::encodeHtml($param['subject']) . '&';
- 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
$body = $record['bodyRaw'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$date = $record['date'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$line = trim($line);
- 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
Class name "OSSMail_Module_Model" is not in camel caps format Open
class OSSMail_Module_Model extends Vtiger_Module_Model
- Exclude checks
The variable $recordModel_OSSMailView is not named in camelCase. Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
- 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 $recordModel_OSSMailView is not named in camelCase. Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
- 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();
}
}