Missing class import via use statement (line '47', column '24'). Open
$commentField = new Vtiger_Field_Model();
- 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 'Vtiger_AdvancedFilter_Helper' in method 'getAdvancedFilterOpsByFieldType'. Open
return Vtiger_AdvancedFilter_Helper::getAdvancedFilterOpsByFieldType();
- 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_AdvancedFilter_Helper' in method 'getAdvancedFilterOptions'. Open
return Vtiger_AdvancedFilter_Helper::getAdvancedFilterOptions();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Saw unextractable annotation for comment '* @return <array>'</array>
Open
* @return <Array>
- Exclude checks
Saw unextractable annotation for comment '* @return <array>'</array>
Open
* @return <Array>
- Exclude checks
Saw unextractable annotation for comment '* @return <array> list of Field models <vtiger_field_model>'</vtiger_field_model></array>
Open
* @return <Array> list of Field models <Vtiger_Field_Model>
- Exclude checks
Avoid excessively long variable names like $commentFieldModelsList. Keep variable name length under 20. Open
$commentFieldModelsList = [];
- 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 Settings_Workflows_Field_Model extends Vtiger_Field_Model
- Exclude checks
The class Settings_Workflows_Field_Model is not named in CamelCase. Open
class Settings_Workflows_Field_Model extends Vtiger_Field_Model
{
/**
* Function to get all the supported advanced filter operations.
*
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get all the supported advanced filter operations.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getAdvancedFilterOptions()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return Vtiger_AdvancedFilter_Helper::getAdvancedFilterOptions();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <Array>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the advanced filter option names by Field 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
}
- Exclude checks
Spaces must 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 getCommentFieldsListForTasks($moduleModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$commentsFieldsInfo = ['$(record : Comments 1)$' => 'Last Comment', 'last5Comments' => '$(record : Comments 5)$', 'allComments' => '$(record : Comments)$'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$commentField = new Vtiger_Field_Model();
- Exclude checks
Spaces must 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 Vtiger_Module_Model $moduleModel
- Exclude checks
Line exceeds 120 characters; contains 164 characters Open
$commentsFieldsInfo = ['$(record : Comments 1)$' => 'Last Comment', 'last5Comments' => '$(record : Comments 5)$', 'allComments' => '$(record : Comments)$'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$commentField->set('label', $fieldLabel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $commentFieldModelsList;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getAdvancedFilterOpsByFieldType()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get comment fields list which are useful in tasks.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$commentField->setModule($moduleModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$commentField->set('name', $fieldName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return Vtiger_AdvancedFilter_Helper::getAdvancedFilterOpsByFieldType();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$commentFieldModelsList = [];
- 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
foreach ($commentsFieldsInfo as $fieldName => $fieldLabel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <Array> list of Field models <Vtiger_Field_Model>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$commentFieldModelsList[$fieldName] = $commentField;
- Exclude checks
Class name "Settings_Workflows_Field_Model" is not in camel caps format Open
class Settings_Workflows_Field_Model extends Vtiger_Field_Model
- Exclude checks