Skip to content

Code out of region (CodeOutOfRegion)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Code smell BSL Info Yes 1 standard

Parameters

Name Type Description Default value
checkUnknownModuleType Boolean Check unknown module type false

Description

The code of module should be structured and divided into regions.
The requirement to structure code by regions is to improve code readability and maintainability and development by group of authors (developers) and in finalizing application solutions on specific implementations.

Examples

#Region <RegionName>

The standard describes only 10 region names, the names of nested regions are not checked.

Correct:

#Region Private
#Region Print
// Methods code
#EndRegion
#Region Other
// Methods code
#EndRegion
#EndRegion

Name matching table (full in source code):

RU EN
ПрограммныйИнтерфейс Public
СлужебныйПрограммныйИнтерфейс Internal
СлужебныеПроцедурыИФункции Private
ОбработчикиСобытий EventHandlers
ОбработчикиСобытийФормы FormEventHandlers
ОбработчикиСобытийЭлементовШапкиФормы FormHeaderItemsEventHandlers
ОбработчикиКомандФормы FormCommandsEventHandlers
ОписаниеПеременных Variables
Инициализация Initialize
ОбработчикиСобытийЭлементовТаблицыФормы FormTableItemsEventHandlers

Sources

Snippets

Diagnostic ignorance in code

// BSLLS:CodeOutOfRegion-off
// BSLLS:CodeOutOfRegion-on

Parameter for config

"CodeOutOfRegion": {
    "checkUnknownModuleType": false
}