Missed a required method parameter (MissedRequiredParameter)¶
| Type | Scope | Severity | Activated by default |
Minutes to fix |
Tags |
|---|---|---|---|---|---|
Error |
BSLOS |
Major |
Yes |
1 |
error |
Description¶
Required parameters must not be omitted when calling methods, otherwise the value Undefined will be passed to the parameter, which the method often cannot process.
If the value Undefined is valid, then you need to
- explicitly pass a value
- or make the parameter optional with a default value of Undefined.
Examples¶
For example
Procedure ChangeFormFieldColor(Form, FiledName, Color)
Incorrect:
ChangeFormFieldColor(,"Result", StyleColors.ArthursShirtColor); // missing first parameter Form
ChangeFormFieldColor(,,); // missing all required parameters
Correct:
ChangeFormFieldColor(ThisObject, "Result", Color); // all required parameters are specified
Sources¶
Parameters of procedures and functions (RU)
Snippets¶
Diagnostic ignorance in code¶
// BSLLS:MissedRequiredParameter-off
// BSLLS:MissedRequiredParameter-on
Parameter for config¶
"MissedRequiredParameter": false