Redundant access to an object (RedundantAccessToObject)¶
Type | Scope | Severity | Activated by default |
Minutes to fix |
Tags |
---|---|---|---|---|---|
Code smell |
BSL |
Info |
Yes |
1 |
standard clumsy |
Parameters¶
Name | Type | Description | Default value |
---|---|---|---|
checkObjectModule |
Boolean |
Check object modules |
true |
checkFormModule |
Boolean |
Check form modules |
true |
checkRecordSetModule |
Boolean |
Check record set modules |
true |
Description¶
In the forms and modules of objects, it is wrong to refer to the attributes through the property ThisObject. In common modules, it is redundant to refer to methods through their name, except for modules with Cashed.
Examples¶
In the ObjectModule of the Document with the attribute Countractor
, it is wrong to use
ThisObject.Contractor = GetContractor();
correctly use the props directly
Contractor = GetContractor();
In the common module Commons
, the following method call will be incorrect
Commons.SendMessage("en = 'Hi!'");
correct
SendMessage("en = 'Hi!'");
Snippets¶
Diagnostic ignorance in code¶
// BSLLS:RedundantAccessToObject-off
// BSLLS:RedundantAccessToObject-on
Parameter for config¶
"RedundantAccessToObject": {
"checkObjectModule": true,
"checkFormModule": true,
"checkRecordSetModule": true
}