Diagnostics¶
Used for code analysis to meet coding standards and search for possible errors.
Some of diagnostics are disabled by default. Use configuration file to enable them.
To escape individual sections of code or files from triggering diagnostics, you can use special comments of the form // BSLLS:DiagnosticKey-off . This functionality is described in more detail in Escaping sections of code .
Implemented diagnostics¶
Total: 175
- Security Hotspot: 7
- Vulnerability: 8
- Error: 55
- Code smell: 105
| Key | Name | Enabled by default | Severity | Type | Tags |
|---|---|---|---|---|---|
| AllFunctionPathMustHaveReturn | All execution paths of a function must have a Return statement | Yes | Major | Code smell | unpredictablebadpracticesuspicious |
| AssignAliasFieldsInQuery | Assigning aliases to selected fields in a query | Yes | Major | Code smell | standardsqlbadpractice |
| BadWords | Prohibited words | No | Major | Code smell | design |
| BeginTransactionBeforeTryCatch | Violating transaction rules for the 'BeginTransaction' method | Yes | Major | Error | standard |
| CachedPublic | Cached public methods | Yes | Major | Code smell | standarddesign |
| CanonicalSpellingKeywords | Canonical keyword writing | Yes | Info | Code smell | standard |
| CodeAfterAsyncCall | Lines of code after the asynchronous method call | No | Major | Code smell | suspicious |
| CodeBlockBeforeSub | Method definitions must be placed before the module body operators | Yes | Blocker | Error | error |
| CodeOutOfRegion | Code out of region | Yes | Info | Code smell | standard |
| CognitiveComplexity | Cognitive complexity | Yes | Critical | Code smell | brainoverload |
| CommandModuleExportMethods | Export methods in command and general command modules | Yes | Info | Code smell | standardclumsy |
| CommentedCode | Commented out code | Yes | Minor | Code smell | standardbadpractice |
| CommitTransactionOutsideTryCatch | Violating transaction rules for the 'CommitTransaction' method | Yes | Major | Error | standard |
| CommonModuleAssign | CommonModuleAssign | Yes | Blocker | Error | error |
| CommonModuleInvalidType | Common module invalid type | Yes | Major | Error | standardunpredictabledesign |
| CommonModuleMissingAPI | Common module should have a programming interface | Yes | Minor | Code smell | brainoverloadsuspicious |
| CommonModuleNameCached | Missed postfix "Cached" | Yes | Major | Code smell | standardbadpracticeunpredictable |
| CommonModuleNameClient | Missed postfix "Client" | Yes | Minor | Code smell | standardbadpracticeunpredictable |
| CommonModuleNameClientServer | Missed postfix "ClientServer" | Yes | Major | Code smell | standardbadpracticeunpredictable |
| CommonModuleNameFullAccess | Missed postfix "FullAccess" | Yes | Major | Security Hotspot | standardbadpracticeunpredictable |
| CommonModuleNameGlobal | Missed postfix "Global" | Yes | Major | Code smell | standardbadpracticebrainoverload |
| CommonModuleNameGlobalClient | Global module with postfix "Client" | Yes | Major | Code smell | standard |
| CommonModuleNameServerCall | Missed postfix "ServerCall" | Yes | Minor | Code smell | standardbadpracticeunpredictable |
| CommonModuleNameWords | Unrecommended common module name | Yes | Info | Code smell | standard |
| CompilationDirectiveLost | Methods compilation directive | Yes | Major | Code smell | standardunpredictable |
| CompilationDirectiveNeedLess | Needless compilation directive | Yes | Major | Code smell | clumsystandardunpredictable |
| ConsecutiveEmptyLines | Consecutive empty lines | Yes | Info | Code smell | badpractice |
| CrazyMultilineString | Crazy multiline literals | Yes | Major | Code smell | badpracticesuspiciousunpredictable |
| CreateQueryInCycle | Execution query on cycle | Yes | Critical | Error | performance |
| CyclomaticComplexity | Cyclomatic complexity | Yes | Critical | Code smell | brainoverload |
| DataExchangeLoading | There is no check for the attribute DataExchange.Load in the object's event handler | Yes | Critical | Error | standardbadpracticeunpredictable |
| DeletingCollectionItem | Deleting an item when iterating through collection using the operator "For each ... In ... Do" | Yes | Major | Error | standarderror |
| DenyIncompleteValues | Deny incomplete values for dimensions | No | Major | Code smell | badpractice |
| DeprecatedAttributes8312 | Deprecated 8.3.12 platform features. | Yes | Info | Code smell | deprecated |
| DeprecatedCurrentDate | Using of the deprecated method "CurrentDate" | Yes | Major | Error | standarddeprecatedunpredictable |
| DeprecatedFind | Using of the deprecated method "Find" | Yes | Minor | Code smell | deprecated |
| DeprecatedMessage | Restriction on the use of deprecated "Message" method | Yes | Minor | Code smell | standarddeprecated |
| DeprecatedMethodCall | Deprecated methods should not be used | Yes | Minor | Code smell | deprecateddesign |
| DeprecatedMethods8310 | Deprecated client application method. | Yes | Info | Code smell | deprecated |
| DeprecatedMethods8317 | Using of deprecated platform 8.3.17 global methods | Yes | Info | Code smell | deprecated |
| DeprecatedTypeManagedForm | Deprecated ManagedForm type | Yes | Info | Code smell | standarddeprecated |
| DisableSafeMode | Disable safe mode | Yes | Major | Vulnerability | suspicious |
| DoubleNegatives | Double negatives | Yes | Major | Code smell | brainoverloadbadpractice |
| DuplicateRegion | Duplicate regions | Yes | Info | Code smell | standard |
| DuplicateStringLiteral | Duplicate string literal | Yes | Minor | Code smell | badpractice |
| DuplicatedInsertionIntoCollection | Duplicate adding or pasting a value to a collection | Yes | Major | Code smell | brainoverloadsuspiciousbadpractice |
| EmptyCodeBlock | Empty code block | Yes | Major | Code smell | badpracticesuspicious |
| EmptyRegion | The region should not be empty | Yes | Info | Code smell | standard |
| EmptyStatement | Empty statement | Yes | Info | Code smell | badpractice |
| ExcessiveAutoTestCheck | Excessive AutoTest Check | Yes | Minor | Code smell | standarddeprecated |
| ExecuteExternalCode | Executing of external code on the server | Yes | Critical | Vulnerability | errorstandard |
| ExecuteExternalCodeInCommonModule | Executing of external code in a common module on the server | Yes | Critical | Security Hotspot | badpracticestandard |
| ExportVariables | Ban export global module variables | Yes | Major | Code smell | standarddesignunpredictable |
| ExternalAppStarting | External applications starting | Yes | Major | Vulnerability | suspicious |
| ExtraCommas | Commas without a parameter at the end of a method call | Yes | Major | Code smell | standardbadpractice |
| FieldsFromJoinsWithoutIsNull | No NULL checks for fields from joined tables | No | Critical | Error | sqlsuspiciousunpredictable |
| FileSystemAccess | File system access | No | Major | Vulnerability | suspicious |
| ForbiddenMetadataName | Metadata object has a forbidden name | Yes | Blocker | Error | standardsqldesign |
| FormDataToValue | FormDataToValue method call | Yes | Info | Code smell | badpractice |
| FullOuterJoinQuery | Using of "FULL OUTER JOIN" in queries | Yes | Major | Code smell | sqlstandardperformance |
| FunctionNameStartsWithGet | Function name shouldn't start with "Получить" | No | Info | Code smell | standard |
| FunctionOutParameter | Out function parameter | No | Major | Code smell | design |
| FunctionReturnsSamePrimitive | The function always returns the same primitive value | Yes | Major | Error | designbadpractice |
| FunctionShouldHaveReturn | The function should have return | Yes | Major | Error | suspiciousunpredictable |
| GetFormMethod | GetForm method call | Yes | Major | Error | error |
| GlobalContextMethodCollision8312 | Global context method names collision | Yes | Blocker | Error | errorunpredictable |
| IdenticalExpressions | There are identical sub-expressions to the left and to the right of the "foo" operator | Yes | Major | Error | suspicious |
| IfConditionComplexity | Usage of complex expressions in the "If" condition | Yes | Minor | Code smell | brainoverload |
| IfElseDuplicatedCodeBlock | Duplicated code blocks in If...Then...ElseIf... statements | Yes | Minor | Code smell | suspicious |
| IfElseDuplicatedCondition | Duplicated conditions in If...Then...ElseIf... statements | Yes | Major | Code smell | suspicious |
| IfElseIfEndsWithElse | Else...The...ElseIf... statement should end with Else branch | Yes | Major | Code smell | badpractice |
| IncorrectLineBreak | Incorrect expression line break | Yes | Info | Code smell | standardbadpractice |
| IncorrectUseLikeInQuery | Incorrect use of 'LIKE' | Yes | Major | Error | standardsqlunpredictable |
| IncorrectUseOfStrTemplate | Incorrect use of "StrTemplate" | Yes | Blocker | Error | brainoverloadsuspiciousunpredictable |
| InternetAccess | Referring to Internet resources | No | Major | Vulnerability | suspicious |
| InvalidCharacterInFile | Invalid character | Yes | Major | Error | errorstandardunpredictable |
| IsInRoleMethod | IsInRole global method call | Yes | Major | Code smell | error |
| JoinWithSubQuery | Join with sub queries | Yes | Major | Code smell | sqlstandardperformance |
| JoinWithVirtualTable | Join with virtual table | Yes | Major | Code smell | sqlstandardperformance |
| LatinAndCyrillicSymbolInWord | Mixing Latin and Cyrillic characters in one identifier | Yes | Minor | Code smell | brainoverloadsuspicious |
| LineLength | Line Length limit | Yes | Minor | Code smell | standardbadpractice |
| LogicalOrInTheWhereSectionOfQuery | Using a logical "OR" in the "WHERE" section of a query | Yes | Major | Code smell | sqlperformancestandard |
| MagicDate | Magic dates | Yes | Minor | Code smell | badpracticebrainoverload |
| MagicNumber | Magic numbers | Yes | Minor | Code smell | badpractice |
| MetadataObjectNameLength | Metadata object names must not exceed the allowed length | Yes | Major | Error | standard |
| MethodSize | Method size | Yes | Major | Code smell | badpractice |
| MissedRequiredParameter | Missed a required method parameter | Yes | Major | Error | error |
| MissingCodeTryCatchEx | Missing code in Raise block in "Try ... Raise ... EndTry" | Yes | Major | Error | standardbadpractice |
| MissingCommonModuleMethod | Referencing a missing common module method | Yes | Blocker | Error | error |
| MissingEventSubscriptionHandler | Event subscription handler missing | Yes | Blocker | Error | error |
| MissingParameterDescription | Method parameters description are missing | Yes | Major | Code smell | standardbadpractice |
| MissingReturnedValueDescription | Function returned values description is missing | Yes | Major | Code smell | standardbadpractice |
| MissingSpace | Missing spaces to the left or right of operators + - * / = % < > <> <= >=, keywords, and also to the right of , and ; | Yes | Info | Code smell | badpractice |
| MissingTempStorageDeletion | Missing temporary storage data deletion after using | No | Critical | Code smell | standardperformancebadpractice |
| MissingTemporaryFileDeletion | Missing temporary file deletion after using | Yes | Major | Error | badpracticestandard |
| MissingVariablesDescription | All variables declarations must have a description | Yes | Minor | Code smell | standard |
| MultilineStringInQuery | Multi-line literal in query | Yes | Critical | Error | badpracticesuspiciousunpredictable |
| MultilingualStringHasAllDeclaredLanguages | There is a localized text for all languages declared in the configuration | Yes | Minor | Error | errorlocalize |
| MultilingualStringUsingWithTemplate | Partially localized text is used in the StrTemplate function | Yes | Major | Error | errorlocalize |
| NestedConstructorsInStructureDeclaration | Nested constructors with parameters in structure declaration | Yes | Minor | Code smell | badpracticebrainoverload |
| NestedFunctionInParameters | Initialization of method and constructor parameters by calling nested methods | Yes | Minor | Code smell | standardbrainoverloadbadpractice |
| NestedStatements | Control flow statements should not be nested too deep | Yes | Critical | Code smell | badpracticebrainoverload |
| NestedTernaryOperator | Nested ternary operator | Yes | Major | Code smell | brainoverload |
| NonExportMethodsInApiRegion | Non export methods in API regions | Yes | Major | Code smell | standard |
| NonStandardRegion | Non-standard region of module | Yes | Info | Code smell | standard |
| NumberOfOptionalParams | Limit number of optional parameters in method | Yes | Minor | Code smell | standardbrainoverload |
| NumberOfParams | Number of parameters in method | Yes | Minor | Code smell | standardbrainoverload |
| NumberOfValuesInStructureConstructor | Limit on the number of property values passed to the structure constructor | Yes | Minor | Code smell | standardbrainoverload |
| OSUsersMethod | Using method OSUsers | Yes | Critical | Security Hotspot | suspicious |
| OneStatementPerLine | One statement per line | Yes | Minor | Code smell | standarddesign |
| OrderOfParams | Order of Parameters in method | Yes | Major | Code smell | standarddesign |
| OrdinaryAppSupport | Ordinary application support | Yes | Major | Code smell | standardunpredictable |
| PairingBrokenTransaction | Violation of pairing using methods "BeginTransaction()" & "CommitTransaction()" / "RollbackTransaction()" | Yes | Major | Error | standard |
| ParseError | Source code parse error | Yes | Critical | Error | error |
| PrivilegedModuleMethodCall | Accessing privileged module methods | Yes | Major | Security Hotspot | suspicious |
| ProcedureReturnsValue | Procedure should not return Value | Yes | Blocker | Error | error |
| ProtectedModule | Protected modules | Yes | Major | Code smell | badpracticesuspicious |
| PublicMethodsDescription | All public methods must have a description | Yes | Info | Code smell | standardbrainoverloadbadpractice |
| QueryParseError | Query text parsing error | Yes | Major | Code smell | standardsqlbadpractice |
| QueryToMissingMetadata | Using non-existent metadata in the query | Yes | Blocker | Error | suspicioussql |
| RedundantAccessToObject | Redundant access to an object | Yes | Info | Code smell | standardclumsy |
| RefOveruse | Overuse "Reference" in a query | Yes | Major | Code smell | sqlperformance |
| ReservedParameterNames | Reserved parameter names | Yes | Major | Code smell | standardbadpractice |
| RewriteMethodParameter | Rewrite method parameter | Yes | Major | Code smell | suspicious |
| SameMetadataObjectAndChildNames | Same metadata object and child name | Yes | Critical | Error | standardsqldesign |
| ScheduledJobHandler | Scheduled job handler | Yes | Critical | Error | error |
| SelectTopWithoutOrderBy | Using 'SELECT TOP' without 'ORDER BY' | Yes | Major | Code smell | standardsqlsuspicious |
| SelfAssign | Variable is assigned to itself | Yes | Major | Error | suspicious |
| SelfInsertion | Insert a collection into itself | Yes | Major | Error | standardunpredictableperformance |
| SemicolonPresence | Statement should end with semicolon symbol ";" | Yes | Minor | Code smell | standardbadpractice |
| ServerSideExportFormMethod | Server-side export form method | Yes | Blocker | Error | errorunpredictablesuspicious |
| SetPermissionsForNewObjects | The check box «Set permissions for new objects» should only be selected for the FullAccess role | Yes | Critical | Vulnerability | standardbadpracticedesign |
| SetPrivilegedMode | Using privileged mode | Yes | Major | Security Hotspot | suspicious |
| SeveralCompilerDirectives | Erroneous indication of several compilation directives | Yes | Critical | Error | unpredictableerror |
| SpaceAtStartComment | Space at the beginning of the comment | Yes | Info | Code smell | standard |
| StyleElementConstructors | Style element constructor | Yes | Minor | Error | standardbadpractice |
| TempFilesDir | TempFilesDir() method call | Yes | Major | Code smell | standardbadpractice |
| TernaryOperatorUsage | Ternary operator usage | No | Minor | Code smell | brainoverload |
| ThisObjectAssign | ThisObject assign | Yes | Blocker | Error | error |
| TimeoutsInExternalResources | Timeouts working with external resources | Yes | Critical | Error | unpredictablestandard |
| TooManyReturns | Methods should not have too many return statements | No | Minor | Code smell | brainoverload |
| TransferringParametersBetweenClientAndServer | Transferring parameters between the client and the server | Yes | Major | Code smell | badpracticeperformancestandard |
| TryNumber | Cast to number of try catch block | Yes | Major | Code smell | standard |
| Typo | Typo | Yes | Info | Code smell | badpractice |
| UnaryPlusInConcatenation | Unary Plus sign in string concatenation | Yes | Blocker | Error | suspiciousbrainoverload |
| UnionAll | Using keyword "UNION" in queries | Yes | Minor | Code smell | standardsqlperformance |
| UnknownPreprocessorSymbol | Unknown preprocessor symbol | Yes | Critical | Error | standarderror |
| UnreachableCode | Unreachable Code | Yes | Minor | Error | designsuspicious |
| UnsafeSafeModeMethodCall | Unsafe SafeMode method call | Yes | Blocker | Error | deprecatederror |
| UnusedLocalMethod | Unused local method | Yes | Major | Code smell | standardsuspiciousunused |
| UnusedLocalVariable | Unused local variable | Yes | Major | Code smell | brainoverloadbadpracticeunused |
| UnusedParameters | Unused parameter | Yes | Major | Code smell | designunused |
| UsageWriteLogEvent | Incorrect use of the method "WriteLogEvent" | Yes | Info | Code smell | standardbadpractice |
| UseLessForEach | Useless collection iteration | Yes | Critical | Error | clumsy |
| UseSystemInformation | Use of system information | No | Critical | Security Hotspot | suspicious |
| UsingCancelParameter | Using parameter "Cancel" | Yes | Major | Code smell | standardbadpractice |
| UsingExternalCodeTools | Using external code tools | Yes | Critical | Security Hotspot | standarddesign |
| UsingFindElementByString | Using FindByName, FindByCode and FindByNumber | Yes | Major | Code smell | standardbadpracticeperformance |
| UsingGoto | "goto" statement should not be used | Yes | Critical | Code smell | standardbadpractice |
| UsingHardcodeNetworkAddress | Using hardcode ip addresses in code | Yes | Critical | Vulnerability | standard |
| UsingHardcodePath | Using hardcode file paths in code | Yes | Critical | Error | standard |
| UsingHardcodeSecretInformation | Storing confidential information in code | Yes | Critical | Vulnerability | standard |
| UsingLikeInQuery | Using 'LIKE' in query | No | Major | Error | sqlunpredictable |
| UsingModalWindows | Using modal windows | Yes | Major | Code smell | standard |
| UsingObjectNotAvailableUnix | Using unavailable in Unix objects | Yes | Critical | Error | standardlockinos |
| UsingServiceTag | Using service tags | Yes | Info | Code smell | badpractice |
| UsingSynchronousCalls | Using synchronous calls | Yes | Major | Code smell | standard |
| UsingThisForm | Using deprecated property "ThisForm" | Yes | Minor | Code smell | standarddeprecated |
| VirtualTableCallWithoutParameters | Virtual table call without parameters | Yes | Major | Error | sqlstandardperformance |
| WrongDataPathForFormElements | Form fields do not have a data path | Yes | Critical | Error | unpredictable |
| WrongHttpServiceHandler | Missing handler for http service | Yes | Critical | Error | suspiciouserror |
| WrongUseFunctionProceedWithCall | Wrong use of ProceedWithCall function | Yes | Blocker | Error | errorsuspicious |
| WrongUseOfRollbackTransactionMethod | Not recommended using of RollbackTransaction method | Yes | Critical | Error | standard |
| WrongWebServiceHandler | Wrong handler for web service | Yes | Critical | Error | suspiciouserror |
| YoLetterUsage | Using Russian character "yo" ("ё") in code | Yes | Info | Code smell | standard |