The class LettersIn has 18 fields. Consider redesigning LettersIn to keep the number of fields under 15. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Function moduleHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function moduleHandler($moduleName, $eventType)
{
if ('module.postinstall' === $eventType) {
$modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid using static access to class 'vtlib\Module' in method 'moduleHandler'. Open
$modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
- 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 'ModComments' in method 'moduleHandler'. Open
ModComments::addWidgetTo(['LettersIn']);
- 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\Module' in method 'moduleHandler'. Open
CRMEntity::getInstance('ModTracker')->enableTrackingForModule(\App\Module::getModuleId($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
Define a constant instead of duplicating this literal "tablename" 6 times. Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'title'])->execute();
- 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 "vtiger_field" 6 times. Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'title'])->execute();
- 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 "vtiger_lettersin" 9 times. Open
public $table_name = 'vtiger_lettersin';
- 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 "title" 7 times. Open
'Title' => 'title',
- 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 "summaryfield" 6 times. Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'title'])->execute();
- 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 "vtiger_lettersincf" 3 times. Open
public $customFieldTable = ['vtiger_lettersincf', 'lettersinid'];
- 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 "columnname" 6 times. Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'title'])->execute();
- 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 "createdtime" 3 times. Open
'Created Time' => 'createdtime',
- 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 "lettersinid" 4 times. Open
public $table_index = 'lettersinid';
- 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.
Argument 1 (moduleNames)
is array{0:'LettersIn'}
but \ModComments::addWidgetTo()
takes string
defined at /code/modules/ModComments/ModComments.php:72
Open
ModComments::addWidgetTo(['LettersIn']);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Call to undeclared method \CRMEntity::enableTrackingForModule
Open
CRMEntity::getInstance('ModTracker')->enableTrackingForModule(\App\Module::getModuleId($moduleName));
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
/**
* LettersIn CRMEntity class.
*
- 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 605.
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 $def_detailview_recname. Keep variable name length under 20. Open
public $def_detailview_recname = 'title';
- 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
Avoid excessively long variable names like $modcommentsModuleInstance. Keep variable name length under 20. Open
$modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
- 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 LettersIn extends CRMEntity
- Exclude checks
The property $def_basicsearch_col is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $table_name is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $search_fields_name is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $def_detailview_recname is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $tab_name_index is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $table_index is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $popup_fields is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $search_fields is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $tab_name is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $mandatory_fields is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $list_fields_name is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $default_sort_order is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $default_order_by is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $column_fields is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $special_functions is not named in camelCase. Open
class LettersIn extends CRMEntity
{
public $table_name = 'vtiger_lettersin';
public $table_index = 'lettersinid';
public $column_fields = [];
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_lettersin' => 'lettersinid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $def_basicsearch_col = 'title';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** Indicator if this is a custom module or standard module */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Format: Field Label => fieldname
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Created Time' => 'createdtime',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $table_index = 'lettersinid';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $customFieldTable = ['vtiger_lettersincf', 'lettersinid'];
- Exclude checks
Spaces must 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 $tab_name = ['vtiger_crmentity', 'vtiger_lettersin', 'vtiger_lettersincf'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Mandatory for Saving, Include tablename and tablekey columnname here.
- Exclude checks
Spaces must 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 $search_fields_name = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Column value to use on detail view record text display
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $table_name = 'vtiger_lettersin';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $column_fields = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Mandatory for Saving, Include tables related to this module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_lettersincf' => 'lettersinid', ];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var string[] List of fields in the RelationListView
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// For Alphabetical search
- Exclude checks
Spaces must 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
'Title' => 'title',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// For Popup listview and UI type support
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $relationFields = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $def_detailview_recname = 'title';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $search_fields = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $default_sort_order = 'ASC';
- Exclude checks
Spaces must 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_crmentity' => 'crmid',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $list_fields_name = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Number' => ['lettersin', 'number'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $tab_name_index = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Callback function list during Importing
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Assigned To' => 'assigned_user_id',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $default_order_by = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Title' => ['lettersin', 'title'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// For Popup window record selection
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $popup_fields = ['title'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $IsCustomModule = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Mandatory table for supporting custom fields.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Number' => 'number',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Assigned To' => ['crmentity', 'smownerid'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Created Time' => ['crmentity', 'createdtime'],
- Exclude checks
Spaces must 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 $special_functions = ['set_import_assigned_user'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
- Exclude checks
Spaces must 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
$dbCommand->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'lin_type_doc'])->execute();
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'relatedid'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName Module name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (class_exists('ModComments')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
include_once 'modules/ModComments/ModComments.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Used when enabling/disabling the mandatory fields for the module.
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'lin_type_ship'])->execute();
- Exclude checks
Spaces must 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
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'smownerid'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $eventType Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'title'])->execute();
- Exclude checks
Spaces must 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
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'lin_type_doc'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('module.postinstall' === $eventType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'lin_type_ship'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
CRMEntity::getInstance('ModTracker')->enableTrackingForModule(\App\Module::getModuleId($moduleName));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ModComments::addWidgetTo(['LettersIn']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'smownerid'])->execute();
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'date_adoption'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Refers to vtiger_field.fieldname values.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $mandatory_fields = ['createdtime', 'modifiedtime', 'title', 'assigned_user_id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function moduleHandler($moduleName, $eventType)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'title'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'date_adoption'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Invoked when special actions are performed on the module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('vtiger_field', ['summaryfield' => 1], ['tablename' => 'vtiger_lettersin', 'columnname' => 'relatedid'])->execute();
- Exclude checks