Reserved parameter names (ReservedParameterNames)¶
Type | Scope | Severity | Activated by default |
Minutes to fix |
Tags |
---|---|---|---|---|---|
Code smell |
BSL OS |
Major |
Yes |
5 |
standard badpractice |
Parameters¶
Name | Type | Description | Default value |
---|---|---|---|
reservedWords |
String |
Regular expression for reserved parameter names. |
`` |
Description¶
If a parameter name matches one of a system enumeration's name, then all values of that enumeration will not be available in the local context. Module code's syntax checking will not detect an error. To prevent this situation, a parameter name should not match all names of system enumerations.
Parameter names should not contain reserved words such as system enumerations. The list of reserved words is set by a regular expression. The search is case-insensitive.
For example:
"FormGroupType|FormFieldType"
Sources¶
- Source: Standard: Procedure and Function Parameters (RU)
- Source: Standard: Rules for generating variable names (RU)
Snippets¶
Diagnostic ignorance in code¶
// BSLLS:ReservedParameterNames-off
// BSLLS:ReservedParameterNames-on
Parameter for config¶
"ReservedParameterNames": {
"reservedWords": ""
}