diff --git a/docs/en/contributing/DiagnostcAddSettings.md b/docs/en/contributing/DiagnostcAddSettings.md index a08fe84a624..6dc9b7569e6 100644 --- a/docs/en/contributing/DiagnostcAddSettings.md +++ b/docs/en/contributing/DiagnostcAddSettings.md @@ -69,7 +69,7 @@ diagnosticInstance.configure(configuration); ### Adding a Parameter Description For correct operation, it is necessary to add a parameter description for each language in the diagnostic resource files. -Diagnostic resources are located in files `resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/_en.properties` and `resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/_ru.properties`. +Diagnostic resources are located in files`resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/_en.properties` and `resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/_ru.properties`. In each file, add a new line with the parameter name and description ```ini diff --git a/docs/en/contributing/DiagnosticDevWorkFlow.md b/docs/en/contributing/DiagnosticDevWorkFlow.md index 747207eb55d..9b5bfb9830b 100644 --- a/docs/en/contributing/DiagnosticDevWorkFlow.md +++ b/docs/en/contributing/DiagnosticDevWorkFlow.md @@ -20,14 +20,13 @@ At startup, a list of available diagnostic tags is displayed. You must enter 1-3 5. To develop 6. After completion of the development of diagnostics: it is necessary to check the changes (after testing), and also perform a number of service tasks. -To simplify, a special command has been created that can be run in the console `gradlew precommit` or from the Gradle taskbar `precommit`. Task includes subtasks -Sub Commands + To simplify, a special command has been created that can be run in the console `gradlew precommit` or from the Gradle taskbar `precommit`. Task includes subtasks - check - checking and testing the entire project -- licenseFormat - set license block in java source files -- updateJsonSchema - update the json schema of the configuration file +- licenseFormat - installation of a license block in java source files +- updateJsonSchema - json schema update 7. If everything is done correctly, you need to commit the changes and push to your remote repository. 8. You need to create `Pull request` from your feature branch to the `develop` branch of the primary repository and fill in the information in the description. -9. Before closing the `pull request`, the maintainers will check the code and make comments. Bug fixes must be done in the same feature branch, github will automatically add the changes to the generated `pull request`. -10. Closing a `pull request` confirms the completion of the task. +9. Before closing `Pull request`, the maintainers will conduct a Code review. Correction of errors must be done in the same feature branch, GitHub will automatically add changes to the created `Pull request`. +10. Closing `Pull request` confirms the completion of the task. diff --git a/docs/en/contributing/DiagnosticExample.md b/docs/en/contributing/DiagnosticExample.md index 074418fc325..e14e7f7a6a3 100644 --- a/docs/en/contributing/DiagnosticExample.md +++ b/docs/en/contributing/DiagnosticExample.md @@ -178,4 +178,4 @@ To describe the created diagnostics, create two files `SemicolonPresence.md`: in The help index is updated automatically when the documentation site is built, so you don't have to do anything by hand. -Before finishing development, you need to run `gradlew precommit` from the command line or `precommit` from the Gradle taskbar in the IDE. +Before finishing development, you need to run `gradlew precommit` from the command line or `precommit` from the Gradle taskbar in the IDE. diff --git a/docs/en/contributing/DiagnosticStructure.md b/docs/en/contributing/DiagnosticStructure.md index a566ab9be90..a39ff5ed274 100644 --- a/docs/en/contributing/DiagnosticStructure.md +++ b/docs/en/contributing/DiagnosticStructure.md @@ -52,8 +52,7 @@ At the time of this writing, the following properties are available: - Compatibility mode `compatibilityMode`, by which diagnostics are filtered when using metadata. The default is `UNDEFINED`. - List of module types `modules` for the ability to limit the area analyzed by diagnostics - Sign of the ability to set issues on the entire project `canLocateOnProject`. Used for diagnostics not related to the source code module. At the moment, the option is accepted only by SonarQube, other tools ignore it. -- LSP severity level `lspSeverity` (by default empty string). Allows explicit control over the LSP severity level for the diagnostic. When set, this value takes priority over the calculated LSP severity. Supported values: `Error`, `Warning`, `Information`, `Hint`. This parameter can also be overridden in the configuration file. -The last two can be omitted. +- LSP severity level `lspSeverity` (by default empty string). Allows explicit control over the LSP severity level for the diagnostic. When set, this value takes priority over the calculated LSP severity. Supported values: `Error`, `Warning`, `Information`, `Hint`. This parameter can also be overridden in the configuration file. The last two can be omitted. Annotation example @@ -75,6 +74,7 @@ Annotation example extraMinForComplexity = 1, // For each additional note position (`DiagnosticRelatedInformation`) one minute will be added lspSeverity = "Warning" // Explicit LSP severity level (Error, Warning, Information, Hint) ) + ``` Class should implement the interface `BSLDiagnostic`. If diagnostic bases on AST, that class should extends at one of classes, that implement `BSLDiagnostic` below: @@ -226,13 +226,13 @@ Examples: ### Diagnostics class, inherits from AbstractSDBLVisitorDiagnostic -The diagnostic class implements the necessary `AST visitors`, according to the grammar of the query language (see [BSLParser](https://github.com/1c-syntax/bsl-parser/blob/master/src/main/antlr/SDBLParser.g4)). The complete list of visitor methods is in the `SDBLParserBaseVisitor` class. +The diagnostic class implements the necessary `AST visitors`, according to the grammar of the query language (see [BSLParser](https://github.com/1c-syntax/bsl-parser/blob/master/src/main/antlr/SDBLParser.g4)). The complete list of visitor methods is in the `SDBLParserBaseVisitor` class. The rest of the rules are identical to `AbstractVisitorDiagnostic`. ### Diagnostics class, inherits from AbstractListenerDiagnostic **(Work in Progress)** -_****_ +_**<В разработке>**_ ## Diagnostics test class @@ -279,10 +279,10 @@ Simplified, the diagnostic test contains the steps - checking the number of items found - checking the location of detected items -The first step is to get the list of notes by calling the `getDiagnostics()` method _(implemented in the `AbstractDiagnosticTest` class)_. Calling this method will parse the diagnostics resource file and return a list of remarks in it. -The next step is to use the `hasSize()` statement to make sure that the number of diagnostics is fixed as much as allowed in the fixtures. -After that, you need to make sure that the diagnostics are detected correctly. To do this, you need to compare the diagnostic area obtained by the `getRange()` method with the expected area _(you should use the `RangeHelper` class to simplify the formation of control values)_. -If the text of the error is templated, then it is necessary to check it in the test by getting the text of the error message using the `getMessage()` method of diagnostics. +The first step is to get the list of notes by calling the `getDiagnostics()` method _(implemented in the `AbstractDiagnosticTest` class)_. При вызове этого метода будет выполнен анализ файла ресурса диагностики и возвращен список замечаний в нем. +Следующим шагом необходимо, с помощью утверждения `hasSize()` убедиться, что замечаний зафиксированно столько, сколько допущенно в фикстурах. +После этого, необходимо удостовериться, что замечания обнаружены верно, для чего нужно сравнить область замечания, полученную методом `getRange()`, с ожидаемой областью _(стоит использовать класс `RangeHelper` для упрощения формирования контрольнх значений)_. +В случае использования шаблонного текста сообщения об ошибке замечания, необходимо в тесте проверить и его, получив текст сообщения об ошибке методом `getMessage()` диагностики. Test method example @@ -309,7 +309,7 @@ To reduce the amount of test code, you can use the `util.Assertions.assertThat` assertThat(diagnostics).hasSize(2); // checking the number of errors found - // verification of special cases + // проверка частных случаев assertThat(diagnostics, true) .hasRange(27, 4, 27, 29) .hasRange(40, 4, 40, 29); @@ -318,8 +318,7 @@ To reduce the amount of test code, you can use the `util.Assertions.assertThat` ### Test of configuration method for parameterized diagnostics -Tests for the configuration method should cover all possible settings and their combinations. The test has almost the same structure as the diagnostic test. -Before setting new values ​​for diagnostic parameters, you must get the default diagnostic settings using the `getDefaultDiagnosticConfiguration()` method using the information of the current diagnostic object `diagnosticInstance.getInfo()`. The result is a map in which the `put` method needs to change the values ​​of the required parameters. To apply the changed settings, you need to call the `configure()` method of the current diagnostic object `diagnosticInstance`. +Tests for the configuration method should cover all possible settings and their combinations. The test has almost the same structure as the diagnostic test. Before setting new values ​​for diagnostic parameters, you must get the default diagnostic settings using the `getDefaultDiagnosticConfiguration()` method using the information of the current diagnostic object `diagnosticInstance.getInfo()`. The result is a map in which the `put` method needs to change the values ​​of the required parameters. To apply the changed settings, you need to call the `configure()` method of the current diagnostic object `diagnosticInstance`. Test method example @@ -345,7 +344,7 @@ Test method example ### Quick fixes test **(Work in progress)** -_****_ +_**<В разработке>**_ ## Diagnostics resources @@ -360,18 +359,15 @@ For `quick fixes`, the `quickFixMessage` parameter is used, which contains a des ## Diagnostics test resources -The fixtures are the contents of the test resource file located in the `src/test/resources` directory in the `diagnostics` package. The file must contain the necessary code examples in 1C language _(or oscript language)_. - -It is necessary to add both erroneous and correct code, **marking the places of errors with comments**. It is best if the test cases are `real`, from practice, and not synthetic, invented `for diagnostics`. +The fixtures are the contents of the test resource file located in the `src/test/resources` directory in the `diagnostics` package. The file must contain the necessary code examples in 1C language _(or oscript language)_. It is best if the test cases are `real`, from practice, and not synthetic, invented `for diagnostics`. -## Description +## Diagnostics description -The diagnostic description is created in the [Markdown](https://ru.wikipedia.org/wiki/Markdown) format in two versions - for Russian and English. The files are located in the `docs/diagnostics` directory for Russian, for English in `docs/en/diagnostics`. -The file has the structure +The diagnostic description is created in the [Markdown](https://ru.wikipedia.org/wiki/Markdown) format in two versions - for Russian and English. The files are located in the `docs/diagnostics` directory for Russian, for English in `docs/en/diagnostics`. The file has the structure - Header equal to the value of `diagnosticName` from the corresponding language's diagnostic resource file - A block with a description of the diagnostics, indicating "why it is so bad" -- List of exceptions that diagnostics do not detect +- Исключительные ситуации, когда диагностика не детектирует замечание - Examples of good and bad code -- The diagnostic algorithm, if it is not obvious +- Algorithm of diagnostics for complex - If diagnostics is an implementation of the standard, then links to sources (for example, to [ITS](https://its.1c.ru)). diff --git a/docs/en/contributing/DiagnosticTypeAndSeverity.md b/docs/en/contributing/DiagnosticTypeAndSeverity.md index 741fef379d4..3d88c950553 100644 --- a/docs/en/contributing/DiagnosticTypeAndSeverity.md +++ b/docs/en/contributing/DiagnosticTypeAndSeverity.md @@ -56,7 +56,7 @@ Examples ### Error (ERROR) -This category includes real errors during the user's work. They can be of any importance, except `Info`, while: +This category includes real errors during the user's work. They can be of any importance, except `Informational`, while: - `Blocker` means there is no workaround, urgently needs to be fixed. An example is uncompiled code or calling a method that does not exist. - `Critical` means there is a known workaround (for example, disabling functionality with an error), but requiring the fastest possible fix. diff --git a/docs/en/contributing/EventsApi.md b/docs/en/contributing/EventsApi.md index 35c7ee10542..5efc4bc3ee8 100644 --- a/docs/en/contributing/EventsApi.md +++ b/docs/en/contributing/EventsApi.md @@ -49,8 +49,7 @@ The `EventPublisherAspect` aspect of the `com.github._1c_syntax.bsl.languageserv > Brief information about aspect-oriented programming you can find in page https://www.baeldung.com/aspectj. -To intercept events in an aspect, advice can be declared to intercept method calls and/or accesses to object properties. -An event object must be created in the advice body and published via [`ApplicationEventPublisher`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/ApplicationEventPublisher.html). +To intercept events in an aspect, advice can be declared to intercept method calls and/or accesses to object properties. An event object must be created in the advice body and published via [`ApplicationEventPublisher`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/ApplicationEventPublisher.html). > To form a pointcut expression, you need to use templates in the `Pointcuts` class of the `com.github._1c_syntax.bsl.languageserver.aop` package diff --git a/docs/en/contributing/StyleGuide.md b/docs/en/contributing/StyleGuide.md index c0337fa22d3..c2fa81a30f6 100644 --- a/docs/en/contributing/StyleGuide.md +++ b/docs/en/contributing/StyleGuide.md @@ -4,12 +4,11 @@ This document contains general guidelines for writing code in the BSL Language S Try to stick to them and the code review process will be simple. -## Null values +## Обработка null If a method can legally return `null`, it is recommended that you return `Optional` instead of explicitly returning `null`. Exceptions (eg. high frequency or performance functions) are negotiated separately. -The description of the `package-info.java` package must indicate that the NonNull API is used by default in the package. -To do this, the annotation `@NullMarked` is added above the package name +The description of the `package-info.java` package must indicate that the NonNull API is used by default in the package. To do this, the annotation `@NullMarked` is added above the package name Example: ```java diff --git a/docs/en/diagnostics/BadWords.md b/docs/en/diagnostics/BadWords.md index 719cd698e57..55ee982c0e9 100644 --- a/docs/en/diagnostics/BadWords.md +++ b/docs/en/diagnostics/BadWords.md @@ -1,13 +1,11 @@ # Prohibited words (BadWords) -## Description -Software modules should not contain prohibited words. -The list of forbidden words is set by a regular expression. -The search is case-insensitive. +## Diagnostics description +There should be no forbidden words in the text of the modules. The list of forbidden words is given by a regular expression. The search is made case-insensitive. -**For example:** +**Sample setup:** -"singularity|avada kedavra|Donald" +"редиска|лопух|экзистенциальность" -"transcenden(tal|ce)" +"ло(х|шара|шпед)" diff --git a/docs/en/diagnostics/CachedPublic.md b/docs/en/diagnostics/CachedPublic.md index 7a1cadf719a..bdf02ce1489 100644 --- a/docs/en/diagnostics/CachedPublic.md +++ b/docs/en/diagnostics/CachedPublic.md @@ -13,4 +13,4 @@ You should not create a programming interface in modules that reuse return value ## Sources -* Source: [Standard: Ensuring Library Compatibility (RU)](https://its.1c.ru/db/v8std#content:644:hdoc:3.6) +* Source: [Standard: Ensuring Library Compatibility](https://its.1c.ru/db/v8std#content:644:hdoc:3.6) diff --git a/docs/en/diagnostics/CanonicalSpellingKeywords.md b/docs/en/diagnostics/CanonicalSpellingKeywords.md index 6b77e38575f..5bd1a12807c 100644 --- a/docs/en/diagnostics/CanonicalSpellingKeywords.md +++ b/docs/en/diagnostics/CanonicalSpellingKeywords.md @@ -8,7 +8,7 @@ A built-in language constructs, keywords must be written canonically. ### Keywords | RU | EN | -|--------------------|---------------| +| ------------------ | ------------- | | ВызватьИсключение | Raise | | Выполнить | Execute | | ДобавитьОбработчик | AddHandler | @@ -47,7 +47,7 @@ A built-in language constructs, keywords must be written canonically. ### Preprocessor instrutions | RU | EN | -|------------------------------------|--------------------------------| +| ---------------------------------- | ------------------------------ | | ВебКлиент | WebClient | | ВнешнееСоединение | ExternalConnection | | Если | If | @@ -74,7 +74,7 @@ A built-in language constructs, keywords must be written canonically. ### Compilation directives | RU | EN | -|--------------------------------|---------------------------| +| ------------------------------ | ------------------------- | | НаКлиенте | AtClient | | НаСервере | AtServer | | НаСервереБезКонтекста | AtServerNoContext | diff --git a/docs/en/diagnostics/CodeAfterAsyncCall.md b/docs/en/diagnostics/CodeAfterAsyncCall.md index 7a63461d9b9..6ce13295588 100644 --- a/docs/en/diagnostics/CodeAfterAsyncCall.md +++ b/docs/en/diagnostics/CodeAfterAsyncCall.md @@ -14,17 +14,17 @@ Incorrect code ```bsl &AtClient Procedure Command1(Command) - AdditionalParameters = New Structure("Result", 10); - Notify = New NotifyDescription("AfterNumberWereInputted", AdditionalParameters.Result, 2); - - Message("Inputed value is " + AdditionalParameters.Result); // wrong because there will always be 10 + AdditionalParameters = New Structure("Result", 10); + Notify = New NotifyDescription("AfterNumberWereInputted", AdditionalParameters.Result, 2); + + Message("Inputed value is " + AdditionalParameters.Result); // wrong because there will always be 10 EndProcedure &AtClient Procedure AfterNumberWereInputted(Number, AdditionalParameters) Export - If Number <> Undefined Then - AdditionalParameters.Result = Number; - EndIf; + If Number <> Undefined Then + AdditionalParameters.Result = Number; + EndIf; EndProcedure; ``` @@ -49,10 +49,10 @@ Correct code In some cases, executing code immediately after calling an asynchronous method is entirely possible if you do not need to wait for the results of the asynchronous action. For example ```bsl -&AtClient -Procedure Command(Command) - ShowMessageBox(, "Moneo te!", 10); - Message("code started working after ShowMessageBox"); +&НаКлиенте +Процедура Команда1(Команда) + ПоказатьПредупреждение(, "Предупреждаю", 10); + Сообщить("начал работать код после ПоказатьПредупреждение"); // ... EndProcedure ``` @@ -78,7 +78,7 @@ It is also important to consider that an asynchronous method can be called in on -- [Developers guide: Internal language. Ch. 4: Sync and async methods (RU)](https://its.1c.ru/db/v8319doc#bookmark:dev:TI000001505) +- [Sync and async methods - Developers guide Chapter 4. Internal language](https://its.1c.ru/db/v8319doc#bookmark:dev:TI000001505) diff --git a/docs/en/diagnostics/CodeBlockBeforeSub.md b/docs/en/diagnostics/CodeBlockBeforeSub.md index fb441388abc..59508194dbb 100644 --- a/docs/en/diagnostics/CodeBlockBeforeSub.md +++ b/docs/en/diagnostics/CodeBlockBeforeSub.md @@ -15,7 +15,7 @@ Based on the structure described above, the location of the program code before ## Examples -Incorrect +Wrong ```bsl SomeMethod(); @@ -30,4 +30,4 @@ EndProcedure -* [Module structure (RU)](https://its.1c.ru/db/v8std/content/455/hdoc) +* [Module structure](https://its.1c.ru/db/v8std/content/455/hdoc) diff --git a/docs/en/diagnostics/CodeOutOfRegion.md b/docs/en/diagnostics/CodeOutOfRegion.md index ceab87fd146..3bca8716549 100644 --- a/docs/en/diagnostics/CodeOutOfRegion.md +++ b/docs/en/diagnostics/CodeOutOfRegion.md @@ -30,21 +30,21 @@ Correct: Name matching table (full in [source code](https://github.com/1c-syntax/bsl-language-server/blob/develop/src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/Keywords.java#L255)): -| RU | EN | -| ------------- | ------------- | -| ПрограммныйИнтерфейс | Public | -| СлужебныйПрограммныйИнтерфейс | Internal | -| СлужебныеПроцедурыИФункции | Private | -| ОбработчикиСобытий | EventHandlers | -| ОбработчикиСобытийФормы | FormEventHandlers | -| ОбработчикиСобытийЭлементовШапкиФормы | FormHeaderItemsEventHandlers | -| ОбработчикиКомандФормы | FormCommandsEventHandlers | -| ОписаниеПеременных | Variables | -| Инициализация | Initialize | -| ОбработчикиСобытийЭлементовТаблицыФормы | FormTableItemsEventHandlers | +| RU | EN | +| --------------------------------------- | ---------------------------- | +| ПрограммныйИнтерфейс | Public | +| СлужебныйПрограммныйИнтерфейс | Internal | +| СлужебныеПроцедурыИФункции | Private | +| ОбработчикиСобытий | EventHandlers | +| ОбработчикиСобытийФормы | FormEventHandlers | +| ОбработчикиСобытийЭлементовШапкиФормы | FormHeaderItemsEventHandlers | +| ОбработчикиКомандФормы | FormCommandsEventHandlers | +| ОписаниеПеременных | Variables | +| Инициализация | Initialize | +| ОбработчикиСобытийЭлементовТаблицыФормы | FormTableItemsEventHandlers | ## Sources -* Source: [Standard: Module structure (RU)](https://its.1c.ru/db/v8std#content:455:hdoc) +* Reference [Code conventions. Module structure](https://its.1c.ru/db/v8std#content:455:hdoc) diff --git a/docs/en/diagnostics/CommentedCode.md b/docs/en/diagnostics/CommentedCode.md index 841e2a61d3e..21c004b1cf4 100644 --- a/docs/en/diagnostics/CommentedCode.md +++ b/docs/en/diagnostics/CommentedCode.md @@ -30,4 +30,4 @@ A code block is considered commented, if at least one line inside the block is d ## Sources -* [Standard: Modules texts(RU)](https://its.1c.ru/db/v8std#content:456:hdoc) +* [Source (RU)](https://its.1c.ru/db/v8std/content/456/hdoc) diff --git a/docs/en/diagnostics/CommonModuleInvalidType.md b/docs/en/diagnostics/CommonModuleInvalidType.md index fac19cee8d3..b6c7415e694 100644 --- a/docs/en/diagnostics/CommonModuleInvalidType.md +++ b/docs/en/diagnostics/CommonModuleInvalidType.md @@ -7,10 +7,10 @@ When developing common modules, you should choose one of four code execution con | Common module type | Naming example | Server call | Server | External connection | Client (Ordinary application) | Client (Managed application) | | ------------------------------- | ------------------------------ | ----------- | ------ | ------------------- | ----------------------------- | ---------------------------- | -| Server-side | Common (or CommonServer) | | + | + | + | | -| Server-side to call from client | CommonServerCall | + | + | | | | -| Client-side | CommonClient (or CommonGlobal) | | | | + | + | -| Client-server | CommonClientServer | | + | + | + | + | +| Server-side | Common (or CommonServer) |   | + | + | + |   | +| Server-side to call from client | CommonServerCall | + | + |   |   |   | +| Client-side | CommonClient (or CommonGlobal) |   |   |   | + | + | +| Client-server | CommonClientServer |   | + | + | + | + | ## Examples diff --git a/docs/en/diagnostics/CommonModuleMissingAPI.md b/docs/en/diagnostics/CommonModuleMissingAPI.md index 1ed1a768663..b4842876a6a 100644 --- a/docs/en/diagnostics/CommonModuleMissingAPI.md +++ b/docs/en/diagnostics/CommonModuleMissingAPI.md @@ -11,7 +11,7 @@ A common module must have at least one export method and region "Public" or "Int Incorrect -```bsl +```Bsl // Start module Procedure Test(A) A = A + 1; @@ -21,7 +21,7 @@ EndProcedure Correct -```bsl +```Bsl // Start module #Region Internal Procedure Test(A) Export @@ -34,4 +34,4 @@ EndProcedure ## Sources -Source: [Standard: Module structure (RU)](https://its.1c.ru/db/v8std#content:455:hdoc) +Source: [Standard: Module structure](https://its.1c.ru/db/v8std#content:455:hdoc) diff --git a/docs/en/diagnostics/CommonModuleNameFullAccess.md b/docs/en/diagnostics/CommonModuleNameFullAccess.md index 8d980b2a7c1..2ddb39e2f09 100644 --- a/docs/en/diagnostics/CommonModuleNameFullAccess.md +++ b/docs/en/diagnostics/CommonModuleNameFullAccess.md @@ -9,7 +9,7 @@ Modules executed in privileged mode have the Privileged flag, are named with the ## Examples -Example: FilesFullAccess +FilesFullAccess ## Sources diff --git a/docs/en/diagnostics/CommonModuleNameGlobalClient.md b/docs/en/diagnostics/CommonModuleNameGlobalClient.md index 839185dd1a1..109188eeabf 100644 --- a/docs/en/diagnostics/CommonModuleNameGlobalClient.md +++ b/docs/en/diagnostics/CommonModuleNameGlobalClient.md @@ -9,11 +9,9 @@ For global modules, the "Global" (rus. "Глобальный") postfix is added ## Examples -Incorrect: -InfobaseUpdateGlobalClient +Incorrect: InfobaseUpdateGlobalClient -Correct: -InfobaseUpdateGlobal +Correct: InfobaseUpdateGlobal ## Sources diff --git a/docs/en/diagnostics/CommonModuleNameWords.md b/docs/en/diagnostics/CommonModuleNameWords.md index 84e2c352fa6..1f89fb85d16 100644 --- a/docs/en/diagnostics/CommonModuleNameWords.md +++ b/docs/en/diagnostics/CommonModuleNameWords.md @@ -9,4 +9,4 @@ It is not recommended to use the words "Procedures", "Functions", "Handlers", "M ## Sources -* Standard: [Rules for creating common modules (RU)](https://its.1c.ru/db/v8std#content:469:hdoc:3.1) +* Standard: Rules for creating common modules (RU) diff --git a/docs/en/diagnostics/CompilationDirectiveNeedLess.md b/docs/en/diagnostics/CompilationDirectiveNeedLess.md index 3a6d9ca3c84..bac8ede702b 100644 --- a/docs/en/diagnostics/CompilationDirectiveNeedLess.md +++ b/docs/en/diagnostics/CompilationDirectiveNeedLess.md @@ -16,4 +16,4 @@ Must be used only in the code of managed form modules and in the code of command In server or client common modules, the execution context is obvious, so there is no sense in compilation directives. In common modules with client and server attributes, using compilation directives makes it difficult to understand which ones are procedures (functions) are available eventually. ## Sources -* [Standard: Use of compilation and preprocessor directives (RU)](https://its.1c.ru/db/v8std#content:439:hdoc) +* Source: [The use of compilation directives and preprocessor instructions(RUS)](https://its.1c.ru/db/v8std#content:439:hdoc) diff --git a/docs/en/diagnostics/CrazyMultilineString.md b/docs/en/diagnostics/CrazyMultilineString.md index 1e909ff0596..76f31e2402f 100644 --- a/docs/en/diagnostics/CrazyMultilineString.md +++ b/docs/en/diagnostics/CrazyMultilineString.md @@ -2,7 +2,6 @@ ## Description - In source text, multi-line constants can be initialized in two ways: @@ -18,8 +17,8 @@ The second method complicates the perception; when using it, it is easy to make Difficulty understanding: ```bsl -String = "BBB" "CC" -"F"; +Строка = "ВВВ" "СС" +"Ф"; ``` Classic variant: diff --git a/docs/en/diagnostics/CreateQueryInCycle.md b/docs/en/diagnostics/CreateQueryInCycle.md index 1d10b7ee915..f45ab0b7c10 100644 --- a/docs/en/diagnostics/CreateQueryInCycle.md +++ b/docs/en/diagnostics/CreateQueryInCycle.md @@ -7,7 +7,7 @@ Execution query in cycle. ## Examples -Incorrect +Bad ```bsl @@ -32,7 +32,7 @@ EndDo; ``` -Correct +Good ```bsl // BanksToProcess - contains an array of banks diff --git a/docs/en/diagnostics/DataExchangeLoading.md b/docs/en/diagnostics/DataExchangeLoading.md index ce49e2c3855..41ae593c8ed 100644 --- a/docs/en/diagnostics/DataExchangeLoading.md +++ b/docs/en/diagnostics/DataExchangeLoading.md @@ -10,7 +10,7 @@ This is necessary so that no business logic of the object is executed when writi ## Examples -Incorrect: +Bad: ```bsl Procedure BeforeWrite(Cancel) @@ -24,7 +24,7 @@ Procedure BeforeWrite(Cancel) EndProcedure ``` -Correct: +Good: ```bsl Procedure BeforeWrite(Cancel) diff --git a/docs/en/diagnostics/DeletingCollectionItem.md b/docs/en/diagnostics/DeletingCollectionItem.md index d762c5cc5e0..11036f09ca0 100644 --- a/docs/en/diagnostics/DeletingCollectionItem.md +++ b/docs/en/diagnostics/DeletingCollectionItem.md @@ -3,7 +3,7 @@ ## Description -Don't delete elements of collection when iterating through collection using the operator **For each ... In ... Do**. Because it change index of next element. +Don't delete elements of collection %s when iterating through collection using the operator **For each ... In ... Do**. Because it change index of next element. Example: diff --git a/docs/en/diagnostics/DenyIncompleteValues.md b/docs/en/diagnostics/DenyIncompleteValues.md index 477e71da299..ff5fe3a48be 100644 --- a/docs/en/diagnostics/DenyIncompleteValues.md +++ b/docs/en/diagnostics/DenyIncompleteValues.md @@ -1,32 +1,44 @@ # Deny incomplete values for dimensions (DenyIncompleteValues) + ## Description + + Often when designing a metadata structure, it is required that the dimensions of a register must always be filled with values (should not be empty). -Checking for completeness of the dimension value should be done using the "Deny Incomplete Values" flag for the register dimension; additional software control of measurement filling is not required. -It is assumed that records with an empty dimension value do not make sense in the infobase. -The absence of a set flag can lead to potential problems if the application developers have not provided a value validation algorithm. +Checking for completeness of the dimension value should be done using the "Deny Incomplete Values" flag for the register dimension; additional software control of measurement filling is not required. В этом случае платформа самостоятельно будет проверять заполненность измерений и не нужно дополнительно контролировать заполнение измерения ни при программной обработке регистров, ни при интерактивной обработке. +Фактически записи с незаполненным измерением не имеют смысла в информационной базе, каким бы образом они в нее ни попали: в результате интерактивного ввода или в результате выполнения программного кода. + +Без установки указанного флага могут возникать различные ситуации, которые приводят к проблемам или усложняют сопровождение систем 1С. Например, + +- пользователи смогут интерактивно указать пустые значения +- или разработчики могут при разработке ошибаться, не указывая значения измерения при подготовке записей регистра. -The current rule may give a lot of false positives, use at your own risk. +Текущее правило может выдавать ложные срабатывания для измерений, которые могут быть не заполнены. The rule applies to the following registers: + - information register - accumulation register - accounting register - calculation register ## Examples + ## Sources + + -- [Development of the interface for applied solutions on the "1C:Enterprise" platform (RU). Ch "Fill check and check on write"](https://its.1c.ru/db/pubv8devui#content:225:1) + +- [Development of the interface for applied solutions on the "1C:Enterprise" platform (RU). Ch "Fill check and check on write"](https://its.1c.ru/db/pubv8devui#content:225:1) - [Developer's Guide - Properties of a dimension (resource, attribute) of the information register (RU)](https://its.1c.ru/db/v8323doc#bookmark:dev:TI000000349) - [Developer's Guide - Properties of a dimension (resource, attribute) of the accumulation register (RU)](https://its.1c.ru/db/v8323doc#bookmark:dev:TI000000363) diff --git a/docs/en/diagnostics/DeprecatedAttributes8312.md b/docs/en/diagnostics/DeprecatedAttributes8312.md index 30560315bc3..6c418d29424 100644 --- a/docs/en/diagnostics/DeprecatedAttributes8312.md +++ b/docs/en/diagnostics/DeprecatedAttributes8312.md @@ -8,7 +8,6 @@ The following items are deprecated and their use is not recommended since platfo * For the system enumeration `ChildFormItemsGroup` implemented the value `AlwaysHorizontal`, the value `ChildFormItemsGroup.Horizontal` is deprecated * `ChartLabelsOrientation` system enum is no longer available. Actual variant is `ChartLabelsOrientation` * The following properties and methods of Chart object are obsolete and not recommended for use: - * `ColorPalette`; * `GradientPaletteStartColor`; * `GradientPaletteEndColor`; @@ -17,7 +16,6 @@ The following items are deprecated and their use is not recommended since platfo * `SetPalette()`. * Names of properties of the object `ChartPlotArea`: - * `ShowScale` * `ScaleLines` * `ScaleColor` @@ -36,4 +34,4 @@ The following items are deprecated and their use is not recommended since platfo ## Sources -Source: [Platform 8.3.12 changelog (RU)](https://dl04.1c.ru/content/Platform/8_3_12_1714/1cv8upd_8_3_12_1714.htm) +Source: [Platform 8.3.12 changelog](https://dl04.1c.ru/content/Platform/8_3_12_1714/1cv8upd_8_3_12_1714.htm) diff --git a/docs/en/diagnostics/DeprecatedCurrentDate.md b/docs/en/diagnostics/DeprecatedCurrentDate.md index 4673c51026b..26da4396dc3 100644 --- a/docs/en/diagnostics/DeprecatedCurrentDate.md +++ b/docs/en/diagnostics/DeprecatedCurrentDate.md @@ -16,16 +16,16 @@ When using the Library of Standard Subsystems, it is recommended to use the Date ## Examples ### On the client -Wrong: +Incorrect: ```bsl OperationDate = CurrentDate(); ``` -Right: +Correct: ```bsl -OperationDate = GeneralPurposeClient.SessionDate(); +ДатаОперации = ОбщегоНазначенияКлиент.ДатаСеанса(); ``` ### On server @@ -41,8 +41,7 @@ OperationDate = CurrentSessionDate(); ``` ## Sources - - + -* Reference: [Metadata creation and change. Work in different timezones (RU)](https://its.1c.ru/db/v8std/content/643/hdoc) +* Reference: [Metadata creation and change. Work in different timezones](https://its.1c.ru/db/v8std/content/643/hdoc) diff --git a/docs/en/diagnostics/DeprecatedMessage.md b/docs/en/diagnostics/DeprecatedMessage.md index 04a2e8a6e95..ec92055be26 100644 --- a/docs/en/diagnostics/DeprecatedMessage.md +++ b/docs/en/diagnostics/DeprecatedMessage.md @@ -9,4 +9,4 @@ To display messages to the user in all cases, you should use the MessageUser obj ## Sources -* [Standard: Limit use of the obsolete method Message (RU)](https://its.1c.ru/db/v8std#content:418:hdoc) +* [Standard: Limit use of the obsolete method Message](https://its.1c.ru/db/v8std#content:418:hdoc) diff --git a/docs/en/diagnostics/DeprecatedMethodCall.md b/docs/en/diagnostics/DeprecatedMethodCall.md index 878bb1f8428..5a546286fb1 100644 --- a/docs/en/diagnostics/DeprecatedMethodCall.md +++ b/docs/en/diagnostics/DeprecatedMethodCall.md @@ -22,5 +22,5 @@ DeprecatedProcedure(); // Triggering diagnostics ## Sources -* Standart: [Procedures and functions description (RU)](https://its.1c.ru/db/v8std#content:453:hdoc) +* [Standart: Procedures and functions description](https://its.1c.ru/db/v8std/content/453/hdoc), section 5.7 * [CWE-477 Use of Obsolete Function](http://cwe.mitre.org/data/definitions/477.html) diff --git a/docs/en/diagnostics/DeprecatedMethods8310.md b/docs/en/diagnostics/DeprecatedMethods8310.md index 88b3367e8ce..a6764d4b0f2 100644 --- a/docs/en/diagnostics/DeprecatedMethods8310.md +++ b/docs/en/diagnostics/DeprecatedMethods8310.md @@ -3,9 +3,7 @@ ## Description - The following global context methods are deprecated and are not recommended since platform version 8.3.10: - ```bsl SetShortApplicationCaption(); GetShortApplicationCaption(); @@ -18,4 +16,4 @@ ClientApplicationInterfaceCurrentVariant(). ## Sources -Source: [Version 8.3.10 changelog (RU)](https://dl03.1c.ru/content/Platform/8_3_10_2699/1cv8upd.htm) +Source: [Version 8.3.10 changelog](https://dl03.1c.ru/content/Platform/8_3_10_2699/1cv8upd.htm) diff --git a/docs/en/diagnostics/DeprecatedMethods8317.md b/docs/en/diagnostics/DeprecatedMethods8317.md index 642dc876d0d..5b9f204bf31 100644 --- a/docs/en/diagnostics/DeprecatedMethods8317.md +++ b/docs/en/diagnostics/DeprecatedMethods8317.md @@ -16,4 +16,4 @@ You should use the same methods of the `ErrorProcessing` object instead. ## Sources -* Source: [Platform 8.3.17 changelog (RU)](https://dl03.1c.ru/content/Platform/8_3_17_1386/1cv8upd_8_3_17_1386.htm#27f2dc70-f0cf-11e9-8371-0050569f678a) +* Source: [Platform 8.3.17 changelog](https://dl03.1c.ru/content/Platform/8_3_17_1386/1cv8upd_8_3_17_1386.htm#27f2dc70-f0cf-11e9-8371-0050569f678a) diff --git a/docs/en/diagnostics/DeprecatedTypeManagedForm.md b/docs/en/diagnostics/DeprecatedTypeManagedForm.md index c125a7abe0c..bc619d24c25 100644 --- a/docs/en/diagnostics/DeprecatedTypeManagedForm.md +++ b/docs/en/diagnostics/DeprecatedTypeManagedForm.md @@ -8,4 +8,4 @@ Starting from the platform version 8.3.14, the "ManagedForm" type has been renam ## Sources -* Source: [Platform 8.3.16 changelog (RU)](https://dl03.1c.ru/content/Platform/8_3_16_1148/1cv8upd_8_3_16_1148.htm) +* Source: [Changelog](https://dl03.1c.ru/content/Platform/8_3_16_1148/1cv8upd_8_3_16_1148.htm) diff --git a/docs/en/diagnostics/DisableSafeMode.md b/docs/en/diagnostics/DisableSafeMode.md index da4c2057737..ea40b3f4220 100644 --- a/docs/en/diagnostics/DisableSafeMode.md +++ b/docs/en/diagnostics/DisableSafeMode.md @@ -1,43 +1,52 @@ # Disable safe mode (DisableSafeMode) + ## Description - -In addition to configuration code, the application solution can execute third-party program code, which can be connected in various ways (external reports and data processing, extensions, external components, etc.). The developer cannot guarantee the reliability of this code. An attacker can include various destructive actions in it that can harm user computers, servers, and data in the program. -The listed security problems are especially critical when operating configurations in the service model, because Having gained access to the service, malicious code can immediately gain access to all applications of all users of the service. + + +In addition to configuration code, the application solution can execute third-party program code, which can be connected in various ways (external reports and data processing, extensions, external components, etc.). The developer cannot guarantee the reliability of this code. При этом злоумышленник может предусмотреть в нем различные деструктивные действия (как в самом внешнем коде, так и опосредовано, через запуск внешних приложений, внешних компонент, COM-объектов), которые могут нанести вред компьютерам пользователей, серверным компьютерам, а также данным в программе. + +Перечисленные проблемы безопасности особенно критичны при работе конфигураций в модели сервиса. The listed security problems are especially critical when operating configurations in the service model, because Having gained access to the service, malicious code can immediately gain access to all applications of all users of the service. It is important to control the execution of such external code in safe mode, in exceptional cases (after verification) allowing code to be executed in unsafe mode. The rule diagnoses calls to the methods `SetSafeMode` and `SetDisableSafeMode` in the mode of disabling safe mode control + - Method call `SetDisableSafeMode(true)` is ignored - Method call `SetDisableSafeMode(false)` is ignored ## Examples + + ``` - SetSafeMode (False); // is error + УстановитьБезопасныйРежим (Ложь); // есть замечание - Value = False; - SetSafeMode(Value); // is error + Значение = Ложь; + УстановитьБезопасныйРежим (Значение); // есть замечание - SetSafeMode (True); // no error + УстановитьБезопасныйРежим (Истина); // нет замечания - SetDisableSafeMode(True); // is error + УстановитьОтключениеБезопасногоРежима(Истина); // есть замечание - Value = True; - SetDisableSafeMode(Value); // is error + Значение = Истина; + УстановитьОтключениеБезопасногоРежима(Значение); // есть замечание - SetDisableSafeMode(False); // no error + УстановитьОтключениеБезопасногоРежима(Ложь); // нет замечания ``` ## Sources + + + - [Developer's Guide 8.3.22: Safe operation (RU)](https://its.1c.ru/db/v8322doc#bookmark:dev:TI000000186) - [Standard: Restriction on the execution of "external" code (RU)](https://its.1c.ru/db/v8std/content/669/hdoc) - [Standard: Server API Security (RU)](https://its.1c.ru/db/v8std/content/678/hdoc) diff --git a/docs/en/diagnostics/DoubleNegatives.md b/docs/en/diagnostics/DoubleNegatives.md index 12e7c77500a..e3a786b975e 100644 --- a/docs/en/diagnostics/DoubleNegatives.md +++ b/docs/en/diagnostics/DoubleNegatives.md @@ -1,6 +1,7 @@ # Double negatives (DoubleNegatives) + ## Description Using double negatives makes the code harder to understand and can lead to errors when the developer mentally computes False instead of True, or vice versa. @@ -25,6 +26,7 @@ EndIf; ``` ## Sources + -* Source: [Remove double negative](https://www.refactoring.com/catalog/removeDoubleNegative.html) +- Source: [Remove double negative](https://www.refactoring.com/catalog/removeDoubleNegative.html) diff --git a/docs/en/diagnostics/DuplicateRegion.md b/docs/en/diagnostics/DuplicateRegion.md index 0100b1296e6..06a2b0b9579 100644 --- a/docs/en/diagnostics/DuplicateRegion.md +++ b/docs/en/diagnostics/DuplicateRegion.md @@ -13,4 +13,4 @@ All code should be structured and divided into sections (regions), each section -* Source: [Standard: Module structure (RU)](https://its.1c.ru/db/v8std#content:455:hdoc) +* Reference [Code conventions. Module structure](https://its.1c.ru/db/v8std#content:455:hdoc) diff --git a/docs/en/diagnostics/DuplicateStringLiteral.md b/docs/en/diagnostics/DuplicateStringLiteral.md index 9b8c2f19c89..ff28e227129 100644 --- a/docs/en/diagnostics/DuplicateStringLiteral.md +++ b/docs/en/diagnostics/DuplicateStringLiteral.md @@ -1,8 +1,7 @@ # Duplicate string literal (DuplicateStringLiteral) -## Description - +## Diagnostics description It is bad form to use the same string literals multiple times in the same module or method: diff --git a/docs/en/diagnostics/DuplicatedInsertionIntoCollection.md b/docs/en/diagnostics/DuplicatedInsertionIntoCollection.md index aff2ea4e18a..8892dc10cee 100644 --- a/docs/en/diagnostics/DuplicatedInsertionIntoCollection.md +++ b/docs/en/diagnostics/DuplicatedInsertionIntoCollection.md @@ -1,14 +1,19 @@ # Duplicate adding or pasting a value to a collection (DuplicatedInsertionIntoCollection) + ## Description + ## Examples + ## Sources + + When you develop applications, note that not only execution of a code written in the Enterprise mode is unsafe, but also places, where the `Execute` or `Eval` methods are used to execute the code created based on parameters passed to server functions and procedures. -It is forbidden to use the `Execute` and` Eval` methods in server methods of form modules, commands, objects, etc. **This restriction is not applicable to the code being executed on the client** diff --git a/docs/en/diagnostics/ExportVariables.md b/docs/en/diagnostics/ExportVariables.md index e397ca7c284..f1638f08acd 100644 --- a/docs/en/diagnostics/ExportVariables.md +++ b/docs/en/diagnostics/ExportVariables.md @@ -38,4 +38,4 @@ FileObject.Write(); -[Standard: Using global variables in modules (RU)](https://its.1c.ru/db/v8std#content:639:hdoc) +[Standard: Using global variables in modules](https://its.1c.ru/db/v8std#content:639:hdoc) diff --git a/docs/en/diagnostics/ExternalAppStarting.md b/docs/en/diagnostics/ExternalAppStarting.md index 59ae54e2bc5..ac85da9be31 100644 --- a/docs/en/diagnostics/ExternalAppStarting.md +++ b/docs/en/diagnostics/ExternalAppStarting.md @@ -1,23 +1,29 @@ # External applications starting (ExternalAppStarting) + ## Description + + To improve the quality and security of 1C solutions, it is necessary to control the launch of external applications from 1C code. This rule applies to all methods of launching external programs, including: + - System - RunSystem - RunApp - BeginRunningApplication -- RunAppAsync +- ЗапуститьПриложениеАсинх - GotoURL or FileSystems.OpenURL - FileSystemsClient.RunApp (for client side) and FileSystems.RunApp (for server side) - FileSystemClient.OpenExplorer - FileSystemClient.OpenFile ## Examples + + ```bsl Процедура Метод() СтрокаКоманды = ""; @@ -68,11 +74,14 @@ This rule applies to all methods of launching external programs, including: ``` ## Sources + + + - [Standard: Application launch security (RU)](https://its.1c.ru/db/v8std#content:774:hdoc) - Standard: [Restriction on the execution of "external" code (RU)](https://its.1c.ru/db/v8std/content/669/hdoc) diff --git a/docs/en/diagnostics/FieldsFromJoinsWithoutIsNull.md b/docs/en/diagnostics/FieldsFromJoinsWithoutIsNull.md index aae140842b8..908221130cd 100644 --- a/docs/en/diagnostics/FieldsFromJoinsWithoutIsNull.md +++ b/docs/en/diagnostics/FieldsFromJoinsWithoutIsNull.md @@ -1,22 +1,17 @@ # No NULL checks for fields from joined tables (FieldsFromJoinsWithoutIsNull) -## Description +## Diagnostics description -Diagnostics checks fields from left, right, full joins that are not checked with `ISNULL()` or `IS NOT NULL` or `NOT IS NULL` . +Diagnostics checks fields from left, right, full joins that are not validated with `ISNULL()` or `NOT IS NULL` or `IS NOT NULL.

-Queries cannot use attributes from left-join or right-join tables without checking the values for `NULL`. -Such a call can lead to errors if the join condition is not met and there are no matching records in the left or right table. -As a result, as a result of executing the query, you may receive unexpected data and the system may behave in an incorrect way. +

Queries cannot use attributes from left-join or right-join tables without checking the values for NULL`. Such a call can lead to errors if the join condition is not met and there are no matching records in the left or right table. As a result, as a result of executing the query, you may receive unexpected data and the system may behave in an incorrect way. -It is important to remember that any comparison of the value `NULL` with any other expression is always false, even the comparison of `NULL` and `NULL` is always false. -The following are examples of such incorrect comparisons. -It is correct to compare with `NULL` - operator `IS NULL` or function `ISNULL()`. +It is important to remember that any comparison of the value `NULL` with any other expression is always false, even the comparison of `NULL` and `NULL` is always false. The following are examples of such incorrect comparisons. It is correct to compare with `NULL` - operator `IS NULL` or function `ISNULL()`. Left \ right joins are often used, although the data allows an inner join without checking for `NULL`. -Additional checks of field values can be performed in the 1C code, and not in the query text. This makes it difficult to read the code and refactor the code, because the context of the access to the field has to be considered in several places. -It should be remembered that simple checks in a query are performed a little faster and easier than in interpreted 1C code. +Additional checks of field values can be performed in the 1C code, and not in the query text. This makes it difficult to read the code and refactor the code, because the context of the access to the field has to be considered in several places. It should be remembered that simple checks in a query are performed a little faster and easier than in interpreted 1C code. These problems are the most common mistakes made by 1C developers of all skill levels. @@ -24,19 +19,19 @@ These problems are the most common mistakes made by 1C developers of all skill l Example showing NULL comparison problems - joining 2 tables incorrectly and showing different comparison methods ```sdbl -SELECT - CASE - WHEN LeftTable.Fld2 = 0 THEN "Equals 0 - does not work" - WHEN LeftTable.Fld2 <> 0 THEN "NOT Equals 0 - does not work" - WHEN LeftTable.Fld2 = NULL THEN "Equals NULL - does not work" - WHEN LeftTable.Fld2 IS NULL THEN "IS NULL - it works" - WHEN ISNULL(LeftTable.Fld2, 0) = 0 THEN "ISNULL() - and this works too" - ELSE "else" - END +ВЫБРАТЬ + ВЫБОР + КОГДА Левая.Поле2 = 0 ТОГДА "Равно 0 - не работает" + КОГДА Левая.Поле2 <> 0 ТОГДА "НЕ Равно 0 - не работает" + КОГДА Левая.Поле2 = NULL ТОГДА "Равно NULL - не работает" + КОГДА Левая.Поле2 ЕСТЬ NULL ТОГДА "ЕСТЬ NULL - этот вариант работает" + КОГДА ЕСТЬNULL(Левая.Поле2, 0) = 0 ТОГДА "ЕСТЬNULL() - этот вариант также работает" + ИНАЧЕ "Иначе" + КОНЕЦ ИЗ - First AS First - LEFT JOIN LeftTable AS LeftTable - ON FALSE + Первая КАК Первая + ЛЕВОЕ СОЕДИНЕНИЕ Левая КАК Левая + ПО Ложь // чтобы не было соединения ``` Suspicious code for accessing an joined table attribute @@ -48,7 +43,7 @@ Suspicious code for accessing an joined table attribute ЛЕВОЕ СОЕДИНЕНИЕ РегистрНакопления.Продажи КАК РегистрПродажи ПО ДокументыПродажи.Ссылка = РегистрПродажи.Документ ``` -Correct +Right ```sdbl ВЫБРАТЬ ДокументыПродажи.Ссылка КАК ДокПродажи, @@ -57,7 +52,7 @@ Correct ЛЕВОЕ СОЕДИНЕНИЕ РегистрНакопления.Продажи КАК РегистрПродажи ПО ДокументыПродажи.Ссылка = РегистрПродажи.Документ ``` -Also correct: +Also correct ```sdbl ВЫБРАТЬ ДокументыПродажи.Ссылка КАК ДокПродажи, @@ -80,19 +75,18 @@ Possible variant РегистрПродажи.Документ ЕСТЬ НЕ NULL //или НЕ РегистрПродажи.Документ ЕСТЬ NULL ``` -The last one is not the best, because it actually emulates an inner join. -It is more correct to explicitly specify `INNER JOIN` instead of using a left join with a `IS NOT NULL` or `NOT IS NULL` check +The last one is not the best, because it actually emulates an inner join. It is more correct to explicitly specify `INNER JOIN` instead of using a left join with a `IS NOT NULL` or `NOT IS NULL` check ## Sources * [Standard: Using the ISNULL function (RU)](https://its.1c.ru/db/metod8dev/content/2653/hdoc) -* [Guidelines: The concept of "empty" values (RU)](https://its.1c.ru/db/metod8dev/content/2614/hdoc/_top/%D0%B5%D1%81%D1%82%D1%8C%20null) - * [Guidelines: What is the difference between a value of type Undefined and a value of type Null? (RU)](https://its.1c.ru/db/metod8dev#content:2516:hdoc) +* [Понятие "пустых" значений - Методические рекомендации 1С](https://its.1c.ru/db/metod8dev/content/2614/hdoc/_top/%D0%B5%D1%81%D1%82%D1%8C%20null) + * [Guidelines: What is the difference between a value of type Undefined and a value of type Null? - Guidelines 1C](https://its.1c.ru/db/metod8dev#content:2516:hdoc) * [Methodical recommendations: Peculiarities of communication with the virtual table of residuals (RU)](https://its.1c.ru/db/metod8dev/content/2657/hdoc/_top/%D0%B5%D1%81%D1%82%D1%8C%20null) * [Standard: Sorting by query field that can potentially contain NULL. The article "Ordering query results" (RU)](https://its.1c.ru/db/v8std/content/412/hdoc/_top/%D0%B5%D1%81%D1%82%D1%8C%20null) * [Methodological recommendations: Fields of a hierarchical directory can contain NULL (RU)](https://its.1c.ru/db/metod8dev/content/2649/hdoc/_top/%D0%B5%D1%81%D1%82%D1%8C%20null) diff --git a/docs/en/diagnostics/FileSystemAccess.md b/docs/en/diagnostics/FileSystemAccess.md index 8d42717a40a..a4d6b7bbf39 100644 --- a/docs/en/diagnostics/FileSystemAccess.md +++ b/docs/en/diagnostics/FileSystemAccess.md @@ -1,14 +1,20 @@ # File system access (FileSystemAccess) + ## Description + -It is important to review your code. Be sure to pay attention to accessing the file system and using “external code” + +При код-ревью или аудите кода необходимо проверять обращения к файлам, каталогам и набор действий, выполняемых с ними, для исключения передачи конфиденциальной или защищенной информации, а также для исключения деструктивных действий с файловой системой. +Важно проверять код от сторонних разработчиков, подрядчиков, из различных интернет-сервисов, каталогов и т.п. The found sections of the code must be analyzed, a manual audit of the code must be performed for its correctness and safety. ## Examples + + ```bsl Текст = Новый ЧтениеТекста(ПутьФайла, КодировкаТекста.ANSI); // есть замечание Текст = Новый ЗаписьТекста(ПутьФайла, КодировкаТекста.ANSI); // есть замечание @@ -27,12 +33,15 @@ The found sections of the code must be analyzed, a manual audit of the code must ``` ## Sources + + -* [File system access from application code (RU)](https://its.1c.ru/db/v8std#content:542:hdoc) -* [Standard: Application launch security (RU)](https://its.1c.ru/db/v8std#content:774:hdoc) -* [Safe operation - Developer's Guide (RU](https://its.1c.ru/db/v8323doc#bookmark:dev:TI000000186) + +- [File system access from application code (RU)](https://its.1c.ru/db/v8std#content:542:hdoc) +- [Standard: Application launch security (RU)](https://its.1c.ru/db/v8std#content:774:hdoc) +- [Safe operation - Developer's Guide (RU](https://its.1c.ru/db/v8323doc#bookmark:dev:TI000000186) diff --git a/docs/en/diagnostics/ForbiddenMetadataName.md b/docs/en/diagnostics/ForbiddenMetadataName.md index f37d83f8b8f..0c8f76019eb 100644 --- a/docs/en/diagnostics/ForbiddenMetadataName.md +++ b/docs/en/diagnostics/ForbiddenMetadataName.md @@ -1,7 +1,7 @@ # Metadata object has a forbidden name (ForbiddenMetadataName) -## Description +## Diagnostics description It is forbidden to use the names of metadata objects (and their attributes and tabular sections), which are used when naming query tables (for example, Document, Catalog). @@ -20,7 +20,7 @@ Wrong name * [Standard: Organization of data storage (RU). Name, Synonym, Comment](https://its.1c.ru/db/v8std#content:474:hdoc:2.5) diff --git a/docs/en/diagnostics/FormDataToValue.md b/docs/en/diagnostics/FormDataToValue.md index 411bbeb6fe6..56d3c8c02ef 100644 --- a/docs/en/diagnostics/FormDataToValue.md +++ b/docs/en/diagnostics/FormDataToValue.md @@ -17,4 +17,4 @@ EndProcedure ## Sources -Source: [Using of FormAttributeToValue and FormDataToValue methods (RU)](https://its.1c.ru/db/v8std#content:409:hdoc) +Source: [Using of FormAttributeToValue and FormDataToValue methods](https://its.1c.ru/db/v8std#content:409:hdoc) diff --git a/docs/en/diagnostics/FullOuterJoinQuery.md b/docs/en/diagnostics/FullOuterJoinQuery.md index ba947d3d794..60746419ec5 100644 --- a/docs/en/diagnostics/FullOuterJoinQuery.md +++ b/docs/en/diagnostics/FullOuterJoinQuery.md @@ -27,5 +27,5 @@ EndProcedure ## Sources -* [Restricting the use of the "FULL OUTER JOINT" construct in queries (RU)](https://its.1c.ru/db/v8std#content:435:hdoc) -* [Administrator's Guide: Peculiarities of Using PostgreSQL (RU)](https://its.1c.ru/db/metod8dev#content:1556:hdoc) +* [Ограничение на использование конструкции "ПОЛНОЕ ВНЕШНЕЕ СОЕДИНЕНИЕ" в запросах (RU)](https://its.1c.ru/db/v8std#content:435:hdoc) +* [Руководство администратора, особенности использования PostgreSQL (RU)](https://its.1c.ru/db/metod8dev#content:1556:hdoc) diff --git a/docs/en/diagnostics/FunctionNameStartsWithGet.md b/docs/en/diagnostics/FunctionNameStartsWithGet.md index c1e8081526e..0682d42dc4a 100644 --- a/docs/en/diagnostics/FunctionNameStartsWithGet.md +++ b/docs/en/diagnostics/FunctionNameStartsWithGet.md @@ -7,7 +7,7 @@ In the name of the function, the word get superfluous since function by definiti ## Examples ```bsl -// Incorrect: +// Not correct: Function GetNameByCode() // Correct: @@ -16,4 +16,4 @@ Function NameByCode() ## Sources -* Source: [Standard: Names of procedures and functions c 6.1 (RU)](https://its.1c.ru/db/v8std#content:647:hdoc) +* Source: [Standard: Names of procedures and functions c 6.1](https://its.1c.ru/db/v8std#content:647:hdoc) diff --git a/docs/en/diagnostics/FunctionOutParameter.md b/docs/en/diagnostics/FunctionOutParameter.md index b1351c5513d..1d200a36fe8 100644 --- a/docs/en/diagnostics/FunctionOutParameter.md +++ b/docs/en/diagnostics/FunctionOutParameter.md @@ -10,14 +10,14 @@ The function must have no output parameters. All output must be in the return va ```bsl -// Incorrect: +// Wrong: ServiceURL = ""; UserName = ""; UserPassword = ""; FillConnectionParameters(ServiceURL, UserName, UserPassword); -// Correct: +// Correctly: ConnectionParameters = NewConnectionParameters(); // Returned value - Structure: // Service URL - String diff --git a/docs/en/diagnostics/GetFormMethod.md b/docs/en/diagnostics/GetFormMethod.md index c025d1618a6..168c5ea359b 100644 --- a/docs/en/diagnostics/GetFormMethod.md +++ b/docs/en/diagnostics/GetFormMethod.md @@ -3,19 +3,15 @@ ## Description - To open forms, use the OpenForm global context method (when using the 1C: Enterprise 8.2 platform version and earlier versions, also use OpenFormModal). An alternative method, using the GetForm method, is not recommended. - ## Examples - ```bsl Procedure Test() Doc = Documents.PlanOperation.CreateDocument(); Form = Doc.GetForm("DocumentForm"); // here EndProcedure ``` - ```bsl Procedure Test2() Form = GetForm("CommonForms.MyForm"); @@ -25,4 +21,4 @@ EndProcedure ## Sources -Source: [Development standards (RU)](https://its.1c.ru/db/v8std/content/404/hdoc) +Source: [Standard](https://its.1c.ru/db/v8std/content/404/hdoc) diff --git a/docs/en/diagnostics/GlobalContextMethodCollision8312.md b/docs/en/diagnostics/GlobalContextMethodCollision8312.md index a36ead7c314..c7e5f7b1d1f 100644 --- a/docs/en/diagnostics/GlobalContextMethodCollision8312.md +++ b/docs/en/diagnostics/GlobalContextMethodCollision8312.md @@ -6,18 +6,18 @@ The platform version `8.3.12` implements new methods of the global context, which may coincide with the configuration functions of the application solution. -Russian variant|English variant -:-: | :-: -ПроверитьБит|CheckBit -ПроверитьПоБитовойМаске|CheckByBitMask -УстановитьБит|SetBit -ПобитовоеИ|BitwiseAnd -ПобитовоеИли|BitwiseOr -ПобитовоеНе|BitwiseNot -ПобитовоеИНе|BitwiseAndNot -ПобитовоеИсключительноеИли|BitwiseXor -ПобитовыйСдвигВлево|BitwiseShiftLeft -ПобитовыйСдвигВправо|BitwiseShiftRight +| Russian variant | English variant | +|:--------------------------:|:-----------------:| +| ПроверитьБит | CheckBit | +| ПроверитьПоБитовойМаске | CheckByBitMask | +| УстановитьБит | SetBit | +| ПобитовоеИ | BitwiseAnd | +| ПобитовоеИли | BitwiseOr | +| ПобитовоеНе | BitwiseNot | +| ПобитовоеИНе | BitwiseAndNot | +| ПобитовоеИсключительноеИли | BitwiseXor | +| ПобитовыйСдвигВлево | BitwiseShiftLeft | +| ПобитовыйСдвигВправо | BitwiseShiftRight | The configuration functions must either be renamed or deleted, replacing the call to them with the methods of the global context. @@ -32,4 +32,4 @@ The configuration functions must either be renamed or deleted, replacing the cal * Полезная информация: [Отказ от использования модальных окон](https://its.1c.ru/db/metod8dev#content:5272:hdoc) * Источник: [Cognitive complexity, ver. 1.4](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) --> -* [Transfer of configurations to the 1C: Enterprise 8.3 platform without compatibility mode with version 8.2 (RU)](https://its.1c.ru/db/metod8dev#content:5293:hdoc:pereimenovaniya_metodov_i_svojstv) +* Source: [Migration configuration to the "1C: Enterprise 8.3" platform without the compatibility mode with version 8.2 ](https://its.1c.ru/db/metod8dev#content:5293:hdoc:pereimenovaniya_metodov_i_svojstv) diff --git a/docs/en/diagnostics/IncorrectUseLikeInQuery.md b/docs/en/diagnostics/IncorrectUseLikeInQuery.md index f4592f99ce2..0e32527dbaa 100644 --- a/docs/en/diagnostics/IncorrectUseLikeInQuery.md +++ b/docs/en/diagnostics/IncorrectUseLikeInQuery.md @@ -70,4 +70,4 @@ Query.SetParameter("NameTemplate", "FU_"); * Полезная информация: [Отказ от использования модальных окон](https://its.1c.ru/db/metod8dev#content:5272:hdoc) * Источник: [Cognitive complexity, ver. 1.4](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) --> -- [Standard. Features of use in operator requests LIKE (RU)](https://its.1c.ru/db/v8std/content/726/hdoc?ysclid=l3g3fkmxsx) +- Standard. Features of use in operator requests LIKE (RU) diff --git a/docs/en/diagnostics/IncorrectUseOfStrTemplate.md b/docs/en/diagnostics/IncorrectUseOfStrTemplate.md index 744e14b30c2..83b9a129e24 100644 --- a/docs/en/diagnostics/IncorrectUseOfStrTemplate.md +++ b/docs/en/diagnostics/IncorrectUseOfStrTemplate.md @@ -21,8 +21,7 @@ Option 2 - no values are passed at all, except for a formatted string due to the - `StrTemplate(NStr("en='Name (version %1)'", Version()));` -Here mistake not closed parenthesis for `NStr`. As a result, the expression after evaluating `NStr` becomes empty. -It is rather difficult to detect such an error by reading the code due to the presence of parentheses. And you can only catch it at runtime by getting an exception. +Here mistake not closed parenthesis for `NStr. As a result, the expression after evaluating NStr` becomes empty. It is rather difficult to detect such an error by reading the code due to the presence of parentheses. And you can only catch it at runtime by getting an exception. Correct option - `StrTemplate(NStr("en='Name (version %1)'"), Version());` @@ -38,4 +37,4 @@ Option 3 - correct example of passing digits immediately after a template value * Полезная информация: [Отказ от использования модальных окон](https://its.1c.ru/db/metod8dev#content:5272:hdoc) * Источник: [Cognitive complexity, ver. 1.4](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) --> -- [Standard: Localization Requirements (RU)](https://its.1c.ru/db/v8std/content/763/hdoc) +- [Standard: Localization Requirements](https://its.1c.ru/db/v8std/content/763/hdoc) diff --git a/docs/en/diagnostics/InternetAccess.md b/docs/en/diagnostics/InternetAccess.md index ffbd2238150..311e82d9284 100644 --- a/docs/en/diagnostics/InternetAccess.md +++ b/docs/en/diagnostics/InternetAccess.md @@ -1,19 +1,26 @@ # Referring to Internet resources (InternetAccess) + ## Description + + Check access to Internet resources and the set of transmitted data to prevent the transfer of confidential or protected information. ## Examples + + ```bsl HTTPConnection = New HTTPConnection("zabbix.localhost", 80); // error FTPConnection = New FTPConnection(Server, Port, User, Pwd); // error ``` ## Sources + + -* Standard: [Checking access rights (RU)](https://its.1c.ru/db/v8std#content:737:hdoc) +* Standard: [Checking access rights](https://its.1c.ru/db/v8std#content:737:hdoc) diff --git a/docs/en/diagnostics/LineLength.md b/docs/en/diagnostics/LineLength.md index dfdc54ab176..c7584a4c350 100644 --- a/docs/en/diagnostics/LineLength.md +++ b/docs/en/diagnostics/LineLength.md @@ -7,4 +7,4 @@ If the line length is grater than 120 characters you should you line break. It i ## Sources -* Source: [Standard: Modules (RU)](https://its.1c.ru/db/v8std#content:456:hdoc) +* [Standard: Modules texts(RU)](https://its.1c.ru/db/v8std#content:456:hdoc) diff --git a/docs/en/diagnostics/LogicalOrInJoinQuerySection.md b/docs/en/diagnostics/LogicalOrInJoinQuerySection.md index 97478f50e35..4e63ba0ed31 100644 --- a/docs/en/diagnostics/LogicalOrInJoinQuerySection.md +++ b/docs/en/diagnostics/LogicalOrInJoinQuerySection.md @@ -1,7 +1,9 @@ # Logical 'OR' in 'JOIN' query section (LogicalOrInJoinQuerySection) + ## Description + Diagnostics reveals the use of the `OR` operator in the conditions of table joins. The presence of the `OR` operators in connection conditions may cause the DBMS to be unable to use @@ -12,8 +14,10 @@ The error can be solved by "spreading" the predicates of the condition with `OR` IMPORTANT: Diagnostics monitors the presence of predicates in the condition `OR`, over various fields, since the use of the operator `OR` When executing a query on the SQL side, the control over the variants of one field is automatically converted to the IN condition. + ## Examples -1) The error will not be fixed when using `OR` over variants of a single field. + +1. The error will not be fixed when using `OR` over variants of a single field. ```bsl LEFT JOIN Catalog.NomenclatureTypes КАК NomenclatureTypes @@ -21,58 +25,61 @@ LEFT JOIN Catalog.NomenclatureTypes КАК NomenclatureTypes AND (CatalogNomenclature.ExpirationDate > 1 OR CatalogNomenclature.ExpirationDate < 10) ``` -2) When using the `OR` operator over various fields, the error will be fixed for each occurrence of the operator. -```bsl -INNER JOIN Document.GoodsServicesSaling КАК GoodsServicesSaling -ON GoodsServicesSalingGoods.Reference = GoodsServicesSaling.Reference - AND (GoodsServicesSalingGoods.Amount > 0 - OR GoodsServicesSalingGoods.AmountVAT > 0 - OR GoodsServicesSalingGoods.AmountWithVAT > 0) +2. When using the `OR` operator over various fields, the error will be fixed for each occurrence of the operator. +```bsl +ВНУТРЕННЕЕ СОЕДИНЕНИЕ Документ.РеализацияТоваровУслуг КАК РеализацияТоваровУслуг +ПО РеализацияТоваровУслугТовары.Ссылка = РеализацияТоваровУслуг.Ссылка + И (РеализацияТоваровУслугТовары.Сумма > 0 + ИЛИ РеализацияТоваровУслугТовары.СуммаНДС > 0 + ИЛИ РеализацияТоваровУслугТовары.СуммаСНДС > 0) + ``` It is proposed to correct such constructions by placing requests in separate packages with combining: ```bsl -SELECT * -FROM -INNER JOIN Document.GoodsServicesSaling КАК GoodsServicesSaling -ON GoodsServicesSalingGoods.Reference = GoodsServicesSaling.Reference - AND GoodsServicesSalingGoods.Amount > 0 - -UNION ALL - -SELECT * -FROM -INNER JOIN Document.GoodsServicesSaling КАК GoodsServicesSaling -ON GoodsServicesSalingGoods.Reference = GoodsServicesSaling.Reference - AND GoodsServicesSalingGoods.AmountVAT > 0 - -UNION ALL - -SELECT * -FROM -INNER JOIN Document.GoodsServicesSaling КАК GoodsServicesSaling -ON GoodsServicesSalingGoods.Reference = GoodsServicesSaling.Reference - AND GoodsServicesSalingGoods.AmountWithVAT > 0 +ВЫБРАТЬ * +ИЗ +ВНУТРЕННЕЕ СОЕДИНЕНИЕ Документ.РеализацияТоваровУслуг КАК РеализацияТоваровУслуг +ПО РеализацияТоваровУслугТовары.Ссылка = РеализацияТоваровУслуг.Ссылка + И РеализацияТоваровУслугТовары.Сумма > 0 + +ОБЪЕДИНИТЬ ВСЕ + +ВЫБРАТЬ * +ИЗ +ВНУТРЕННЕЕ СОЕДИНЕНИЕ Документ.РеализацияТоваровУслуг КАК РеализацияТоваровУслуг +ПО РеализацияТоваровУслугТовары.Ссылка = РеализацияТоваровУслуг.Ссылка + И РеализацияТоваровУслугТовары.СуммаНДС > 0 + +ОБЪЕДИНИТЬ ВСЕ + +ВЫБРАТЬ * +ИЗ +ВНУТРЕННЕЕ СОЕДИНЕНИЕ Документ.РеализацияТоваровУслуг КАК РеализацияТоваровУслуг +ПО РеализацияТоваровУслугТовары.Ссылка = РеализацияТоваровУслуг.Ссылка + И РеализацияТоваровУслугТовары.СуммаСНДС > 0 ``` -3) Diagnostics will also work for nested connections using `OR` in conditions. +3. Diagnostics will also work for nested connections using `OR` in conditions. ```bsl -Document.GoodsServicesSaling.Goods КАК GoodsServicesSalingGoods -INNER JOIN Document.GoodsServicesSaling КАК GoodsServicesSaling -ON GoodsServicesSalingGoods.Reference = GoodsServicesSaling.Reference -LEFT JOIN Catalog.Nomenclature КАК CatalogNomenclature - LEFT JOIN Catalog.NomenclatureTypes КАК NomenclatureTypes - ON CatalogNomenclature.NomenclatureType = NomenclatureTypes.Reference - AND (CatalogNomenclature.ExpirationDate > 1 - OR NomenclatureTypes.SaleThroughAPatentIsProhibited = TRUE) - +Документ.РеализацияТоваровУслуг.Товары КАК РеализацияТоваровУслугТовары +ВНУТРЕННЕЕ СОЕДИНЕНИЕ Документ.РеализацияТоваровУслуг КАК РеализацияТоваровУслуг +ПО РеализацияТоваровУслугТовары.Ссылка = РеализацияТоваровУслуг.Ссылка +ЛЕВОЕ СОЕДИНЕНИЕ Справочник.Номенклатура КАК СправочникНоменклатура + ЛЕВОЕ СОЕДИНЕНИЕ Справочник.ВидыНоменклатуры КАК ВидыНоменклатуры //Тест работы на вложенном соединении + ПО СправочникНоменклатура.ВидНоменклатуры = ВидыНоменклатуры.Ссылка + И (СправочникНоменклатура.СрокГодности > 1 + ИЛИ ВидыНоменклатуры.ЗапрещенаПродажаЧерезПатент = ИСТИНА) + ``` + A fix similar to paragraph 2 is recommended by replacing the nested connection with a connection with the creation of an intermediate temporary table. ## Sources + - [Standard: Effective Query Conditions, Clause 2 (RU)](https://its.1c.ru/db/v8std/content/658/hdoc) - [Typical Causes of Suboptimal Query Performance and Optimization Techniques: Using Logical OR in Conditions (RU)](https://its.1c.ru/db/content/metod8dev/src/developers/scalability/standards/i8105842.htm#or) diff --git a/docs/en/diagnostics/LogicalOrInTheWhereSectionOfQuery.md b/docs/en/diagnostics/LogicalOrInTheWhereSectionOfQuery.md index b18343af43b..9a89bf80eb0 100644 --- a/docs/en/diagnostics/LogicalOrInTheWhereSectionOfQuery.md +++ b/docs/en/diagnostics/LogicalOrInTheWhereSectionOfQuery.md @@ -2,48 +2,39 @@ ## Description - -Не следует использовать `ИЛИ` в секции `ГДЕ` запроса. Это может привести к тому, что СУБД не сможет использовать -индексы таблиц и будет выполнять сканирование, что увеличит время работы запроса и вероятность возникновения блокировок. -Вместо этого следует разбить один запрос на несколько и объединить результаты. +Do not use `OR` in the `WHERE` section of the query. Это может привести к тому, что СУБД не сможет использовать индексы таблиц и будет выполнять сканирование, что увеличит время работы запроса и вероятность возникновения блокировок. Instead, you should split one query into several and combine the results. -## Примеры +## Examples For example, query: ```bsl -SELECT Goods.Description FROM Catalog.Goods AS Goods -WHERE Code = "001" OR Cost = 10 +SELECT Item.Name FROM Directory.Products AS Item +WHERE Article = "001" OR Price = 10 ``` should instead of a query: ```bsl -SELECT Goods.Description FROM Catalog.Goods AS Goods -WHERE Code = "001" - +SELECT Product.Name FROM Directory.Products AS Product WHERE Article = "001" UNION ALL - -SELECT Goods.Description FROM Catalog.Goods AS Goods -WHERE Cost = 10 - +SELECT Product.Name FROM Directory.Products AS Product WHERE Price = 10 ``` +> **Important** - the current diagnostic implementation triggers any `OR` in the `WHERE` section and may give false positives for some conditions. ->**Important** - the current implementation of the diagnostic triggers on any `OR` in the `WHERE` section and may issue false positives for some conditions. - -1) In the main condition, the `OR` operator can only be used for the last used or the only index field, when the `OR` operator can be replaced by the `IN` operator. +1) In the main condition, the `OR` operator can be used only for the last used or the only index field, when the `OR` operator can be replaced with the `IN` operator. Correct: ```bsl WHERE - Table.Filed = &Value1 - OR Table.Filed = &Value2 + Table.Field = &Value1 + OR Table.Field = &Value2 ``` -because can be rewritten using the `IN` operator (you don’t need to specifically rewrite it, you can leave it as it is): +since can be rewritten using the `IN` operator (you don't need to rewrite it specifically, you can leave it as it is): ```bsl WHERE @@ -54,55 +45,54 @@ Incorrect: ```bsl WHERE - Table.Field1 = &Value1 - OR Table.Field2 = &Value2 + Table.Field1 = &Value1 + OR Table.Field2 = &Value2 ``` -cannot be rewritten with `IN`, but can be rewritten with `UNION ALL` (each Field1 and Field2 must be indexed): +cannot be overwritten with `IN`, but can be overwritten with `UNION ALL` (each field Field1 and Field2 must be indexed): ```bsl WHERE - Table.Field1 = &Value1 + Table.Field1 = &Value1 -UNION ALL +ОБЪЕДИНИТЬ ВСЕ WHERE - Table.Field2 = &Value1 + Table.Field2 = &Value1 ``` +> Note: replacing `OR` with `UNION ALL` is not always possible, make sure the result is indeed the same as `OR` before use. ->Note: it is not always possible to replace `OR` with `UNION ALL`, make sure the result is really the same as with `OR` before applying. - -2) Additionally, the 'OR' operator can be used without restriction. +2) In an additional condition, the OR operator can be used without restrictions. Correct: ```bsl WHERE - Table.Filed1 = &Value1 // Main condition (use index) - AND // Addition condition (can use OR) - (Table.Filed2 = &Value2 OR Table.Filed3 = &Value3) + Table.Field1 = &Value1 // Main condition (uses index) + AND // Additional condition (you can use OR) + (Table.Field2 = &Value2 OR Table.Field3 = &Value3) ``` Correct: ```bsl WHERE - (Table.Filed1 = &Value1 OR Table.Filed1 = &Value2) - AND - (Table.Filed2 = &Value3 OR Table.Filed2 = &Value4) + (Table.Field1 = &Value1 OR Table.Field1 = &Value2) + AND + (Table.Field2 = &Value3 OR Table.Field2 = &Value4) ``` -because can be rewritten using 'IN' (no special rewriting needed, can be left as is): +since can be rewritten using the IN operator (you don't need to rewrite it specifically, you can leave it as it is): ```bsl WHERE - Table.Field1 IN (&Value1) // Main condition - AND Table.Field2 IN (&Value2) // Additional condition (or vice versa) + Table.Field1 B (&Values1) // Main condition + AND Table.Field2 B (&Values2) // Additional condition (or vice versa) ``` ## Sources -- [Standard: Effective Query Conditions, Clause 2 (RU)](https://its.1c.ru/db/v8std/content/658/hdoc) -- [Typical Causes of Suboptimal Query Performance and Optimization Techniques: Using Logical OR in Conditions (RU)](https://its.1c.ru/db/content/metod8dev/src/developers/scalability/standards/i8105842.htm#or) -- [Article on Habr: Interesting analysis of SQL queries in various DBMS (not about 1C) (RU)](https://m.habr.com/ru/company/lsfusion/blog/463095/) +- [Standard - Effective Query Conditions, Clause 2](https://its.1c.ru/db/v8std/content/658/hdoc) +- [Using Logical OR in Conditions - Typical Causes of Suboptimal Query Performance and Optimization Techniques](https://its.1c.ru/db/content/metod8dev/src/developers/scalability/standards/i8105842.htm#or) +- [Interesting analysis of SQL queries in various DBMS (not about 1C) - Article on Habr](https://m.habr.com/ru/company/lsfusion/blog/463095/) diff --git a/docs/en/diagnostics/MagicDate.md b/docs/en/diagnostics/MagicDate.md index d190366d1c4..4cf6533fe00 100644 --- a/docs/en/diagnostics/MagicDate.md +++ b/docs/en/diagnostics/MagicDate.md @@ -23,8 +23,7 @@ If now < PredictedDate Then EndIf; ``` -Also, a good solution is to use a special method with "telling name" that returns -constant +Also, a good solution is to use a special method with "telling name" that returns constant ```bsl Function DateInventionHover() diff --git a/docs/en/diagnostics/MethodSize.md b/docs/en/diagnostics/MethodSize.md index 3264f781b64..85c32648b3b 100644 --- a/docs/en/diagnostics/MethodSize.md +++ b/docs/en/diagnostics/MethodSize.md @@ -11,9 +11,9 @@ There are two rules for refactoring a large method: - If when writing a method you want to add a comment to the code, you must put this functionality in a separate method - If the method takes more than 50-100 lines of code, you should determine the tasks and subtasks that it performs and try to put the subtasks in a separate method -## Sources +## Reference - [Software Architecture Refactoring: Layering](http://citforum.ru/SE/project/refactor/) - [Martin Fowler: Refactoring](https://www.refactoring.com/) -- [Refactoring and opt-out tools (RU)](https://v8.1c.ru/o7/201312ref/index.htm) -- [Refactoring tools in 1C (RU)](https://www.koderline.ru/expert/programming/article-vspomogatelnye-funktsii-v-1s/#anchor6) +- [Refactoring and opt-out tools](https://v8.1c.ru/o7/201312ref/index.htm) +- [Refactoring tools in 1C](https://www.koderline.ru/expert/programming/article-vspomogatelnye-funktsii-v-1s/#anchor6) diff --git a/docs/en/diagnostics/MissedRequiredParameter.md b/docs/en/diagnostics/MissedRequiredParameter.md index 1c260e27cd0..02e8a895841 100644 --- a/docs/en/diagnostics/MissedRequiredParameter.md +++ b/docs/en/diagnostics/MissedRequiredParameter.md @@ -1,12 +1,15 @@ # Missed a required method parameter (MissedRequiredParameter) + ## 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 diff --git a/docs/en/diagnostics/MissingCodeTryCatchEx.md b/docs/en/diagnostics/MissingCodeTryCatchEx.md index d9bfa58cb24..54742f4fdce 100644 --- a/docs/en/diagnostics/MissingCodeTryCatchEx.md +++ b/docs/en/diagnostics/MissingCodeTryCatchEx.md @@ -5,7 +5,7 @@ It is unacceptable to catch any exception, without any trace for system administrator. -*Incorrect* +*Wrong* ```bsl Try @@ -18,7 +18,7 @@ EndTry; As a rule, such a design hides a real problem, which is subsequently impossible to diagnose. -*Correct* +*Right* ```bsl Try diff --git a/docs/en/diagnostics/MissingCommonModuleMethod.md b/docs/en/diagnostics/MissingCommonModuleMethod.md index ee61d21f3a9..12a7872ddfd 100644 --- a/docs/en/diagnostics/MissingCommonModuleMethod.md +++ b/docs/en/diagnostics/MissingCommonModuleMethod.md @@ -1,21 +1,30 @@ # Referencing a missing common module method (MissingCommonModuleMethod) + ## Description + + Diagnostics detects erroneous calls to methods of common modules. -Detects the following errors +Находятся проблемные варианты + - method does not exist in the specified common module - method is in the common module, but it is not exported - if a common module has no source code, then all calls to its methods are marked as erroneous -Excluded +Исключаются варианты + - the variable name is the same as the common module name + ## Examples + ## Sources + + -* Standart: [Procedures and functions description (RU)](https://its.1c.ru/db/v8std#content:453:hdoc) +* Standart: Procedures and functions description diff --git a/docs/en/diagnostics/MissingReturnedValueDescription.md b/docs/en/diagnostics/MissingReturnedValueDescription.md index c6bd3beb5b8..f285808380b 100644 --- a/docs/en/diagnostics/MissingReturnedValueDescription.md +++ b/docs/en/diagnostics/MissingReturnedValueDescription.md @@ -26,4 +26,4 @@ Diagnostics detects typical errors: * Полезная информация: [Отказ от использования модальных окон](https://its.1c.ru/db/metod8dev#content:5272:hdoc) * Источник: [Cognitive complexity, ver. 1.4](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) --> -* Standart: [Procedures and functions description (RU)](https://its.1c.ru/db/v8std#content:453:hdoc) +* Standart: [Procedures and functions description](https://its.1c.ru/db/v8std#content:453:hdoc) diff --git a/docs/en/diagnostics/MissingSpace.md b/docs/en/diagnostics/MissingSpace.md index 578292e666b..48f624f5a69 100644 --- a/docs/en/diagnostics/MissingSpace.md +++ b/docs/en/diagnostics/MissingSpace.md @@ -1,4 +1,4 @@ -# Missing spaces to the left or right of operators + - * / = % < > <> <= >=, keywords, and also to the right of , and ; (MissingSpace) +# Missing spaces to the left or right of operators `+ - * / = % < > <> <= >=`, keywords, and also to the right of `,` and `;` (MissingSpace) ## Description diff --git a/docs/en/diagnostics/MissingTempStorageDeletion.md b/docs/en/diagnostics/MissingTempStorageDeletion.md index 913eec8739c..1ec2b8795a4 100644 --- a/docs/en/diagnostics/MissingTempStorageDeletion.md +++ b/docs/en/diagnostics/MissingTempStorageDeletion.md @@ -1,14 +1,5 @@ -# Missing temporary storage data deletion after using (MissingTempStorageDeletion) - - -## Description - # Отсутствует удаление данных из временного хранилища после использования (MissingTempStorageDeletion) -| Type | Scope | Severity | Activated by default | Minutes
to fix | Tags | -|:------------:|:-------------------:|:----------:|:--------------------:|:------------------------:|:--------------------------------------------------------:| -| `Code smell` | `BSL`
`OS` | `Critical` | `No` | `3` | `standard`
`performance`
`badpractice` | - ## Diagnostics description @@ -29,7 +20,7 @@ Remember that when a value is retrieved from the temporary storage on the server ## Examples - + 1 - Example of correct code: ```bsl &НаКлиенте @@ -51,11 +42,11 @@ Remember that when a value is retrieved from the temporary storage on the server 2 - Consider this recommendation when working with background jobs -Incorrect: +Wrong: - Each time a background job is executed, its result is placed in temporary storage for the lifetime of the form: ```bsl -Parameters = LongOperations.FunctionParameters(UUID); -LongOperations.ExecFunction(Pframeters, BackgroundJobParameter); +ПараметрыВыполнения = ДлительныеОперации.ПараметрыВыполненияФункции(УникальныйИдентификатор); +ДлительныеОперации.ВыполнитьФункцию(ПараметрыВыполнения, ПараметрФоновогоЗадания); ``` - If a long operation is performed by the user multiple times, then temporary storage accumulates, which causes an increase in memory consumption. @@ -69,10 +60,10 @@ Correct: - If the result of a background job needs to be saved over several server calls, then it is necessary to transfer a fixed address of a previously initialized temporary storage: ```bsl -&AtServer +&НаСервере Процедура ПриСозданииНаСервере(Отказ) АдресРезультатаФоновогоЗадания = ПоместитьВоВременноеХранилище(Неопределено, УникальныйИдентификатор); // Резервируем адрес временного хранилища -EndProcedure +КонецПроцедуры &НаСервере Функция НачатьПоискНастроекУчетнойЗаписи() @@ -82,7 +73,7 @@ EndProcedure Возврат ДлительныеОперации.ВыполнитьФункцию(ПараметрыВыполнения, "Справочники.УчетныеЗаписиЭлектроннойПочты.ОпределитьНастройкиУчетнойЗаписи", АдресЭлектроннойПочты, Пароль); -EndFunction +КонецФункции ``` 3 - Another example of preliminary initialization of temporary storage for reuse diff --git a/docs/en/diagnostics/MissingTemporaryFileDeletion.md b/docs/en/diagnostics/MissingTemporaryFileDeletion.md index 5d647e3cdb0..d93d8a7d49a 100644 --- a/docs/en/diagnostics/MissingTemporaryFileDeletion.md +++ b/docs/en/diagnostics/MissingTemporaryFileDeletion.md @@ -3,8 +3,7 @@ ## Description -After you finished working with temporary file or folder, you need to delete it yourself. -You should not rely on automatic deletion of files and folders before platform start. This can cause temp folder free space shortage. +After you finished working with temporary file or folder, you need to delete it yourself. You should not rely on automatic deletion of files and folders before platform start. This can cause temp folder free space shortage. ## Examples @@ -16,7 +15,7 @@ Data.Write(TempFileName); // Not delete temporary file ``` -Correct: +Сorrect: ```bsl TempFileName = GetTempFileName("xml"); @@ -33,7 +32,7 @@ Catch EndTry; ``` -## Nuances +## Peculiarities Diagnostics determines the correctness of working with temporary files by the presence of methods for deleting or moving. @@ -49,4 +48,4 @@ and so on. ## Sources -* [File system access from application code (RU)](https://its.1c.ru/db/v8std#content:542:hdoc) +* [File system access from application code](https://its.1c.ru/db/v8std#content:542:hdoc) diff --git a/docs/en/diagnostics/MissingVariablesDescription.md b/docs/en/diagnostics/MissingVariablesDescription.md index 6ccbf98337f..9be9b881645 100644 --- a/docs/en/diagnostics/MissingVariablesDescription.md +++ b/docs/en/diagnostics/MissingVariablesDescription.md @@ -26,4 +26,4 @@ Var Context; ## Sources -* Source: [Standard: Module structure (RU)](https://its.1c.ru/db/v8std#content:455:hdoc) +* Reference: [Code conventions. Module structure](https://its.1c.ru/db/v8std#content:455:hdoc) diff --git a/docs/en/diagnostics/MultilineStringInQuery.md b/docs/en/diagnostics/MultilineStringInQuery.md index 9ea98cce49f..893892c7527 100644 --- a/docs/en/diagnostics/MultilineStringInQuery.md +++ b/docs/en/diagnostics/MultilineStringInQuery.md @@ -12,15 +12,15 @@ Multi-line literals are rarely used in query texts, mostly these are error resul In the example below, the selection will have two fields instead of three. ```bsl -Query = New Query; -Query.Text = "SELECT -| OrderGoods.Cargo AS Cargo, -| ISNULL(OrderGoods.Cargo.Code, "") AS CargoCode, // quote error here, should be """" -| ISNULL(OrderGoods.Cargo.Name, "") AS CargoName -|FROM -| Document.Order.Goods AS OrderGoods -|WHERE -| OrderGoods.Ref = &Ref"; +Запрос = Новый Запрос; +Запрос.Текст = "ВЫБРАТЬ +| ПриходныйОрдерНоменклатура.Номенклатура КАК Номенклатура, +| ЕСТЬNULL(ПриходныйОрдерНоменклатура.Номенклатура.Код, "") КАК НоменклатураКод, // здесь ошибка с кавычками, должно быть """" +| ЕСТЬNULL(ПриходныйОрдерНоменклатура.Номенклатура.Наименование, "") КАК НоменклатураНаименование +|ИЗ +| Документ.ПриходныйОрдер.Номенклатура КАК ПриходныйОрдерНоменклатура +|ГДЕ +| ПриходныйОрдерНоменклатура.Ссылка = &Ссылка"; ``` ## Sources diff --git a/docs/en/diagnostics/MultilingualStringHasAllDeclaredLanguages.md b/docs/en/diagnostics/MultilingualStringHasAllDeclaredLanguages.md index 2acd7426188..06c561d8627 100644 --- a/docs/en/diagnostics/MultilingualStringHasAllDeclaredLanguages.md +++ b/docs/en/diagnostics/MultilingualStringHasAllDeclaredLanguages.md @@ -7,4 +7,4 @@ NStr in a multilingual configuration has different fragments for different langu ## Sources -- [Standard: Localization Requirements (RU)](https://its.1c.ru/db/v8std/content/763/hdoc) +- [localization requirements](https://its.1c.ru/db/v8std/content/763/hdoc) diff --git a/docs/en/diagnostics/MultilingualStringUsingWithTemplate.md b/docs/en/diagnostics/MultilingualStringUsingWithTemplate.md index efe52879cc4..5af8cf2f0ca 100644 --- a/docs/en/diagnostics/MultilingualStringUsingWithTemplate.md +++ b/docs/en/diagnostics/MultilingualStringUsingWithTemplate.md @@ -3,9 +3,8 @@ ## Description -NStr in a multilingual configuration has different fragments for different languages. -If you start a session under a language code that is not in the string passed to NStr, it will return an empty string. When used with StrTemplate, an empty string returned from NStr will throw an exception. +NStr in a multilingual configuration has different fragments for different languages. If you start a session under a language code that is not in the string passed to NStr, it will return an empty string. When used with StrTemplate, an empty string returned from NStr will throw an exception. ## Sources -- [localization requirements (RU)](https://its.1c.ru/db/v8std/content/763/hdoc) +- [localization requirements](https://its.1c.ru/db/v8std/content/763/hdoc) diff --git a/docs/en/diagnostics/NestedFunctionInParameters.md b/docs/en/diagnostics/NestedFunctionInParameters.md index da3cf9f7f8e..e719eee29da 100644 --- a/docs/en/diagnostics/NestedFunctionInParameters.md +++ b/docs/en/diagnostics/NestedFunctionInParameters.md @@ -12,7 +12,7 @@ At the same time, if the code with nested calls is compact (does not require the ## Examples -Incorrect: +Wrong: ```bsl Attachments.Insert( AttachedFile.Description, New Picture(GetFromTempStorage( AttachedFiles.GetFileData(AttachedFile.Ref).RefToFileBinaryData))); diff --git a/docs/en/diagnostics/NestedStatements.md b/docs/en/diagnostics/NestedStatements.md index 7f6f07559f3..32d3dcc9bce 100644 --- a/docs/en/diagnostics/NestedStatements.md +++ b/docs/en/diagnostics/NestedStatements.md @@ -9,7 +9,7 @@ Such code is hard for reading, refactoring and support. ## Examples -Incorrect +Wrong ```bsl diff --git a/docs/en/diagnostics/NestedTernaryOperator.md b/docs/en/diagnostics/NestedTernaryOperator.md index e61e3553372..cd7ffabebbb 100644 --- a/docs/en/diagnostics/NestedTernaryOperator.md +++ b/docs/en/diagnostics/NestedTernaryOperator.md @@ -16,7 +16,7 @@ Result = ?(X%15 <> 0, ?(X%5 <> 0, ?(X%3 <> 0, x, "Fizz"), "Buzz"), "FizzBuzz"); ```bsl If ?(P.Emp_emptype = Null, 0, PageEmp_emptype) = 0 Then - Status = "Done"; +      Status = "Done"; EndIf; ``` @@ -38,7 +38,7 @@ EndIf; ```bsl If PageEmp_emptype = Null OR PageEmp_emptype = 0 Then - Status = "Done"; +      Status = "Done"; End If; ``` diff --git a/docs/en/diagnostics/NonExportMethodsInApiRegion.md b/docs/en/diagnostics/NonExportMethodsInApiRegion.md index ebe5306dc2f..d5f9b7f756f 100644 --- a/docs/en/diagnostics/NonExportMethodsInApiRegion.md +++ b/docs/en/diagnostics/NonExportMethodsInApiRegion.md @@ -7,6 +7,6 @@ * The “Service Programming Interface” region is intended for modules that are part of some functional subsystem. It should contain export procedures and functions that can only be called from other functional subsystems of the same library. -## Sources +## Reference -* Source: [Standard: Module structure (RU)](https://its.1c.ru/db/v8std#content:455:hdoc) +* [Module structure](https://its.1c.ru/db/v8std#content:455:hdoc) diff --git a/docs/en/diagnostics/NonStandardRegion.md b/docs/en/diagnostics/NonStandardRegion.md index 4d4343a2d19..a11fe2c73b0 100644 --- a/docs/en/diagnostics/NonStandardRegion.md +++ b/docs/en/diagnostics/NonStandardRegion.md @@ -14,4 +14,4 @@ The set of sections for each type of module (form module, object module, common -* Source: [Standard: Module structure (RU)](https://its.1c.ru/db/v8std#content:455:hdoc) +* Reference: [Code conventions. Module structure](https://its.1c.ru/db/v8std#content:455:hdoc) diff --git a/docs/en/diagnostics/NumberOfParams.md b/docs/en/diagnostics/NumberOfParams.md index a41fe530467..f7adc5a29cb 100644 --- a/docs/en/diagnostics/NumberOfParams.md +++ b/docs/en/diagnostics/NumberOfParams.md @@ -12,9 +12,9 @@ If need to pass many parameters to a function, it is recommended to group same-t Incorrect: ```bsl -// Create an item in catalog "Goods" -Procedure CreateSKU(Name, Goods, Units, Weight, Check = True) -// ... +// Create item in catalog "Goods" +Procedure CreateNewGoods(Description, Goods, Units, Weight, Check = True) + EndProcedure ``` @@ -24,9 +24,10 @@ Group parameters, having goods item properties into Structure Values. ```bsl // Create item in catalog "Goods" Procedure CreateNewGoods(Values, Check = True) + EndProcedure ``` ## Sources -* [Standard: Parameters of procedures and functions (RU)](https://its.1c.ru/db/v8std#content:640:hdoc) +* [Standard: Procedure and function parameters (RU)](https://its.1c.ru/db/v8std#content:640:hdoc) diff --git a/docs/en/diagnostics/NumberOfValuesInStructureConstructor.md b/docs/en/diagnostics/NumberOfValuesInStructureConstructor.md index 1a671b585b7..771088dda6e 100644 --- a/docs/en/diagnostics/NumberOfValuesInStructureConstructor.md +++ b/docs/en/diagnostics/NumberOfValuesInStructureConstructor.md @@ -51,6 +51,6 @@ Parameters.Insert("UUID ", UUID); Parameters.Insert("Description", Description); ``` -## Sources +## Reference -* [Standard: Using objects of type Structure (RU)](https://its.1c.ru/db/v8std#content:693:hdoc) +* [Standard: Using objects of type Structure](https://its.1c.ru/db/v8std#content:693:hdoc) diff --git a/docs/en/diagnostics/OneStatementPerLine.md b/docs/en/diagnostics/OneStatementPerLine.md index 15301e9ca09..60af845d0c4 100644 --- a/docs/en/diagnostics/OneStatementPerLine.md +++ b/docs/en/diagnostics/OneStatementPerLine.md @@ -9,4 +9,4 @@ Module texts are formatted according to the "one statement in one line" principl ## Sources -* Source: [Standard: Modules (RU)](https://its.1c.ru/db/v8std#content:456:hdoc) +* [Standard: Modules texts(RU)](https://its.1c.ru/db/v8std#content:456:hdoc) diff --git a/docs/en/diagnostics/OrdinaryAppSupport.md b/docs/en/diagnostics/OrdinaryAppSupport.md index 2473b21803d..7bf9214ca50 100644 --- a/docs/en/diagnostics/OrdinaryAppSupport.md +++ b/docs/en/diagnostics/OrdinaryAppSupport.md @@ -21,4 +21,4 @@ The refusal to support the launch of configuration in the ordinary application a ## Sources -* Source: [Standard: General Configuration Requirements (RU)](https://its.1c.ru/db/v8std#content:467:hdoc) +* Source: [Standard: General Configuration Requirements](https://its.1c.ru/db/v8std#content:467:hdoc) diff --git a/docs/en/diagnostics/PairingBrokenTransaction.md b/docs/en/diagnostics/PairingBrokenTransaction.md index aee827bc13c..12854e2658b 100644 --- a/docs/en/diagnostics/PairingBrokenTransaction.md +++ b/docs/en/diagnostics/PairingBrokenTransaction.md @@ -51,6 +51,6 @@ EndProcedure ``` -## Sources +## Reference -* [Transactions: Rules of Use (RU)](https://its.1c.ru/db/v8std/content/783/hdoc/_top/) +* [Transactions: Terms of Use](https://its.1c.ru/db/v8std#content:783:hdoc) diff --git a/docs/en/diagnostics/ParseError.md b/docs/en/diagnostics/ParseError.md index 04049dfa24b..89301abe55d 100644 --- a/docs/en/diagnostics/ParseError.md +++ b/docs/en/diagnostics/ParseError.md @@ -9,7 +9,7 @@ Separate grammatical constructions, expressions, as well as declarations and pla ## Examples -Incorrect: +Wrong: ```bsl Procedure Example1() diff --git a/docs/en/diagnostics/PrivilegedModuleMethodCall.md b/docs/en/diagnostics/PrivilegedModuleMethodCall.md index 87647762992..dab94cef7b7 100644 --- a/docs/en/diagnostics/PrivilegedModuleMethodCall.md +++ b/docs/en/diagnostics/PrivilegedModuleMethodCall.md @@ -1,16 +1,34 @@ # Accessing privileged module methods (PrivilegedModuleMethodCall) + ## Description + -Code running in `privileged` `mode` must be checked. + +При обращении к публичным процедурам и функциям привилегированных общих модулей могут нарушаться ограничения конфигурации по правам и ролям конфигурации, решения 1С. +Необходимо провалидировать подобные обращения для исключения обхода ограничений. ## Examples + +Например, в конфигурации существует привилегированный модуль выполнения заданий с именем `Задания`. +В этом модуле есть публичная функция `Функция ДобавитьЗадание(Знач ИмяМетода, Знач Параметры) Экспорт`. +Какой-то код конфигурации или расширения обращается к этому методу `Задания.ДобавитьЗадание("МетодДляВыполнения", Параметры);` + +Необходимо проанализировать код и убедиться в том, что: + +- указан правильный метод для выполнения задания - `МетодДляВыполнения` +- метод `МетодДляВыполнения` для выполнения задания не выполняет деструктивных действий +- и не выдает пользователям данные, запрещенные ограничениями конфигурации + ## Sources + + +* Источник: [Cognitive complexity, ver. 1.4](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) --> diff --git a/docs/en/diagnostics/ProtectedModule.md b/docs/en/diagnostics/ProtectedModule.md index 7a6babe4907..31c76fb0873 100644 --- a/docs/en/diagnostics/ProtectedModule.md +++ b/docs/en/diagnostics/ProtectedModule.md @@ -1,16 +1,22 @@ # Protected modules (ProtectedModule) + ## Description + + The absence of module sources in the configuration is not recommended. In the case of a closed, password-protected module, the quality of the code decreases, it is impossible to review the code, and versioning of changes is not carried out. ## Examples + ## Sources + + + ## Description -Diagnostics allows you to control the dereference of reference fields through a dot in the 1C query language. -The purpose of this diagnostic is to prevent unnecessary implicit joins between tables. -and as a result, improve the performance of executing a database query. + +Diagnostics allows you to control the dereference of reference fields through a dot in the 1C query language. The purpose of this diagnostic is to prevent unnecessary implicit joins between tables. and as a result, improve the performance of executing a database query. ## Examples + 1. Base dereference through a dot (in temp. db or in select query) `ЗаказКлиентаТовары.Ссылка.Организация КАК Организация` 2. Dereference of fields in table join section `ВТ_РасчетыСКлиентами КАК ВТ_РасчетыСКлиентами - ЛЕВОЕ СОЕДИНЕНИЕ ВТ_ДанныеЗаказовКлиента КАК ВТ_ДанныеЗаказовКлиента - ПО ВТ_РасчетыСКлиентами.АналитикаУчетаПоПартнерам.Партнер = ВТ_ДанныеЗаказовКлиента.Партнер` + ЛЕВОЕ СОЕДИНЕНИЕ ВТ_ДанныеЗаказовКлиента КАК ВТ_ДанныеЗаказовКлиента + ПО ВТ_РасчетыСКлиентами.АналитикаУчетаПоПартнерам.Партнер = ВТ_ДанныеЗаказовКлиента.Партнер` 3. Dereference of fields in virtual tables `РегистрНакопления.РасчетыСКлиентами.Обороты( - &НачалоПериода, - &КонецПериода, - , - (АналитикаУчетаПоПартнерам.Партнер) В ...` + &НачалоПериода, + &КонецПериода, + , + (АналитикаУчетаПоПартнерам.Партнер) В ...` 4. Dereference in cast function result fields `ВЫРАЗИТЬ(ВТ_ПланОтгрузок.ДокументПлан КАК Документ.ЗаказКлиента).Валюта.Наценка` 5. Dereference of fields in WHERE section `ГДЕ азКлиентаТовары.Ссылка.Дата МЕЖДУ &НачалоПериода И &КонецПериода` + + + ## Sources + Source: [Dereference of composite type reference fields in the query language (RU)] (https://its.1c.ru/db/v8std/content/654/hdoc) diff --git a/docs/en/diagnostics/QueryParseError.md b/docs/en/diagnostics/QueryParseError.md index dec72ea8cc9..b40de22200e 100644 --- a/docs/en/diagnostics/QueryParseError.md +++ b/docs/en/diagnostics/QueryParseError.md @@ -1,8 +1,7 @@ # Query text parsing error (QueryParseError) -## Description - +## Diagnostics description When writing queries, you must follow the following rule: the query text must be opened by the query designer. @@ -22,7 +21,7 @@ Text = "SELECT | Catalog.Goods КАК Goods"; ``` -Correct +Right ```bsl Text = "SELECT diff --git a/docs/en/diagnostics/QueryToMissingMetadata.md b/docs/en/diagnostics/QueryToMissingMetadata.md index 86bef8fd7b1..5f15f4e0656 100644 --- a/docs/en/diagnostics/QueryToMissingMetadata.md +++ b/docs/en/diagnostics/QueryToMissingMetadata.md @@ -1,12 +1,11 @@ # Using non-existent metadata in the query (QueryToMissingMetadata) -## Description +## Diagnostics description -Due to frequent changes to the metadata model, queries may appear that refer to renamed or deleted metadata. -Also, errors can occur when you manually change queries, without checking with the query designer. +Due to frequent changes to the metadata model, queries may appear that refer to renamed or deleted metadata. Also, errors can occur when you manually change queries, without checking with the query designer. -When accessing non-existent metadata in a query, a runtime error will occur. +Executing queries against non-existent metadata will generate a runtime error. ## Examples @@ -22,17 +21,17 @@ Query with a join to the renamed register: SELECT Table.Field1 AS Field1 FROM - InformationRegister.InfoReg AS Table - INNER JOIN InformationRegister.InfoRegOld AS FilterTable - ON FilterTable.Field2 = Table.Field2 + InformationRegister.InfoReg AS Table + INNER JOIN InformationRegister.InfoRegOld AS FilterTable + ON FilterTable.Field2 = Table.Field2 ``` ## Sources -- [Development standards. Working with queries (RU)](https://its.1c.ru/db/v8std#browse:13:-1:26:27) -- [Development standards. Optimizing queries (RU)](https://its.1c.ru/db/v8std#browse:13:-1:26:28) +- [Working with queries - 1C development standards (RU)](https://its.1c.ru/db/v8std#browse:13:-1:26:27) +- [Optimization of queries - 1C development standards (RU)](https://its.1c.ru/db/v8std#browse:13:-1:26:28) diff --git a/docs/en/diagnostics/RefOveruse.md b/docs/en/diagnostics/RefOveruse.md index 6ca1a197208..fca1c486e8e 100644 --- a/docs/en/diagnostics/RefOveruse.md +++ b/docs/en/diagnostics/RefOveruse.md @@ -16,7 +16,7 @@ Query.Text = "Select Files.File.Ref, // error -* Useful Information: [Dereferencing Complex Type Reference Fields in Query Language (RU)](https://its.1c.ru/db/v8std/content/654/hdoc) +* Useful Information: [Dereferencing Complex Type Reference Fields in Query Language](https://its.1c.ru/db/v8std/content/654/hdoc) diff --git a/docs/en/diagnostics/ReservedParameterNames.md b/docs/en/diagnostics/ReservedParameterNames.md index 50a783d844b..e4749544f7e 100644 --- a/docs/en/diagnostics/ReservedParameterNames.md +++ b/docs/en/diagnostics/ReservedParameterNames.md @@ -1,22 +1,21 @@ # Reserved parameter names (ReservedParameterNames) -## Description +## 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)](https://its.1c.ru/db/v8std/content/640/hdoc) -* Source: [Standard: Rules for generating variable names (RU)](https://its.1c.ru/db/v8std#content:454:hdoc) +- Source: [Standard: Procedure and Function Parameters (RU)](https://its.1c.ru/db/v8std/content/640/hdoc) +- Source: [Standard: Rules for generating variable names (RU)](https://its.1c.ru/db/v8std#content:454:hdoc) diff --git a/docs/en/diagnostics/RewriteMethodParameter.md b/docs/en/diagnostics/RewriteMethodParameter.md index 27128fc7cc9..0e2ae610240 100644 --- a/docs/en/diagnostics/RewriteMethodParameter.md +++ b/docs/en/diagnostics/RewriteMethodParameter.md @@ -1,44 +1,55 @@ # Rewrite method parameter (RewriteMethodParameter) + ## Description + -It is wrong to write methods in which their arguments are overwritten immediately on entry. -It is necessary to correct this deficiency by removing the parameters, converting them to local variables. +Иногда разработчик пишут функции таким образом, когда аргументы функции перезаписываются сразу на входе в функцию/процедуру. + +Такое поведение вводит в заблуждение других разработчиков, которые вызывают подобные функции/процедуры. +Эти функции нужно исправить. It is necessary to correct this deficiency by removing the parameters, converting them to local variables. ## Examples + + Suspicious code + ```bsl -Procedure Configor(Val ConnectionString, Val User = "", Val Pass = "") Export - ConnectionString = "/F""" + DataBaseDir + """"; // Error +Функция Конфигуратор(Знач СтрокаПодключения, Знач Пользователь = "", Знач Пароль = "") Экспорт + СтрокаПодключения = "/F""" + КаталогБазы + """"; // Здесь ... -EndProcedure +КонецФункции ``` -Сorrected: +Исправленный код + ```bsl -Procedure Configor(Val DataBaseDir, Val User = "", Val Pass = "") Export -ConnectionString = "/F""" + DataBaseDir + """"; // No error +Функция Конфигуратор(Знач КаталогБазы, Знач Пользователь = "", Знач Пароль = "") Экспорт + СтрокаПодключения = "/F""" + КаталогБазы + """"; // Здесь ... -EndProcedure +КонецФункции ``` + or -```bsl -Procedure Configor(Val DataBaseDir, Val User = "", Val Pass = "") Export - If Not EmpyString(DataBaseDir) Then -NewConnectionString = "/F""" + DataBaseDir + """"; -Else -NewConnectionString = ConnectionString; // Hmm, where is this from? -EndIf; +```bsl +Функция Конфигуратор(Знач КаталогБазы, Знач Пользователь = "", Знач Пароль = "") Экспорт + Если Не ПустаяСтрока(КаталогБазы) Тогда + НоваяСтрокаПодключения = "/F""" + КаталогБазы + """"; + Иначе + НоваяСтрокаПодключения = СтрокаПодключения; + КонецЕсли; ... -EndProcedure +КонецФункции ``` ## Sources + + -## Description - +## Diagnostics description For child metadata objects, such as attributes, dimensions, resources, tabular sections (and their attributes), it is not recommended to use names that match the names of the owner objects, since this can lead to errors in queries. diff --git a/docs/en/diagnostics/ScheduledJobHandler.md b/docs/en/diagnostics/ScheduledJobHandler.md index 002e40b5061..9390e5da614 100644 --- a/docs/en/diagnostics/ScheduledJobHandler.md +++ b/docs/en/diagnostics/ScheduledJobHandler.md @@ -1,8 +1,11 @@ # Scheduled job handler (ScheduledJobHandler) + ## Description + + Certain requirements are imposed on the methods of scheduled job handlers. Any export procedure or function of a non-global common server module can be used as a scheduled job method. If the scheduled job method is a function, then its return value is ignored. @@ -10,6 +13,7 @@ If the scheduled job is predefined, then its handler should not have parameters. Otherwise, the parameters of such a scheduled job can be any values ​​that are allowed to be sent to the server. The parameters of a scheduled job must exactly match the parameters of the procedure or function it calls. Diagnostics checks the following signs of the correctness of the scheduled job handler method: + - there is a common module and a shared module method specified as a handler - common module is server - the method is export @@ -18,14 +22,18 @@ Diagnostics checks the following signs of the correctness of the scheduled job h - there are no other scheduled jobs that refer to the same handler method ## Examples + ## Sources + + + - [Set of articles "Scheduled job" - standard 1C (RU)](https://its.1c.ru/db/v8std#browse:13:-1:1:6) - [Article "Scheduled job" from the developer's guide 1C 8.3 (RU)](https://its.1c.ru/db/v8322doc#bookmark:dev:TI000000794) diff --git a/docs/en/diagnostics/SelectTopWithoutOrderBy.md b/docs/en/diagnostics/SelectTopWithoutOrderBy.md index 6f1b805398a..88465a47739 100644 --- a/docs/en/diagnostics/SelectTopWithoutOrderBy.md +++ b/docs/en/diagnostics/SelectTopWithoutOrderBy.md @@ -66,4 +66,4 @@ SORT BY * Полезная информация: [Отказ от использования модальных окон](https://its.1c.ru/db/metod8dev#content:5272:hdoc) * Источник: [Cognitive complexity, ver. 1.4](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) --> -- [Standard: Ordering Query Results (RU)](https://its.1c.ru/db/v8std#content:412:hdoc) +- [Standard: Ordering Query Results](https://its.1c.ru/db/v8std#content:412:hdoc) diff --git a/docs/en/diagnostics/SelfInsertion.md b/docs/en/diagnostics/SelfInsertion.md index 33b27ef0181..1351496303c 100644 --- a/docs/en/diagnostics/SelfInsertion.md +++ b/docs/en/diagnostics/SelfInsertion.md @@ -7,4 +7,4 @@ Inserting a collection into itself results in circular references. ## Sources -* [Search for circular links (RU)](https://its.1c.ru/db/metod8dev#content:5859:hdoc) +* [Search for circular links](https://its.1c.ru/db/metod8dev#content:5859:hdoc) diff --git a/docs/en/diagnostics/ServerCallsInFormEvents.md b/docs/en/diagnostics/ServerCallsInFormEvents.md index fd1e8ee20a3..55000433b1c 100644 --- a/docs/en/diagnostics/ServerCallsInFormEvents.md +++ b/docs/en/diagnostics/ServerCallsInFormEvents.md @@ -1,7 +1,9 @@ # Server calls in form events (ServerCallsInFormEvents) + ## Description + Events `OnActivateRow` and `OnStartChoice` should not contain server procedure calls. These events should only execute on the client. @@ -11,6 +13,7 @@ Only server calls to methods of this form are diagnosed; calling MyModuleServer. According to the [Infostart article](https://infostart.ru/1c/articles/1225834/), calling server procedures from these events can lead to performance issues and form behavior problems. ## Examples + ### Incorrect @@ -39,7 +42,8 @@ EndProcedure ``` ## Sources + -* [GitHub Issue #3473](https://github.com/1c-syntax/bsl-language-server/issues/3473) -* [Infostart: Server calls that should not be called](https://infostart.ru/1c/articles/1225834/) +- [GitHub Issue #3473](https://github.com/1c-syntax/bsl-language-server/issues/3473) +- [Infostart: Server calls that should not be called](https://infostart.ru/1c/articles/1225834/) diff --git a/docs/en/diagnostics/ServerSideExportFormMethod.md b/docs/en/diagnostics/ServerSideExportFormMethod.md index 478e3f60df2..e86ff094608 100644 --- a/docs/en/diagnostics/ServerSideExportFormMethod.md +++ b/docs/en/diagnostics/ServerSideExportFormMethod.md @@ -1,7 +1,7 @@ # Server-side export form method (ServerSideExportFormMethod) -## Description +## Diagnostics description In a form module, you can declare export methods that are available in the client context (usually, these are form notification event handlers). For export methods of the form, only the compilation directive `AtClient` can be specified, since for the rest there is no practical sense: accessing form methods from outside is available only after calling the method `GetForm`, which is available only on the client. diff --git a/docs/en/diagnostics/SetPermissionsForNewObjects.md b/docs/en/diagnostics/SetPermissionsForNewObjects.md index 83db92cccc7..65cb78ca3c5 100644 --- a/docs/en/diagnostics/SetPermissionsForNewObjects.md +++ b/docs/en/diagnostics/SetPermissionsForNewObjects.md @@ -1,4 +1,4 @@ -# The check box «Set permissions for new objects» should only be selected for the FullAccess role (SetPermissionsForNewObjects) +# The checkbox «Set permissions for new objects» should only be selected for the FullAccess role (SetPermissionsForNewObjects) ## Description @@ -9,4 +9,4 @@ When adding a new role, the "Set permissions for new objects" attribute may be s ## Sources -* [Standard: Setting rights for new objects and object fields (RU)](https://its.1c.ru/db/v8std/content/532/hdoc) +* [Standard: Setting rights for new objects and object fields](https://its.1c.ru/db/v8std/content/532/hdoc) diff --git a/docs/en/diagnostics/SetPrivilegedMode.md b/docs/en/diagnostics/SetPrivilegedMode.md index 7477af6fa95..4a2361e529e 100644 --- a/docs/en/diagnostics/SetPrivilegedMode.md +++ b/docs/en/diagnostics/SetPrivilegedMode.md @@ -1,8 +1,11 @@ # Using privileged mode (SetPrivilegedMode) + ## Description + + Diagnostic finds Privileged mode setup code. For external code, such as code from external reports/data processors, this action may not be safe. @@ -14,6 +17,7 @@ call to `SetPrivilegedMode(False)` is ignored Any export procedures and functions that perform any actions on the server with the privileged mode set unconditionally beforehand are potentially dangerous, as this disables checking the access rights of the current user. The export procedures and functions of the client API of the 1C:Enterprise server require special attention. For example, wrong: + ```bsl Procedure ChangeData(...) Export @@ -22,7 +26,9 @@ SetPrivilegedMode(True); // Disable permission check ... EndProcedure ``` + Correct: + ```bsl Procedure ChangeData(...) Export @@ -31,11 +37,13 @@ Procedure ChangeData(...) Export ... EndProcedure ``` + The exception is when the action performed by the procedure must be allowed (or the return value of the function must be available) to absolutely all categories of users. If you still need to use privileged mode within a method, you must use manual access control using the `VerifyAccessRights` method. An example of pre-checking before performing actions in privileged mode: + ```bsl Procedure ChangeData(...) Export @@ -46,23 +54,30 @@ SetPrivilegedMode(True); // Disable permission check ... EndProcedure ``` + ## Examples + + ```bsl - SetPrivilegedMode(True); // error + УстановитьПривилегированныйРежим(Истина); // есть замечание - Value = True; - SetPrivilegedMode(Value); // error + Значение = Истина; + УстановитьПривилегированныйРежим(Значение); // есть замечание - SetPrivilegedMode(False); // no error + УстановитьПривилегированныйРежим(Ложь); // нет замечания ``` + ## Sources + + -* Standard: [Using Privileged Mode (RU)](https://its.1c.ru/db/v8std/content/485/hdoc) -* Standard: [Server API Security (RU)](https://its.1c.ru/db/v8std#content:678:hdoc) -* Standard: [Restriction on the execution of "external" code (RU)](https://its.1c.ru/db/v8std/content/669/hdoc) + +- Standard: [Using Privileged Mode (RU)](https://its.1c.ru/db/v8std/content/485/hdoc) +- Standard: [Server API Security (RU)](https://its.1c.ru/db/v8std#content:678:hdoc) +- Standard: [Restriction on the execution of "external" code (RU)](https://its.1c.ru/db/v8std/content/669/hdoc) diff --git a/docs/en/diagnostics/SeveralCompilerDirectives.md b/docs/en/diagnostics/SeveralCompilerDirectives.md index 2160a68edc2..1d4a3abfa7a 100644 --- a/docs/en/diagnostics/SeveralCompilerDirectives.md +++ b/docs/en/diagnostics/SeveralCompilerDirectives.md @@ -7,7 +7,7 @@ It is an error to specify multiple compilation directives to a module method or ## Examples -Incorrect: +Wrong ```bsl &AtServer diff --git a/docs/en/diagnostics/SpaceAtStartComment.md b/docs/en/diagnostics/SpaceAtStartComment.md index fcef2f921ed..5a0f43ab0e8 100644 --- a/docs/en/diagnostics/SpaceAtStartComment.md +++ b/docs/en/diagnostics/SpaceAtStartComment.md @@ -9,4 +9,4 @@ Exception from the rule is _**comments-annotations**_, comments starting with sp ## Sources -* Source: [Standard: Modules (RU)](https://its.1c.ru/db/v8std#content:456:hdoc) +* [Standard: Modules text, Item 7.3](https://its.1c.ru/db/v8std#content:456:hdoc) diff --git a/docs/en/diagnostics/StyleElementConstructors.md b/docs/en/diagnostics/StyleElementConstructors.md index 28403669462..f9aaf84e602 100644 --- a/docs/en/diagnostics/StyleElementConstructors.md +++ b/docs/en/diagnostics/StyleElementConstructors.md @@ -15,4 +15,4 @@ Types of style elements: ## Sources System of standards -* Source: [Standard: Style Elements (RU)](https://its.1c.ru/db/v8std#content:667:hdoc) +* Source: [Standard: Style Elements](https://its.1c.ru/db/v8std#content:667:hdoc) diff --git a/docs/en/diagnostics/TempFilesDir.md b/docs/en/diagnostics/TempFilesDir.md index 3ae4ff5c9b6..c2d776cbcbd 100644 --- a/docs/en/diagnostics/TempFilesDir.md +++ b/docs/en/diagnostics/TempFilesDir.md @@ -9,7 +9,7 @@ If a temporary file name is generated otherwise, and the application code fails ## Examples -Incorrect: +Wrong: ```bsl Catalog = TempFilesDir(); @@ -27,7 +27,7 @@ Data.Write(TempFile); To create a temporary directory, it is recommended to use the one obtained by the GetTempFileName method (with the exception of the web client). -Incorrect: +Wrong: ```bsl ArchFile = New ZipFileReader(FileName); diff --git a/docs/en/diagnostics/TernaryOperatorUsage.md b/docs/en/diagnostics/TernaryOperatorUsage.md index 646c37564c4..45b6fb3f7ef 100644 --- a/docs/en/diagnostics/TernaryOperatorUsage.md +++ b/docs/en/diagnostics/TernaryOperatorUsage.md @@ -31,13 +31,13 @@ Bad: ```bsl If ?(P.Emp_emptype = Null, 0, P.Emp_emptype) = 0 Then - Status = "Done"; +      Status = "Done"; EndIf; ``` Good: ```bsl If P.Emp_emptype = Null OR P.Emp_emptype = 0 Then - Status = "Done"; +      Status = "Done"; End If; ``` diff --git a/docs/en/diagnostics/TimeoutsInExternalResources.md b/docs/en/diagnostics/TimeoutsInExternalResources.md index 8c331a4c841..4bc7a1172f8 100644 --- a/docs/en/diagnostics/TimeoutsInExternalResources.md +++ b/docs/en/diagnostics/TimeoutsInExternalResources.md @@ -40,7 +40,7 @@ ConnectiomTimeout = 180; HTTPConnection = New HTTPConnection("zabbix.localhost", 80,,,, ConnectiomTimeout); ``` -## Sources +## Reference -* [Timeouts when working with external resources (RU)](https://its.1c.ru/db/v8std#content:748:hdoc) -* [InternetMail Profilehas a default timeout (RU)](https://its.1c.ru/db/metod8dev/content/2358/hdoc) +* [Timeouts when working with external resources](https://its.1c.ru/db/v8std#content:748:hdoc) +* [InternetMail Profilehas a default timeout](https://its.1c.ru/db/metod8dev/content/2358/hdoc) diff --git a/docs/en/diagnostics/TransferringParametersBetweenClientAndServer.md b/docs/en/diagnostics/TransferringParametersBetweenClientAndServer.md index 4f9d19fe9e8..48fc79c3537 100644 --- a/docs/en/diagnostics/TransferringParametersBetweenClientAndServer.md +++ b/docs/en/diagnostics/TransferringParametersBetweenClientAndServer.md @@ -1,12 +1,14 @@ # Transferring parameters between the client and the server (TransferringParametersBetweenClientAndServer) + ## Description + + When transferring control from the client to the server (and vice versa), copies of the parameters are always transferred. - When a server procedure or function is called from the client, a copy of the actual parameter is created and this copy is passed to the server side. - - When control is returned from the server to the client, a copy of the formal parameter (which was handled in the called procedure or function) is also created for transfer back to the client. If a formal parameter is specified with the Val modifier, then the value of the parameter will only be passed when the procedure or function is called and will not be passed back when control returns to the client. @@ -20,10 +22,12 @@ As a result, the absence of the Val modifier in client-server interaction can le The current rule finds server methods that execute from client methods and throws remarks on parameters without the Val modifier that are not set to a value. -## Examples - -  +## Examples + + + 1. An example with passing parameters from the client to the server without "Val" and with "Val" + ```bsl &AtServerNoContext Procedure TransferParametersToServer(Param1, Val ParamWithVal, Collection, Val CollectionWithVal) @@ -55,51 +59,54 @@ Message(StrTemplate(Template, "CollectionWithVal.Key2", CollectionWithVal.Key2)) EndProcedure ``` + This code, when executed, will show the following result + ``` after server Param1= after server ParamWithVal= after server Collection.Key1 =   after server CollectionWithVal.Key2= ``` + It can be seen that all parameters passed through Value do not change their values after execution, incl. and values within collections. 2. An example of inaccurate parameter transfer -```bsl -&AtClient -Procedure UserGroupsDragNDropFinish(Response, AdditionalParameters) - -If Response = DialogReturnCode.No Then -Return; -EndIf; -MessageToUser = MoveUserToNewGroup( -AdditionalOptions.DragNDropOptions, -AdditionalParameters.String, -AdditionalParameters.Move -); - -EndProcedure - -// input parameters ArrayUsers and other parameters do not change -// and therefore there is no point in additionally returning them from the server -&AtServer -Function MoveUserToNewGroup(ArrayUsers, NewGroupOwner, Move) - -If NewGroupOwner = Undefined Then -Return Undefined; -EndIf; - -CurrentGroupOwner = Items.UserGroups.CurrentRow; -MessageToUser = UsersService.MovingUserToNewGroup( -ArrayUsers, CurrentGroupOwner, NewGroupOwner, Move); - -Items.UsersList.Update(); -Items.UserGroups.Refresh(); - -Return MessageToUser; - -EndFunction +```bsl +&НаКлиенте +Процедура ГруппыПользователейПеретаскиваниеЗавершение(Ответ, ДополнительныеПараметры) Экспорт + + Если Ответ = КодВозвратаДиалога.Нет Тогда + Возврат; + КонецЕсли; + + СообщениеПользователю = ПеремещениеПользователяВНовуюГруппу( + ДополнительныеПараметры.ПараметрыПеретаскивания, + ДополнительныеПараметры.Строка, + ДополнительныеПараметры.Перемещение); + +КонецПроцедуры + +// входные параметры МассивПользователей и остальные параметры не меняются +// и поэтому нет смысла дополнительно возвращать их с сервера +&НаСервере +Функция ПеремещениеПользователяВНовуюГруппу(МассивПользователей, НоваяГруппаВладелец, Перемещение) + + Если НоваяГруппаВладелец = Неопределено Тогда + Возврат Неопределено; + КонецЕсли; + + ТекущаяГруппаВладелец = Элементы.ГруппыПользователей.ТекущаяСтрока; + СообщениеПользователю = ПользователиСлужебный.ПеремещениеПользователяВНовуюГруппу( + МассивПользователей, ТекущаяГруппаВладелец, НоваяГруппаВладелец, Перемещение); + + Элементы.ПользователиСписок.Обновить(); + Элементы.ГруппыПользователей.Обновить(); + + Возврат СообщениеПользователю; + +КонецФункции ``` ## Parameters @@ -107,7 +114,7 @@ EndFunction ### cachedValueNames Type: `String` -Default value: `` (empty string) +Default value: \`\` (empty string) Comma-separated list of parameter names that should be ignored by the diagnostic if a variable with the same name and the `&AtClient` compiler directive exists in the module. @@ -144,12 +151,14 @@ Procedure UpdateCache(CachedValues) EndProcedure ``` -## Sources - - + + +* Источник: [Стандарт: Тексты модулей](https://its.1c.ru/db/v8std#content:456:hdoc) +* Полезная информация: [Отказ от использования модальных окон](https://its.1c.ru/db/metod8dev#content:5272:hdoc) +* Источник: [Cognitive complexity, ver. 1.4](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) --> - [Article on 1C:ITS - Call with transfer of control from client to server](https://its.1c.ru/db/v8318doc#bookmark:dev:TI000000153) diff --git a/docs/en/diagnostics/TryNumber.md b/docs/en/diagnostics/TryNumber.md index de48813d125..883590ae8ea 100644 --- a/docs/en/diagnostics/TryNumber.md +++ b/docs/en/diagnostics/TryNumber.md @@ -7,7 +7,7 @@ It is incorrect to use exceptions to cast a value to a type. For such operations ## Examples -Incorrect: +Wrong: ```bsl Try @@ -26,4 +26,4 @@ NumberDaysAllowance = TypeDescription.CastValue(Value); ## Sources -* [Catching Exceptions in Code (RU)](https://its.1c.ru/db/v8std#content:499:hdoc) +* [Standard: Catch exceptions in code](https://its.1c.ru/db/v8std#content:499:hdoc) diff --git a/docs/en/diagnostics/Typo.md b/docs/en/diagnostics/Typo.md index ceff8b2297a..e515f466e88 100644 --- a/docs/en/diagnostics/Typo.md +++ b/docs/en/diagnostics/Typo.md @@ -42,7 +42,7 @@ CI Recommendations: - GitHub Actions - Set explicit cache path in environment variables or configuration - Use `actions/cache` to save the directory between build and test runs - + ```yaml - name: Cache BSL LS Typo uses: actions/cache@v3 @@ -59,7 +59,7 @@ CI Recommendations: ```yaml variables: APP_CACHE_FULLPATH: ".bsl-ls-cache" - + cache: key: "bsl-ls-typo-cache" paths: diff --git a/docs/en/diagnostics/UnionAll.md b/docs/en/diagnostics/UnionAll.md index 6c7651670b2..4f59019c3ba 100644 --- a/docs/en/diagnostics/UnionAll.md +++ b/docs/en/diagnostics/UnionAll.md @@ -8,7 +8,7 @@ Employ UNION only when removing duplicates from the result is required. ## Examples -Incorrect: +Wrong: ```bsl SELECT GoodsReceipt.Ref @@ -23,7 +23,7 @@ FROM Document.GoodsSale AS GoodsSale ``` -Correct: +Сorrect: ```bsl SELECT @@ -40,4 +40,4 @@ Document.GoodsSale AS GoodsSale ``` ## Sources -* Link: [Development Standart: Using UNION and UNION ALL words in queries (RU)](https://its.1c.ru/db/v8std#content:434:hdoc) +* Link: [Development Standart: Using UNION and UNION ALL words in queries](https://its.1c.ru/db/v8std#content:434:hdoc) diff --git a/docs/en/diagnostics/UnsafeFindByCode.md b/docs/en/diagnostics/UnsafeFindByCode.md index eb8d13053ba..93acf3850b3 100644 --- a/docs/en/diagnostics/UnsafeFindByCode.md +++ b/docs/en/diagnostics/UnsafeFindByCode.md @@ -1,8 +1,11 @@ # Unsafe FindByCode() method usage (UnsafeFindByCode) + ## Description + + The diagnostic detects the use of the `FindByCode()` method (or `НайтиПоКоду()`) for catalogs that have: - code uniqueness control disabled (the **Check unique** property is set to `False`) @@ -11,7 +14,9 @@ The diagnostic detects the use of the `FindByCode()` method (or `НайтиПо In such cases, using the `FindByCode()` method can lead to unexpected behavior, as the code may not be unique within the entire catalog or there may be multiple elements with the same code in different series. ## Examples + + Incorrect: ```bsl @@ -38,6 +43,7 @@ Catalog = Catalogs.CatalogWithoutUniquenessControl.FindByName("Element"); ``` ## Sources + - Source: [FindByCode() method](https://its.1c.ru/db/v8std#content:456:hdoc) diff --git a/docs/en/diagnostics/UnsafeSafeModeMethodCall.md b/docs/en/diagnostics/UnsafeSafeModeMethodCall.md index 74c99921f60..51c5908843b 100644 --- a/docs/en/diagnostics/UnsafeSafeModeMethodCall.md +++ b/docs/en/diagnostics/UnsafeSafeModeMethodCall.md @@ -6,12 +6,9 @@ In "1C: Enterprise 8.3" the global context method SafeMode() returns the type String, if safe mode was set with the name of the security profile. Using the SafeMode() method, in which the result is implicitly converted to a Boolean type is unsafe, must be corrected for the code with an explicit comparison of the result with the value False. Thus, with the installed security profile, the code will be executed in the same way as in the safe mode. - ## Examples - -Incorrect: - +Wrong: ```bsl If SafeMode() Then // some logic in safe mode... @@ -21,17 +18,14 @@ If No SafeMode() Then // some logic in unsafe mode... EndIf; ``` - Correct: - ```bsl If SafeMode() <> False Then // some code EndIf; EndIf ``` - ## Sources -* Source: [SafeMode method (RU)](https://its.1c.ru/db/metod8dev#content:5293:hdoc:izmenenie_bezopasnyjrezhim) +* Source: [SafeMode method](https://its.1c.ru/db/metod8dev#content:5293:hdoc:izmenenie_bezopasnyjrezhim) diff --git a/docs/en/diagnostics/UnusedLocalMethod.md b/docs/en/diagnostics/UnusedLocalMethod.md index b18b9b0062f..feeae000b9a 100644 --- a/docs/en/diagnostics/UnusedLocalMethod.md +++ b/docs/en/diagnostics/UnusedLocalMethod.md @@ -7,4 +7,4 @@ Modules should not have unused procedures and functions. Diagnostics can skip `a ## Sources -* Source: [Standard: Modules (RU)](https://its.1c.ru/db/v8std#content:456:hdoc) +* [Standard: Modules](https://its.1c.ru/db/v8std#content:456:hdoc) diff --git a/docs/en/diagnostics/UnusedLocalVariable.md b/docs/en/diagnostics/UnusedLocalVariable.md index f11111ab41d..144232aa1a4 100644 --- a/docs/en/diagnostics/UnusedLocalVariable.md +++ b/docs/en/diagnostics/UnusedLocalVariable.md @@ -2,7 +2,6 @@ ## Description -Unused local variables should be removed +Программные модули не должны иметь неиспользуемых переменных. -If a local variable is declared but not used, it is dead code and should be removed. -Doing so will improve maintainability because developers will not wonder what the variable is used for. +If a local variable is declared but not used, it is dead code and should be removed. Doing so will improve maintainability because developers will not wonder what the variable is used for. diff --git a/docs/en/diagnostics/UsageWriteLogEvent.md b/docs/en/diagnostics/UsageWriteLogEvent.md index b91b67c66be..52deec92dd0 100644 --- a/docs/en/diagnostics/UsageWriteLogEvent.md +++ b/docs/en/diagnostics/UsageWriteLogEvent.md @@ -1,4 +1,4 @@ -# Incorrect use of the method "WriteLogEvent" (UsageWriteLogEvent) +# Incorrect use of the method (UsageWriteLogEvent) ## Description diff --git a/docs/en/diagnostics/UseLessForEach.md b/docs/en/diagnostics/UseLessForEach.md index 7ac771377bf..e40c448be85 100644 --- a/docs/en/diagnostics/UseLessForEach.md +++ b/docs/en/diagnostics/UseLessForEach.md @@ -9,7 +9,7 @@ The absence of an iterator in the loop body indicates either a useless iteration Incorrect: -```bsl +```Bsl For Each Iterator From Collection Loop @@ -19,9 +19,9 @@ EndLoop; ``` -Correct +Correct: -```bsl +```Bsl For Each Iterator From Collection Loop diff --git a/docs/en/diagnostics/UseSystemInformation.md b/docs/en/diagnostics/UseSystemInformation.md index df386588668..baac288e6ec 100644 --- a/docs/en/diagnostics/UseSystemInformation.md +++ b/docs/en/diagnostics/UseSystemInformation.md @@ -1,12 +1,15 @@ # Use of system information (UseSystemInformation) + ## Description `SystemInformation` provides data about the computer and configuration in 1C, which can be used for malicious purposes. ## Examples + ## Sources + diff --git a/docs/en/diagnostics/UselessTernaryOperator.md b/docs/en/diagnostics/UselessTernaryOperator.md index 47a5ce94609..3e60e006261 100644 --- a/docs/en/diagnostics/UselessTernaryOperator.md +++ b/docs/en/diagnostics/UselessTernaryOperator.md @@ -1,15 +1,19 @@ # Useless ternary operator (UselessTernaryOperator) + ## Description + The placement of Boolean constants "True" or "False" in the ternary operator indicates poor code thoughtfulness. ## Examples + Useless operators ```Bsl A = ?(B = 1, True, False); ``` + ```Bsl A = ?(B = 0, False, True); ``` @@ -19,6 +23,7 @@ Suspicious operators ```Bsl A = ?(B = 1, True, True); ``` + ```Bsl A = ?(B = 0, 0, False); ``` diff --git a/docs/en/diagnostics/UsingExternalCodeTools.md b/docs/en/diagnostics/UsingExternalCodeTools.md index ef52b5dd285..ccf29781a53 100644 --- a/docs/en/diagnostics/UsingExternalCodeTools.md +++ b/docs/en/diagnostics/UsingExternalCodeTools.md @@ -12,7 +12,7 @@ Examples of invalid execution of "external" code in unsafe mode: * external reports and processings (print forms, etc.) * configuration extensions -### Restrictions +### Diagnostic ignorance in code At the moment, the server context is not analyzed, so diagnostic works both at client and server contexts @@ -23,4 +23,4 @@ At the moment, the server context is not analyzed, so diagnostic works both at c -* [Restriction on the execution of "external" code (RU)](https://its.1c.ru/db/v8std#content:669:hdoc) +* [Restriction on the execution of "external" code](https://its.1c.ru/db/v8std#content:669:hdoc) diff --git a/docs/en/diagnostics/UsingFindElementByString.md b/docs/en/diagnostics/UsingFindElementByString.md index 2b5abd56ba4..02b6068560c 100644 --- a/docs/en/diagnostics/UsingFindElementByString.md +++ b/docs/en/diagnostics/UsingFindElementByString.md @@ -3,9 +3,7 @@ ## Description -The rule finds the use of the `FindByName`, `FindByCode` or `FindByNumber` methods using specific numbers, codes and names of elements or documents. -Similar code may not work correctly in other databases. -Often such code is test code included in the release version, which is also not recommended. +The rule finds the use of the `FindByName`, `FindByCode` or `FindByNumber` methods using specific numbers, codes and names of elements or documents. Similar code may not work correctly in other databases. Often such code is test code included in the release version, which is also not recommended. It is recommended to specify constant data values ​​from the database in "Сonstants" or predefined metadata elements. diff --git a/docs/en/diagnostics/UsingHardcodePath.md b/docs/en/diagnostics/UsingHardcodePath.md index 2bdb2acb2bf..8579f90afec 100644 --- a/docs/en/diagnostics/UsingHardcodePath.md +++ b/docs/en/diagnostics/UsingHardcodePath.md @@ -7,19 +7,19 @@ It's forbidden to store in code: * Paths to files and folders (Windows, Unix) -There are several ways to correctly store this information: +There are several ways to properly store such information: * Store in Constants. * Store in Information registers. * Store in separate module, where this diagnostic is disabled (not recommended). * Store in Catalog, Exchange plan node and etc. -### Nuances +### Implementation features When search for Windows / Unix paths, also check for URL in a string. URL search keywords: -* ``http`` -* ``https`` -* ``ftp`` +* `http` +* `https` +* `ftp` ## Examples diff --git a/docs/en/diagnostics/UsingHardcodeSecretInformation.md b/docs/en/diagnostics/UsingHardcodeSecretInformation.md index 9fc97796180..a3d99e875ec 100644 --- a/docs/en/diagnostics/UsingHardcodeSecretInformation.md +++ b/docs/en/diagnostics/UsingHardcodeSecretInformation.md @@ -10,7 +10,7 @@ It is prohibited to store any confidential information in the code. The confiden If the project uses SSL sub-system, then passwords should be stored in safe storage. -### Addition +### Additionally Strings with all symbols `*` are excluded from the check: @@ -33,6 +33,6 @@ Passwords = CommonModule.ReadDataFromSafeStorage("StoringIdentifier", "Password" Password = Passwords.Password; ``` -## Sources +## Reference -* [Standard: Store passwords safe (RU)](https://its.1c.ru/db/v8std#content:740:hdoc) +* [Standard: Store passwords safe](https://its.1c.ru/db/v8std#content:740:hdoc) diff --git a/docs/en/diagnostics/UsingLikeInQuery.md b/docs/en/diagnostics/UsingLikeInQuery.md index bb61875d02f..dc7f1194c5f 100644 --- a/docs/en/diagnostics/UsingLikeInQuery.md +++ b/docs/en/diagnostics/UsingLikeInQuery.md @@ -9,13 +9,13 @@ In most algorithms, it is possible to do without using the operator `LIKE`, and ## Examples -### Correct +### Diagnostic ignorance in code ```bsl Property LIKE "123%" ``` -### Incorrect: +### Parameter for config ```bsl Property LIKE Table.Template @@ -29,5 +29,5 @@ Property LIKE Table.Template * Полезная информация: [Отказ от использования модальных окон](https://its.1c.ru/db/metod8dev#content:5272:hdoc) * Источник: [Cognitive complexity, ver. 1.4](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) --> -- [Standard. Features of use in operator requests LIKE (RU)](https://its.1c.ru/db/v8std#content:726:hdoc) -- [Developers guide. Pattern-like string validation operator (RU)](https://its.1c.ru/db/v8318doc#bookmark:dev:TI000000506) +- [Standard. Features of use in operator requests LIKE](https://its.1c.ru/db/v8std#content:726:hdoc) +- [Developers guide. Pattern-like string validation operator](https://its.1c.ru/db/v8318doc#bookmark:dev:TI000000506) diff --git a/docs/en/diagnostics/UsingModalWindows.md b/docs/en/diagnostics/UsingModalWindows.md index 7cb1fc303bf..e4a09f0a38d 100644 --- a/docs/en/diagnostics/UsingModalWindows.md +++ b/docs/en/diagnostics/UsingModalWindows.md @@ -11,20 +11,20 @@ Currently, **only the use of global context methods** is diagnosed. Method list: -|Russian variant|English variant| -| :-- | :-- | -|ВОПРОС|DOQUERYBOX| -|ОТКРЫТЬФОРМУМОДАЛЬНО|OPENFORMMODAL| -|ОТКРЫТЬЗНАЧЕНИЕ|OPENVALUE| -|ПРЕДУПРЕЖДЕНИЕ|DOMESSAGEBOX| -|ВВЕСТИДАТУ|INPUTDATE| -|ВВЕСТИЗНАЧЕНИЕ|INPUTVALUE| -|ВВЕСТИСТРОКУ|INPUTSTRING| -|ВВЕСТИЧИСЛО|INPUTNUMBER| -|УСТАНОВИТЬВНЕШНЮЮКОМПОНЕНТУ|INSTALLADDIN| -|УСТАНОВИТЬРАСШИРЕНИЕРАБОТЫСФАЙЛАМИ|INSTALLFILESYSTEMEXTENSION| -|УСТАНОВИТЬРАСШИРЕНИЕРАБОТЫСКРИПТОГРАФИЕЙ|INSTALLCRYPTOEXTENSION| -|ПОМЕСТИТЬФАЙЛ|PUTFILE| +| Russian variant | English variant | +|:---------------------------------------- |:-------------------------- | +| ВОПРОС | DOQUERYBOX | +| ОТКРЫТЬФОРМУМОДАЛЬНО | OPENFORMMODAL | +| ОТКРЫТЬЗНАЧЕНИЕ | OPENVALUE | +| ПРЕДУПРЕЖДЕНИЕ | DOMESSAGEBOX | +| ВВЕСТИДАТУ | INPUTDATE | +| ВВЕСТИЗНАЧЕНИЕ | INPUTVALUE | +| ВВЕСТИСТРОКУ | INPUTSTRING | +| ВВЕСТИЧИСЛО | INPUTNUMBER | +| УСТАНОВИТЬВНЕШНЮЮКОМПОНЕНТУ | INSTALLADDIN | +| УСТАНОВИТЬРАСШИРЕНИЕРАБОТЫСФАЙЛАМИ | INSTALLFILESYSTEMEXTENSION | +| УСТАНОВИТЬРАСШИРЕНИЕРАБОТЫСКРИПТОГРАФИЕЙ | INSTALLCRYPTOEXTENSION | +| ПОМЕСТИТЬФАЙЛ | PUTFILE | ## Examples @@ -39,4 +39,4 @@ ShowMessageBox(, NStr("ru = 'Выберите документ!'; en = 'Select a ## Sources * [Limit on the use of modal windows and synchronous calls (RU)](https://its.1c.ru/db/v8std/content/703/hdoc/) -* Useful information: [Refusal to use modal windows (RU)](https://its.1c.ru/db/metod8dev#content:5272:hdoc) +* Useful information: [Refusal to use modal windows](https://its.1c.ru/db/metod8dev#content:5272:hdoc) diff --git a/docs/en/diagnostics/UsingObjectNotAvailableUnix.md b/docs/en/diagnostics/UsingObjectNotAvailableUnix.md index c28bbf713d8..cc2130d314b 100644 --- a/docs/en/diagnostics/UsingObjectNotAvailableUnix.md +++ b/docs/en/diagnostics/UsingObjectNotAvailableUnix.md @@ -42,5 +42,5 @@ EndIf; ## Sources -* [Features of the development of cross-platform applied solutions (RU)](https://its.1c.ru/db/v8314doc#bookmark:dev:TI000001208) -* [Features of the client application running Linux (RU)](https://its.1c.ru/db/v8314doc#bookmark:dev:TI000001283) +* [Features of the development of cross-platform applied solutions](https://its.1c.ru/db/v8314doc#bookmark:dev:TI000001208) +* [Features of the client application running Linux](https://its.1c.ru/db/v8314doc#bookmark:dev:TI000001283) diff --git a/docs/en/diagnostics/UsingSynchronousCalls.md b/docs/en/diagnostics/UsingSynchronousCalls.md index f1acc9d2327..17868efa165 100644 --- a/docs/en/diagnostics/UsingSynchronousCalls.md +++ b/docs/en/diagnostics/UsingSynchronousCalls.md @@ -11,37 +11,37 @@ Currently, **only the use of global context methods** is diagnosed. Method list: -|Russian variant|English variant| -| :-- | :-- | -|ВОПРОС|DOQUERYBOX| -|ОТКРЫТЬФОРМУМОДАЛЬНО|OPENFORMMODAL| -|ОТКРЫТЬЗНАЧЕНИЕ|OPENVALUE| -|ПРЕДУПРЕЖДЕНИЕ|DOMESSAGEBOX| -|ВВЕСТИДАТУ|INPUTDATE| -|ВВЕСТИЗНАЧЕНИЕ|INPUTVALUE| -|ВВЕСТИСТРОКУ|INPUTSTRING| -|ВВЕСТИЧИСЛО|INPUTNUMBER| -|УСТАНОВИТЬВНЕШНЮЮКОМПОНЕНТУ|INSTALLADDIN| -|УСТАНОВИТЬРАСШИРЕНИЕРАБОТЫСФАЙЛАМИ|INSTALLFILESYSTEMEXTENSION| -|УСТАНОВИТЬРАСШИРЕНИЕРАБОТЫСКРИПТОГРАФИЕЙ|INSTALLCRYPTOEXTENSION| -|ПОДКЛЮЧИТЬРАСШИРЕНИЕРАБОТЫСКРИПТОГРАФИЕЙ|ATTACHCRYPTOEXTENSION| -|ПОДКЛЮЧИТЬРАСШИРЕНИЕРАБОТЫСФАЙЛАМИ|ATTACHFILESYSTEMEXTENSION| -|ПОМЕСТИТЬФАЙЛ|PUTFILE| -|КОПИРОВАТЬФАЙЛ|FILECOPY| -|ПЕРЕМЕСТИТЬФАЙЛ|MOVEFILE| -|НАЙТИФАЙЛЫ|FINDFILES| -|УДАЛИТЬФАЙЛЫ|DELETEFILES| -|СОЗДАТЬКАТАЛОГ|CREATEDIRECTORY| -|КАТАЛОГВРЕМЕННЫХФАЙЛОВ|TEMPFILESDIR| -|КАТАЛОГДОКУМЕНТОВ|DOCUMENTSDIR| -|РАБОЧИЙКАТАЛОГДАННЫХПОЛЬЗОВАТЕЛЯ|USERDATAWORKDIR| -|ПОЛУЧИТЬФАЙЛЫ|GETFILES|ПОМЕСТИТЬФАЙЛЫ|PUTFILES| -|ЗАПРОСИТЬРАЗРЕШЕНИЕПОЛЬЗОВАТЕЛЯ|REQUESTUSERPERMISSION| -|ЗАПУСТИТЬПРИЛОЖЕНИЕ|RUNAPP| +| Russian variant | English variant | +|:---------------------------------------- |:-------------------------- | +| ВОПРОС | DOQUERYBOX | +| ОТКРЫТЬФОРМУМОДАЛЬНО | OPENFORMMODAL | +| ОТКРЫТЬЗНАЧЕНИЕ | OPENVALUE | +| ПРЕДУПРЕЖДЕНИЕ | DOMESSAGEBOX | +| ВВЕСТИДАТУ | INPUTDATE | +| ВВЕСТИЗНАЧЕНИЕ | INPUTVALUE | +| ВВЕСТИСТРОКУ | INPUTSTRING | +| ВВЕСТИЧИСЛО | INPUTNUMBER | +| УСТАНОВИТЬВНЕШНЮЮКОМПОНЕНТУ | INSTALLADDIN | +| УСТАНОВИТЬРАСШИРЕНИЕРАБОТЫСФАЙЛАМИ | INSTALLFILESYSTEMEXTENSION | +| УСТАНОВИТЬРАСШИРЕНИЕРАБОТЫСКРИПТОГРАФИЕЙ | INSTALLCRYPTOEXTENSION | +| ПОДКЛЮЧИТЬРАСШИРЕНИЕРАБОТЫСКРИПТОГРАФИЕЙ | ATTACHCRYPTOEXTENSION | +| ПОДКЛЮЧИТЬРАСШИРЕНИЕРАБОТЫСФАЙЛАМИ | ATTACHFILESYSTEMEXTENSION | +| ПОМЕСТИТЬФАЙЛ | PUTFILE | +| КОПИРОВАТЬФАЙЛ | FILECOPY | +| ПЕРЕМЕСТИТЬФАЙЛ | MOVEFILE | +| НАЙТИФАЙЛЫ | FINDFILES | +| УДАЛИТЬФАЙЛЫ | DELETEFILES | +| СОЗДАТЬКАТАЛОГ | CREATEDIRECTORY | +| КАТАЛОГВРЕМЕННЫХФАЙЛОВ | TEMPFILESDIR | +| КАТАЛОГДОКУМЕНТОВ | DOCUMENTSDIR | +| РАБОЧИЙКАТАЛОГДАННЫХПОЛЬЗОВАТЕЛЯ | USERDATAWORKDIR | +| ПОЛУЧИТЬФАЙЛЫ | GETFILES | +| ЗАПРОСИТЬРАЗРЕШЕНИЕПОЛЬЗОВАТЕЛЯ | REQUESTUSERPERMISSION | +| ЗАПУСТИТЬПРИЛОЖЕНИЕ | RUNAPP | ## Sources * [Limit on the use of modal windows and synchronous calls (RU)](https://its.1c.ru/db/v8std/content/703/hdoc/) -* Useful information: [Refusal to use modal windows (RU)](https://its.1c.ru/db/metod8dev#content:5272:hdoc) +* [Opt out of modal windows (RU)](https://its.1c.ru/db/metod8dev#content:5272:hdoc) * [Correspondence of synchronous methods to asynchronous analogues (RU)](https://its.1c.ru/db/v838doc#bookmark:dev:TI000000438) * [Asynchronous calls to extensions and external components (RU)](http://v8.1c.ru/o7/201412async/index.htm) diff --git a/docs/en/diagnostics/UsingThisForm.md b/docs/en/diagnostics/UsingThisForm.md index da757dc107c..a987dd42069 100644 --- a/docs/en/diagnostics/UsingThisForm.md +++ b/docs/en/diagnostics/UsingThisForm.md @@ -3,8 +3,8 @@ ## Description -In the version of the platform 1C Enterprise 8.3.3, the property of the form ```ThisForm``` was deprecated. Instead, use the property ```ThisObject``` +In the version of the platform 1C Enterprise 8.3.3, the property of the form `ThisForm` was deprecated. Instead, use the property `ThisObject` ## Sources -* [Transfer of configurations to the 1C: Enterprise 8.3 platform without compatibility mode with version 8.2 (RU)](https://its.1c.ru/db/metod8dev#content:5293:hdoc:_top:thisform) +* [Transfer of configurations to the 1C: Enterprise 8.3 platform without compatibility mode with version 8.2](https://its.1c.ru/db/metod8dev#content:5293:hdoc:_top:thisform) diff --git a/docs/en/diagnostics/VirtualTableCallWithoutParameters.md b/docs/en/diagnostics/VirtualTableCallWithoutParameters.md index 6ae18ddff47..1384497e548 100644 --- a/docs/en/diagnostics/VirtualTableCallWithoutParameters.md +++ b/docs/en/diagnostics/VirtualTableCallWithoutParameters.md @@ -40,4 +40,4 @@ Query.Text = "SELECT * Standard: [Using virtual tables (RU)](https://its.1c.ru/db/v8std#content:657:hdoc) * Standard: [Effective use of the virtual table «Turnovers» (RU)](https://its.1c.ru/db/v8std#content:733:hdoc) -* 1C Recommendation: [Using the Condition parameter when accessing a virtual table (RU)](https://its.1c.ru/db/metod8dev/content/5457/hdoc) (RU) +* 1C Recommendation: [Using the Condition parameter when accessing a virtual table](https://its.1c.ru/db/metod8dev/content/5457/hdoc) (RU) diff --git a/docs/en/diagnostics/WrongDataPathForFormElements.md b/docs/en/diagnostics/WrongDataPathForFormElements.md index 5523d77d036..3e48cf410a0 100644 --- a/docs/en/diagnostics/WrongDataPathForFormElements.md +++ b/docs/en/diagnostics/WrongDataPathForFormElements.md @@ -1,14 +1,5 @@ # Form fields do not have a data path (WrongDataPathForFormElements) - -## Description - -# Form fields do not have a data path (WrongDataPathForFormElements) - -| Type | Scope | Severity | Activated
by default | Minutes
to fix | Tags | -|:-------:|:-----:|:----------:|:-----------------------------:|:------------------------:|:---------------:| -| `Error` | `BSL` | `Critical` | `Yes` | `5` | `unpredictable` | - ## Diagnostics description @@ -31,7 +22,7 @@ For command bar buttons associated with the "Data" property with a standard dyna - [General requirements - Standards 1C (RU)](https://its.1c.ru/db/v8std#content:467:hdoc) diff --git a/docs/en/diagnostics/WrongHttpServiceHandler.md b/docs/en/diagnostics/WrongHttpServiceHandler.md index e7546a5d673..73430bab921 100644 --- a/docs/en/diagnostics/WrongHttpServiceHandler.md +++ b/docs/en/diagnostics/WrongHttpServiceHandler.md @@ -1,13 +1,13 @@ # Missing handler for http service (WrongHttpServiceHandler) -## Description +## Diagnostics description -If there is no http-service method handler, then the call to the operation will return neither data, nor errors on the client side of the service, nor errors on the side of the service itself. +In the absence of a http service operation handler, a call to this method will not give out either the data itself, or an error on the client side of the service, or an error on the side of the service itself. -Important: the http service method should only accept one parameter. +It is important to remember that the http service method should only accept one parameter. -The configurator notices violations only when the "Check for the existence of assigned handlers" flag is enabled. +The configurator notices violations of the specified restrictions only when the "Check for the existence of assigned handlers" flag is enabled. ## Examples @@ -21,14 +21,14 @@ EndFunction Correct handler method - only one parameter is specified and there is a method body ```bsl Function StorageGETRequest(Request) - Return ModuleRequests.Get(Request); + Return Requests.Getter(Request); EndFunction ``` Invalid handler method with the wrong number of parameters ```bsl -Function StorageGETRequest(Request, Additional) - Return ModuleRequests.Get(Request); +Function StorageGETRequest(Request, Additionals) + Return Requests.Getter(Request); EndFunction ``` @@ -36,8 +36,8 @@ EndFunction -* [Developers guide 8.3.20. Internet service mechanisms (RU)](https://its.1c.ru/db/v8320doc#bookmark:dev:TI000000783) -* [Configuration guidelines. Web services and HTTP services (RU)](https://its.1c.ru/db/metod8dev/browse/13/-1/1989/2565/2567/2590) +* [Developer Guide 8.3.20 - Web service mechanisms (RU)](https://its.1c.ru/db/v8320doc#bookmark:dev:TI000000783) +* [Web-services and HTTP-services - recommendations from 1C](https://its.1c.ru/db/metod8dev/browse/13/-1/1989/2565/2567/2590) diff --git a/docs/en/diagnostics/WrongUseFunctionProceedWithCall.md b/docs/en/diagnostics/WrongUseFunctionProceedWithCall.md index 425182c1cdc..5f857f04673 100644 --- a/docs/en/diagnostics/WrongUseFunctionProceedWithCall.md +++ b/docs/en/diagnostics/WrongUseFunctionProceedWithCall.md @@ -12,14 +12,11 @@ Using the `ProceedWithCall` function outside of extension methods with the `&Aro ```bsl &AtClient Procedure Test() - - // copy-past from extension - ProceedWithCall(); // Срабатывание здесь - + ProceedWithCall(); // there is error EndProcedure ``` ## Sources -Source: [Extensions. Functionality -> Modules (RU)](https://its.1c.ru/db/pubextensions#content:54:1) +Source: [Extensions. Functionality -> Modules](https://its.1c.ru/db/pubextensions#content:54:1) diff --git a/docs/en/diagnostics/WrongUseOfRollbackTransactionMethod.md b/docs/en/diagnostics/WrongUseOfRollbackTransactionMethod.md index beba0e343b4..0caa065fb52 100644 --- a/docs/en/diagnostics/WrongUseOfRollbackTransactionMethod.md +++ b/docs/en/diagnostics/WrongUseOfRollbackTransactionMethod.md @@ -23,4 +23,4 @@ EndTry; ## Sources -[Transactions: Rules of Use (RU)](https://its.1c.ru/db/v8std/content/783/hdoc/_top/) +Standard: [Transactions: rules of use](https://its.1c.ru/db/v8std#content:783:hdoc:_top) diff --git a/docs/en/diagnostics/WrongWebServiceHandler.md b/docs/en/diagnostics/WrongWebServiceHandler.md index 9d9db46950e..2fe39c773ec 100644 --- a/docs/en/diagnostics/WrongWebServiceHandler.md +++ b/docs/en/diagnostics/WrongWebServiceHandler.md @@ -1,13 +1,13 @@ # Wrong handler for web service (WrongWebServiceHandler) -## Description +## Diagnostics description -If there is no web-service operation handler, then the call to the operation will return neither data, nor errors on the client side of the service, nor errors on the side of the service itself. +In the absence of a web service operation handler, a call to this operation will not give out either the data itself, or an error on the client side of the service, or an error on the side of the service itself. It is important to remember: the number of parameters of the web service operation method must match the number of parameters specified in the settings of the web service operation. -The configurator notices violations only when the "Check for the existence of assigned handlers" flag is enabled. +The configurator notices violations of the specified restrictions only when the "Check for the existence of assigned handlers" flag is enabled. ## Examples @@ -21,14 +21,14 @@ EndFunction Correct handler method - there is a method body and the correct set of parameters is specified ```bsl Function FillCatalogs(MobileDeviceID, MessageExchange) - Return MobileOrders.FillCatalogs(MobileDeviceID, MessageExchange); + Return Mobiles.LoadCatalogs(MobileDeviceID, MessageExchange); EndFunction ``` Invalid handler method with the wrong number of parameters ```bsl -Function FillCatalogs(MobileDeviceID, MessageExchange, Additional) -Return MobileOrders.FillCatalogs(MobileDeviceID, MessageExchange); +Function FillCatalogs(MobileDeviceID, MessageExchange, Additionals) + Return Mobiles.LoadCatlogs(MobileDeviceID, MessageExchange); EndFunction ``` @@ -36,8 +36,8 @@ EndFunction -* [Developers guide 8.3.20. Internet service mechanisms (RU)](https://its.1c.ru/db/v8320doc#bookmark:dev:TI000000783) -* [Configuration guidelines. Web services and HTTP services (RU)](https://its.1c.ru/db/metod8dev/browse/13/-1/1989/2565/2567/2590) +* [Developer Guide 8.3.20 - Web service mechanisms (RU)](https://its.1c.ru/db/v8320doc#bookmark:dev:TI000000783) +* [Web-services and HTTP-services - recommendations from 1C](https://its.1c.ru/db/metod8dev/browse/13/-1/1989/2565/2567/2590) diff --git a/docs/en/diagnostics/YoLetterUsage.md b/docs/en/diagnostics/YoLetterUsage.md index 4c4a1f7429f..69ad659bdc4 100644 --- a/docs/en/diagnostics/YoLetterUsage.md +++ b/docs/en/diagnostics/YoLetterUsage.md @@ -7,4 +7,4 @@ In code it is prohibited to use character "yo" ("ё"). Exception is interface te ## Sources -* Source: [Standard: Modules (RU)](https://its.1c.ru/db/v8std#content:456:hdoc) +* [Standard: Modules texts (RU)](https://its.1c.ru/db/v8std#content:456:hdoc) diff --git a/docs/en/features/ConfigurationFile.md b/docs/en/features/ConfigurationFile.md index b644f953683..92ff61d91f8 100644 --- a/docs/en/features/ConfigurationFile.md +++ b/docs/en/features/ConfigurationFile.md @@ -7,43 +7,43 @@ If there is no configuration file, an attempt will be made to find the ".bsl-lan ## Settings -| Name | Type | Description | -|:---------------------------------------------------------------|:--------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `language` | `String` | Set the language for displaying diagnosed comments. Supported languages:
* `ru` - for Russian (*default*)
* `en` - for English | -| `codeLens` | `JSON-Object` | Contains settings for displaying `lenses` in advanced code/IDEs *(eg [Visual Studio Code](https://code.visualstudio.com/))*, which displays various information above the code block. | -| ⤷   `parameters` | `JSON-Object` | Collection of lens settings. Collection items are json-objects with the following structure:
* *object key* - string, is lens key
* *object value* - if is boolean, then interpreted as lens off-switch (`false`) or on-switch with default parameters (`true`), if is type `json-object`, collection of lens parameters. | -|    ⤷   `cognitiveComplexity` | `Boolean` or `JSON-Object` | Enables displaying the value of the [cognitive complexity](../diagnostics/CognitiveComplexity.md) of the method over its definition. The default is ` true `. Lens options: `complexityThreshold` - lens response threshold. The default is - `-1`. | -|    ⤷   `cyclomaticComplexity` | `Boolean` or `JSON-Object` | Enables displaying the value of the [cyclomatic complexity](../diagnostics/CyclomaticComplexity.md) of the method over its definition. The default is `true`. Lens options: `complexityThreshold` - lens response threshold. The default is - `-1`. | -| `diagnostics` | `JSON-Object` | Contains diagnostic settings | -| ⤷   `computeTrigger` | `String` | Event that will trigger the code analysis procedure to diagnose comments. Possible values:
* `onType` -when editing a file (online) ***on large files can significantly slow down editing ***
* `onSave` - when saving a file (*default*)
`never` - analysis will not be performed | -| ⤷   `ordinaryAppSupport` | `Boolean` | Ordinary client support. Diagnostics will require taking into account the features of a ordinary application. Values:
* `true` - the configuration uses ordinary application *(default)*
* `false` - ignore ordinary application warnings | -| ⤷   `skipSupport` | `String` | This parameter sets **1C configuration** file skipping mode *(for example files are not analyzed for issues)* which are "on support" from vendor configuration. Possible values:
* `withSupport` - skip all modules set "on support" *(all "locks" types)*
* `withSupportLocked` - skip modules set "on support" with prohibited modification *("yellow closed lock")*
* `never` - skip no modules as support mode is not analyzed *(set by default)* | -| ⤷   `mode` | `String` | Setting for controlling the diagnostic settings accounting mode. Possible options:
* `OFF` - All diagnostics are considered to be turned off, regardless of their settings.
* `ON` - All diagnostics enabled by default are considered enabled, the rest - depending on personal settings
* `EXCEPT` - All diagnostics other than those specified are considered enabled.
* `ONLY` - Only the specified diagnostics are considered enabled.
* `ALL` - All diagnostics are considered enabled | -| ⤷   `parameters` | `JSON-Object` | Parameter is a collection of diagnostics parameters. Collection items are json-objects with the following structure:
* *object key* - string, is diagnostic key
* *object value* - if is boolean, then interpreted as diagnostic off-switch (`false`) or on-switch with default parameters (`true`), if is type `json-object`, collection of diagnostic parameters.

Key, if set to ON by default and all allowed parameters and examples are given on the diagnostic page. | -| ⤷   `minimumLSPDiagnosticLevel` | `String` | This parameter allows setting a minimum LSP severity level for running diagnostics. Diagnostics with severity level lower than specified will not run. Possible values:
* `Error` - error
* `Warning` - warning
* `Information` - information
* `Hint` - hint

By default, the parameter is not set and all diagnostics run according to other settings. | -| ⤷   `overrideMinimumLSPDiagnosticLevel` | `String` | This parameter allows setting a minimum severity level for LSP diagnostics. If the diagnostic severity is lower than specified, it will be raised to the specified level. Possible values:
* `Error` - error
* `Warning` - warning
* `Information` - information
* `Hint` - hint

By default, the parameter is not set and diagnostic levels are used according to their definition. | -| ⤷   `metadata` | `JSON-Object` | Parameter is a collection of diagnostic metadata overrides. Collection items are json-objects with the following structure:
* *object key* - string, is diagnostic key
* *object value* - json-object with diagnostic parameters to override. You can override: `type`, `severity`, `scope`, `modules`, `minutesToFix`, `activatedByDefault`, `compatibilityMode`, `tags`, `canLocateOnProject`, `extraMinForComplexity`, `lspSeverity`.

Values from configuration file override those defined in source code. The `lspSeverity` parameter allows explicitly setting LSP severity level (`Error`, `Warning`, `Information`, `Hint`), if not specified - calculated automatically. | -| ⤷   `subsystemsFilter` | `JSON-Object` | Filter by configuration subsystems | -| ⤷   `analyzeOnStart` | `Boolean` | Starting the analysis of the entire project at server startup. If enabled, after the context is built on the client, information about diagnostics in all project files will be sent. | -|    ⤷   `include` | `Array` `String` | List of names of subsystems for which objects the analysis is performed, including child subsystems | -|    ⤷   `exclude` | `Array` `String` | List of names of subsystems excluded from analysis, including child subsystems | -| `documentLink` | `JSON-Object` | Contains documentation link settings | -| ⤷   `showDiagnosticDescription` | `Boolean` | Show additional links to diagnostics documentation. By default, the parameter is off (*set to `false`*) | -| `inlayHint` | `JSON-Object` | ontains settings for displaying `inlay hints` in advanced code editors/IDEs *(for example [Visual Studio Code](https://code.visualstudio.com/))*, which displays various information directly in the code line. | -| ⤷   `parameters` | `JSON-Object` | A collection of inlay hints settings. The elements of the collection are json objects of the following structure:*
*object key* - a string that is an identifier of inlay hint*
*object value* - can take either a boolean value, and then it is interpreted as disabling inlay hint (`false`) or enabling them with parameters by default (`true`), or a value of type `json-object`, which is a set of inlay hint settings. | -|    ⤷   `cognitiveComplexity` | `Boolean` or `JSON-Object` | Enables displaying the value of the [Cognitive Complexity](../diagnostics/CognitiveComplexity.md) method as inlay hints. By default, the setting is set to `true`. | -|    ⤷   `cyclomaticComplexity` | `Boolean` or `JSON-Object` | Enables displaying the value of the [Cyclomatic Complexity](../diagnostics/CyclomaticComplexity.md) method as inlay hints. By default, the setting is set to `true`. | -|    ⤷   `sourceDefinedMethodCall` | `Boolean` or `JSON-Object` | Enables displaying the parameters of the invoked configuration/library method as inlay hints. By default, the setting is set to `true`. Available parameters:
* `showParametersWithTheSameName` - show parameters with names contained in the passed value. The default parameter value is `false`.
* `showDefaultValues` - show default values for parameters not passed. The default value of the parameter is `true`. | -| `capabilities` | `JSON-Object` | Settings for LSP capabilities that the server advertises to clients. Use this section to override defaults such as document sync mode. | -| ⤷   `textDocumentSync` | `JSON-Object` | Settings for text document synchronization. | -|    ⤷   `change` | `String` | Text document sync strategy advertised to the client. Supported values: `Incremental` *(default)*, `Full`, `None`. Changing this value requires restarting BSL Language Server so the new capability is sent to clients. | -| `useDevSite` | `Boolean` | When you turn on the settings, the resulting documentation links will lead to the develop version of the site. By default, the parameter is off (*set to `false`*) | -| `siteRoot` | `String` | The path to the root of the site with the documentation. By default, the parameter value is `"https://1c-syntax.github.io/bsl-language-server"` | -| `traceLog` | `String` | To log all requests *(incoming and outgoing)* between **BSL Language Server** and **Language Client** from used editor/IDE, this parameter sets log file path. The path can set either absolute or relative *(from project root)*, by default the value is not set.

**WARNING**

* When starting **BSL Language Server** overwrites this file
* Speed of interaction between client and server **DRAMATICALLY REDUCED** | -| `configurationRoot` | `String` | This parameter is intended to indicate the root directory the 1C configuration files are located in the project directory. It can be useful if there are several configuration directories in the same project directory or when the structure of the project directory is so complex. By default, the parameter is empty and `BSL Language Server` determines the location of the configuration root directory independently | -| `sendErrors` | `String` | Mode for sending error messages to BSL Language Server developers. More [Monitoring](Monitoring.md).Possible values:
* `ask` - ask permission on every error *(set by default)*.
* `send` - always send error messages.
* `never` - never send error messages. | -| `references` | `JSON-Object` | Contains reference index settings | -| ⤷   `commonModuleAccessors` | `Array` `String` | List of 'Module.Method' patterns for methods returning common module references (e.g. `CommonUse.CommonModule("ModuleName")`). Supports both format with module name (`CommonUse.CommonModule`) and local call (`CommonModule`). By default, includes standard BSL patterns: `ОбщийМодуль`, `CommonModule`, `ОбщегоНазначения.ОбщийМодуль`, `ОбщегоНазначенияКлиент.ОбщийМодуль`, `ОбщегоНазначенияСервер.ОбщийМодуль`, `ОбщегоНазначенияКлиентСервер.ОбщийМодуль`, `ОбщегоНазначенияПовтИсп.ОбщийМодуль` and their English equivalents. | +| Name | Type | Description | +|:-------------------------------------------------------------- |:--------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `language` | `String` | Set the language for displaying diagnosed comments. Supported languages:
* `ru` - for Russian (*default*)
* `en` - for English | +| `codeLens` | `JSON-Object` | Contains settings for displaying `lenses` in advanced code/IDEs *(eg [Visual Studio Code](https://code.visualstudio.com/))*, which displays various information above the code block. | +| ⤷   `parameters` | `JSON-Object` | Collection of lens settings. Collection items are json-objects with the following structure:
* *object key* - string, is lens key
* *object value* - if is boolean, then interpreted as lens off-switch (`false`) or on-switch with default parameters (`true`), if is type `json-object`, collection of lens parameters. | +|    ⤷   `cognitiveComplexity` | `Boolean` or `JSON-Object` | Enables displaying the value of the [cognitive complexity](../diagnostics/CognitiveComplexity.md) of the method over its definition. The default is ` true `. Lens options: `complexityThreshold` - lens response threshold. The default is - `-1`. | +|    ⤷   `cyclomaticComplexity` | `Boolean` or `JSON-Object` | Enables displaying the value of the [cyclomatic complexity](../diagnostics/CyclomaticComplexity.md) of the method over its definition. The default is `true`. Lens options: `complexityThreshold` - lens response threshold. The default is - `-1`. | +| `diagnostics` | `JSON-Object` | Contains diagnostic settings | +| ⤷   `computeTrigger` | `String` | Event that will trigger the code analysis procedure to diagnose comments. Possible values:
* `onType` -when editing a file (online) ***on large files can significantly slow down editing ***
* `onSave` - when saving a file (*default*)
`never` - analysis will not be performed | +| ⤷   `ordinaryAppSupport` | `Boolean` | Ordinary client support. Diagnostics will require taking into account the features of a ordinary application. Values:
* `true` - the configuration uses ordinary application *(default)*
* `false` - ignore ordinary application warnings | +| ⤷   `skipSupport` | `String` | This parameter sets **1C configuration** file skipping mode *(for example files are not analyzed for issues)* which are "on support" from vendor configuration. Possible values:
* `withSupport` - skip all modules set "on support" *(all "locks" types)*
* `withSupportLocked` - skip modules set "on support" with prohibited modification *("yellow closed lock")*
* `never` - skip no modules as support mode is not analyzed *(set by default)* | +| ⤷   `mode` | `String` | Setting for controlling the diagnostic settings accounting mode. Possible options:
* `OFF` - All diagnostics are considered to be turned off, regardless of their settings.
* `ON` - All diagnostics enabled by default are considered enabled, the rest - depending on personal settings
* `EXCEPT` - All diagnostics other than those specified are considered enabled.
* `ONLY` - Only the specified diagnostics are considered enabled.
* `ALL` - All diagnostics are considered enabled | +| ⤷   `parameters` | `JSON-Object` | Parameter is a collection of diagnostics parameters. Collection items are json-objects with the following structure:
* *object key* - string, is diagnostic key
* *object value* - if is boolean, then interpreted as diagnostic off-switch (`false`) or on-switch with default parameters (`true`), if is type `json-object`, collection of diagnostic parameters.

Key, if set to ON by default and all allowed parameters and examples are given on the diagnostic page. | +| ⤷   `minimumLSPDiagnosticLevel` | `String` | This parameter allows setting a minimum LSP severity level for running diagnostics. Diagnostics with severity level lower than specified will not run. Possible values:
* `Error` - error
* `Warning` - warning
* `Information` - information
* `Hint` - hint

By default, the parameter is not set and all diagnostics run according to other settings. | +| ⤷   `overrideMinimumLSPDiagnosticLevel` | `String` | This parameter allows setting a minimum severity level for LSP diagnostics. If the diagnostic severity is lower than specified, it will be raised to the specified level. Possible values:
* `Error` - error
* `Warning` - warning
* `Information` - information
* `Hint` - hint

By default, the parameter is not set and diagnostic levels are used according to their definition. | +| ⤷   `metadata` | `JSON-Object` | Parameter is a collection of diagnostic metadata overrides. Collection items are json-objects with the following structure:
* *object key* - string, is diagnostic key
* *object value* - json-object with diagnostic parameters to override. You can override: `type`, `severity`, `scope`, `modules`, `minutesToFix`, `activatedByDefault`, `compatibilityMode`, `tags`, `canLocateOnProject`, `extraMinForComplexity`, `lspSeverity`.

Values from configuration file override those defined in source code. The `lspSeverity` parameter allows explicitly setting LSP severity level (`Error`, `Warning`, `Information`, `Hint`), if not specified - calculated automatically. | +| ⤷   `subsystemsFilter` | `JSON-Object` | Filter by configuration subsystems | +| ⤷   `analyzeOnStart` | `Boolean` | Starting the analysis of the entire project at server startup. If enabled, after the context is built on the client, information about diagnostics in all project files will be sent. | +|    ⤷   `include` | `Array` `String` | List of names of subsystems for which objects the analysis is performed, including child subsystems | +|    ⤷   `exclude` | `Array` `String` | List of names of subsystems excluded from analysis, including child subsystems | +| `documentLink` | `JSON-Object` | Contains documentation link settings | +| ⤷   `showDiagnosticDescription` | `Boolean` | Show additional links to diagnostics documentation. By default, the parameter is off (*set to `false`*) | +| `inlayHint` | `JSON-Object` | ontains settings for displaying `inlay hints` in advanced code editors/IDEs *(for example [Visual Studio Code](https://code.visualstudio.com/))*, which displays various information directly in the code line. | +| ⤷   `parameters` | `JSON-Object` | A collection of inlay hints settings. The elements of the collection are json objects of the following structure:*
*object key* - a string that is an identifier of inlay hint*
*object value* - can take either a boolean value, and then it is interpreted as disabling inlay hint (`false`) or enabling them with parameters by default (`true`), or a value of type `json-object`, which is a set of inlay hint settings. | +|    ⤷   `cognitiveComplexity` | `Boolean` or `JSON-Object` | Enables displaying the value of the [Cognitive Complexity](../diagnostics/CognitiveComplexity.md) method as inlay hints. By default, the setting is set to `true`. | +|    ⤷   `cyclomaticComplexity` | `Boolean` or `JSON-Object` | Enables displaying the value of the [Cyclomatic Complexity](../diagnostics/CyclomaticComplexity.md) method as inlay hints. By default, the setting is set to `true`. | +|    ⤷   `sourceDefinedMethodCall` | `Boolean` or `JSON-Object` | Enables displaying the parameters of the invoked configuration/library method as inlay hints. By default, the setting is set to `true`. Available parameters:
* `showParametersWithTheSameName` - show parameters with names contained in the passed value. The default parameter value is `false`.
* `showDefaultValues` - show default values for parameters not passed. The default value of the parameter is `true`. | +| `capabilities` | `JSON-Object` | Settings for LSP capabilities that the server advertises to clients. Use this section to override defaults such as document sync mode. | +| ⤷   `textDocumentSync` | `JSON-Object` | Settings for text document synchronization. | +|    ⤷   `change` | `String` | Text document sync strategy advertised to the client. Supported values: `Incremental` *(default)*, `Full`, `None`. Changing this value requires restarting BSL Language Server so the new capability is sent to clients. | +| `useDevSite` | `Boolean` | When you turn on the settings, the resulting documentation links will lead to the develop version of the site. By default, the parameter is off (*set to `false`*) | +| `siteRoot` | `Строка` | The path to the root of the site with the documentation. By default, the parameter value is `"https://1c-syntax.github.io/bsl-language-server"` | +| `traceLog` | `Строка` | To log all requests *(incoming and outgoing)* between **BSL Language Server** and **Language Client** from used editor/IDE, this parameter sets log file path. The path can set either absolute or relative *(from project root)*, by default the value is not set.

**WARNING**

* When starting **BSL Language Server** overwrites this file
* Speed of interaction between client and server **DRAMATICALLY REDUCED** | +| `configurationRoot` | `Строка` | This parameter is intended to indicate the root directory the 1C configuration files are located in the project directory. It can be useful if there are several configuration directories in the same project directory or when the structure of the project directory is so complex. By default, the parameter is empty and `BSL Language Server` determines the location of the configuration root directory independently | +| `sendErrors` | `Строка` | Mode for sending error messages to BSL Language Server developers. Подробнее - на странице [Мониторинг и отправка ошибок](Monitoring.md). More [Monitoring](Monitoring.md).Possible values:
* `ask` - ask permission on every error *(set by default)*.
* `send` - всегда отправлять сообщения об ошибках.
* `send` - always send error messages.
* `never` - never send error messages. | +| `references` | `JSON-Object` | Contains reference index settings | +| ⤷   `commonModuleAccessors` | `Array` `String` | List of 'Module.Method' patterns for methods returning common module references (e.g. `CommonUse.CommonModule("ModuleName")`). Supports both format with module name (`CommonUse.CommonModule`) and local call (`CommonModule`). By default, includes standard BSL patterns: `ОбщийМодуль`, `CommonModule`, `ОбщегоНазначения.ОбщийМодуль`, `ОбщегоНазначенияКлиент.ОбщийМодуль`, `ОбщегоНазначенияСервер.ОбщийМодуль`, `ОбщегоНазначенияКлиентСервер.ОбщийМодуль`, `ОбщегоНазначенияПовтИсп.ОбщийМодуль` and their English equivalents. | You can use the following JSON schema to make it easier to compile and edit a configuration file: @@ -58,8 +58,7 @@ https://1c-syntax.github.io/bsl-language-server/configuration/schema.json This example demonstrates filtering diagnostics by LSP severity level: * Language of diagnostics messages - English; -* Changes the diagnostic setting [LineLength - Line length limit](../diagnostics/LineLength.md) by setting - line length limit of 140 characters; +* Changes the diagnostic setting [LineLength - Line length limit](../diagnostics/LineLength.md) by setting line length limit of 140 characters; * Disable [MethodSize - Method size restriction diagnostic](../diagnostics/MethodSize.md). * Filters diagnostics, not running diagnostics with severity level below `Warning` (Information and Hint diagnostics will not run) @@ -85,8 +84,7 @@ This example demonstrates adjusting diagnostic severity display: * Language of diagnostics messages - English; * Enables the calculation of diagnostics in continuous mode (`computeTrigger = onType`) -* Diagnostics are calculated only for the objects of the "StandardSubsystems" subsystem, with the exception of "ReportVariants" and " - ObjectVersioning" +* Diagnostics are calculated only for the objects of the "StandardSubsystems" subsystem, with the exception of "ReportVariants" and " ObjectVersioning" * Raises the severity level to `Warning` for all running diagnostics (diagnostics with Information or Hint will be displayed as Warning) * Overrides the diagnostic type `EmptyCodeBlock` to `ERROR` and severity to `BLOCKER` diff --git a/docs/en/features/Monitoring.md b/docs/en/features/Monitoring.md index 2bae2d04372..03e714a09c3 100644 --- a/docs/en/features/Monitoring.md +++ b/docs/en/features/Monitoring.md @@ -12,18 +12,18 @@ unauthorized users. In the [configuration file](ConfigurationFile.md) of the BSL Language Server, you can configure the mode for sending error messages. The send mode can take one of three values: -* ask (default); -* send always; -* never send. +- ask (default); +- send always; +- never send. If the configuration file is missing a setting or has a value of "ask", when an error occurs the connected language client (used by the IDE) is sent a question about further actions with an error with the following answer options: -* send this error but ask again; -* don't send this error but ask again. -* send this error and don't ask again; -* don't send this error and don't ask again; +- send this error but ask again; +- don't send this error but ask again. +- send this error and don't ask again; +- don't send this error and don't ask again; You can completely refuse to answer (for example, by clicking on the cross next to the notification with the question). Lack of response is perceived as "don't send this error, but ask again". @@ -40,10 +40,11 @@ Some messages sent between Language Client and BSL Language Server contain sourc or the entire text of the file. These fragments can also be attached to the sent message. -Sending message example: +Пример отправляемого события об ошибке: ??? event.json + ```` ```json { "event_id": "746e2e82f4c1499abcdd935bc4c26644", @@ -277,4 +278,5 @@ Sending message example: "version": "7", "location": null } - ``` \ No newline at end of file + ``` + ```` \ No newline at end of file diff --git a/docs/en/features/index.md b/docs/en/features/index.md index 8111df669e6..31099df80f7 100644 --- a/docs/en/features/index.md +++ b/docs/en/features/index.md @@ -4,4 +4,4 @@ Additional features BSL Language Server * [Configuration](ConfigurationFile.md) * [Diagnostic ignorance](DiagnosticIgnorance.md) -* [Monitoring](Monitoring.md) +* [Мониторинг и отправка ошибок](Monitoring.md) diff --git a/docs/en/index.md b/docs/en/index.md index e0805483ee5..8b137891791 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -1,277 +1 @@ -# BSL Language Server -[![Actions Status](https://github.com/1c-syntax/bsl-language-server/workflows/Java%20CI/badge.svg)](https://github.com/1c-syntax/bsl-language-server/actions) -[![Download](https://img.shields.io/github/release/1c-syntax/bsl-language-server.svg?label=download&style=flat)](https://github.com/1c-syntax/bsl-language-server/releases/latest) -[![Latest release](https://badgen.net/github/release/1c-syntax/bsl-language-server)](https://github.com/1c-syntax/bsl-language-server/releases) -[![GitHub Releases](https://img.shields.io/github/downloads/1c-syntax/bsl-language-server/latest/total?style=flat-square)](https://github.com/1c-syntax/bsl-language-server/releases) -[![GitHub All Releases](https://img.shields.io/github/downloads/1c-syntax/bsl-language-server/total?style=flat-square)](https://github.com/1c-syntax/bsl-language-server/releases) -[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=1c-syntax_bsl-language-server&metric=alert_status)](https://sonarcloud.io/dashboard?id=1c-syntax_bsl-language-server) -[![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=1c-syntax_bsl-language-server&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=1c-syntax_bsl-language-server) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=1c-syntax_bsl-language-server&metric=coverage)](https://sonarcloud.io/dashboard?id=1c-syntax_bsl-language-server) -[![Transifex](https://img.shields.io/badge/translation-transifex-green)](https://www.transifex.com/1c-syntax/bsl-language-server) -[![Benchmark](bench/benchmark.svg)](bench/index.html) -[![telegram](https://img.shields.io/badge/telegram-chat-green.svg)](https://t.me/bsl_language_server) - -[Language Server Protocol](https://microsoft.github.io/language-server-protocol/) implementation for 1C (BSL) - 1C:Enterprise 8 and [OneScript](http://oscript.io) languages. - -* [Contributing guidelines](contributing/index.md) -* Capabilities -* Run from command line -* Run in websocket mode -* Run in analyzer mode -* Run in formatter mode -* Configuration file -* Reporters -* Diagnostics -* Features -* [Frequently asked questions](faq.md) -* [System requirements](systemRequirements.md) -* Acknowledgments - - - -Perfomance measurement - [SSL 3.1](../bench/index.html) - -## Features - -* File formatting -* Selected region formatting -* Symbol definition for current file (regions, procedures, functions, variables, defined via `Var` keyword) -* Folding regions definition `#Region`, `#If`, procedures and functions, code blocks, queries -* Methods "Cognitive Complexity" and "Cyclomatic Complexity" scores -* Tooltip on local methods and methods of common / manager modules -* Go to method definitions -* Finding places to use methods -* Method call hierarchy -* Expand selection -* Display color representation and convert between `Color` and `WebColors` -* Diagnostics -* Quick fixes and code actions for several diagnostics -* Run diagnostics engine from command line -* Run formatter engine from command line -* Renaming Symbols - -## Supported protocol operations - -??? workspace - | Operation | Support | Comment | - | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | - | [didChangeWorkspaceFolders](https://microsoft.github.io/language-server-protocol/specification-current#workspace_didChangeWorkspaceFolders) | no | | - | [didChangeConfiguration](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeConfiguration) | yes | with restrictions see [#1431](https://github.com/1c-syntax/bsl-language-server/issues/1431) | - | [didChangeWatchedFiles](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWatchedFiles) | yes | | - | [symbol](https://microsoft.github.io/language-server-protocol/specification#workspace_symbol) | yes | | - | [executeCommand](https://microsoft.github.io/language-server-protocol/specification#workspace_executeCommand) | yes | | - | [diagnostic/refresh](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_diagnostic_refresh) | yes | sent on configuration change | - | [applyEdit](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit) | no | | - | [willCreateFiles](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_willCreateFiles) | no | | - -??? "Text Synchronization" - | Operation | Supported | Comment | - | --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | - | [didOpen](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didOpen) | yes | | | - | [didChange](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didChange) | yes | textDocumentSyncKind = Incremental | | - | [didClose](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didClose) | yes | | | - | [didSave](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didSave) | yes | | | - | [willSave](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_willSave) | no | | | - | [willSaveWaitUntil](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_willSaveWaitUntil) | no | | | - -??? textDocument - | Operation | Support | Commentary | Is configured? | - | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------------- | - | [publishDiagnostics](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_publishDiagnostics) | yes | tagSupport = true
versionSupport = true
[diagnostics](./diagnostics/index.md) | yes | - | [diagnostic](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_diagnostic) | yes | interFileDependencies = true
workspaceDiagnostics = false | no | - | [completion](https://github.com/1c-syntax/bsl-language-server/blob/develop/docs/diagnostics/index.md) | no | resolveProvider = false | | - | [completionItem/resolve](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#completionItem_resolve) | no | | | - | [hover](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_hover) | yes | contentFormat = MarkupContent | | - | [signatureHelp](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_signatureHelp) | no | | | - | [declaration](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_declaration) | no | not applicable in 1C:Enterprise | | - | [definition](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition) | yes | linkSupport = true | | - | [typeDefinition](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_typeDefinition) | no | | | - | [implementation](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_implementation) | no | not applicable in 1C:Enterprise | | - | [references](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references) | yes | | | - | [documentHighlight](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentHighlight) | no | | | - | [documentSymbol](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol) | yes | hierarchicalDocumentSymbolSupport = true | | - | [codeAction](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction) | yes | codeActionKinds = ? (см. [#1433](https://github.com/1c-syntax/bsl-language-server/issues/1433))
isPreferredSupport = true | yes | - | [codeAction/resolve](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#codeAction_resolve) | no | | | - | [codeLens](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeLens) | yes | resolveProvider = false | yes | - | [codeLens/resolve](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#codeLens_resolve) | yes | | | - | [codeLens/refresh](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#codeLens_refresh) | yes | | | - | [documentLink](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentLink) | yes | Showing hyperlinks to documentation on diagnostics.
tooltipSupport = true
resolveProvider = false | yes | - | [documentLink/resolve](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#documentLink_resolve) | no | | | - | [documentColor](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentColor) | yes | | | - | [colorPresentation](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_colorPresentation) | yes | | | - | [formatting](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting) | yes | | | - | [rangeFormatting](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rangeFormatting) | yes | | | - | [onTypeFormatting](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_onTypeFormatting) | no | | | - | [rename](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rename) | yes | | | - | [prepareRename](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_prepareRename) | yes | | | - | [foldingRange](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_foldingRange) | yes | | | - | [selectionRange](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_selectionRange) | yes | | | - | [prepareCallHierarchy](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_prepareCallHierarchy) | yes | | | - | [callHierarchy/incomingCalls](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#callHierarchy_incomingCalls) | yes | | | - | [callHierarchy/outgoingCalls](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#callHierarchy_outgoingCalls) | yes | | | - | [semanticTokens/full](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_semanticTokens) | yes | multilineTokenSupport = true | | - | [semanticTokens/full/delta](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_semanticTokens) | no | | | - | [semanticTokens/range](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_semanticTokens) | no | | | - | [linkedEditingRange](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_linkedEditingRange) | no | | | - | [moniker](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_moniker) | no | | | - | [inlayHint](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlayHint) | yes | resolveProvider = false | yes | - | [inlayHint/resolve](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#inlayHint_resolve) | no | | | - | [inlayHint/refresh](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_inlayHint_refresh) | yes | | | - - - -## Run from command line - -jar-files run through `java -jar path/to/file.jar`. - -```sh -java -jar bsl-language-server.jar --help - -BSL language server -Usage: bsl-language-server [-h] [-c=] [COMMAND [ARGS]] - -c, --configuration= - Path to language server configuration file - -h, --help Show this help message and exit -Commands: - analyze, -a, --analyze Run analysis and get diagnostic info - format, -f, --format Format files in source directory - version, -v, --version Print version - lsp, --lsp LSP server mode (default) - websocket, -w, --websocket Websocket server mode -``` - -Starting BSL Language Server in standard mode will run the Language Server communicating via [LSP]([language server protocol](https://microsoft.github.io/language-server-protocol/)). stdin and stdout are used for communication. - -By default diagnostics texts are displayed in Russian. To switch the diagnostics text language you need to set parameter `language` in configuration file or raise an event `workspace/didChangeConfiguration`: - -```json -{ - "language": "en" -} -``` - - - -## Run in websocket mode - -By default, interaction with the server goes through standard input / output streams. -But you can run BSL Language Server with a built-in web server and interact with it via websocket. - -To do this, start the BSL Language Server with the `--websocket` or `-w` option: - -```sh -Usage: bsl-language-server websocket [-h] [--app.websocket.lsp-path=] - [-c=] [--server.port=] -Websocket server mode - --app.websocket.lsp-path= - Path to LSP endpoint. Default is /lsp - -c, --configuration= Path to language server configuration file - -h, --help Show this help message and exit - --server.port= Port to listen. Default is 8025 -``` - -Once started, BSL Language Server will be available at `ws://localhost:8025/lsp`. - -To redefine the port to the LSP server, you must use the `--server.port` option and the port number. -To redefine the path to the LSP server, you must use the `--app.websocket.lsp-path` option and a path starting with `/`. - -An example of running BSL Language Server in websocket mode with port 8080: - -```sh -java -jar bsl-language-server.jar --websocket --server.port=8080 -``` - -> For large projects, it is recommended to specify the -Xmx parameter, which is responsible for the RAM limit for the java process. The amount of allocated memory depends on the size of the analyzed codebase. - -```sh -java -Xmx4g -jar bsl-language-server.jar ... other parameters -``` - - - -## Run in analyzer mode - -To run in analyzer mode use parameter `--analyze` (short `-a`). - -```sh -Usage: bsl-language-server analyze [-hq] [-c=] [-o=] [-s=] - [-r=]... -Run analysis and get diagnostic info - -c, --configuration= - Path to language server configuration file - -h, --help Show this help message and exit - -o, --outputDir= Output report directory - -q, --silent Silent mode - -r, --reporter= Reporter key (console, junit, json, tslint, generic) - -s, --srcDir= Source directory - -w, --workspaceDir= - Workspace directory -``` - -To set source code folder for analysis use parameter `--srcDir` (short `-s`) followed by the path (relative or absolute) to the source code folder. -To generate an analysis report you need to specify one or more reporters. To specify reporter use parameter `--reporter` or `-r`, followed by reporter key. You may specify several reporters. The list of reporters see in section **Reporters**. - -Command line example to run analysis: - -```sh -java -jar bsl-language-server.jar --analyze --srcDir ./src/cf --reporter json -``` - -> When run analysis for large code base it is recommended to set parameter {code0}-Xmx{/code0} to set maximum limit of memory being allocated to java process. The size of allocated memory depends on the size of code base for analysis. - -```sh -java -Xmx4g -jar bsl-language-server.jar ... other parameters -``` - - - -## Run in formatter mode - -To run in formatter mode use parameter `--format` (short `-f`). - -```sh -Usage: bsl-language-server format [-hq] [-s=] -Format files in source directory - -h, --help Show this help message and exit - -q, --silent Silent mode - -s, --src= Source directory or file -``` - -To set source code folder (or source file) for formatting use parameter `--src` (short `-s`) followed by the path (relative or absolute) to the source code folder (or file). - -Command line example to run formatting: - -```sh -java -jar bsl-language-server.jar --format --src ./src/cf -``` - - - -## Configuration file - -A detailed description of the configuration file is given on [this page](features/ConfigurationFile.md) - - - -## Special thanks - -Many thanks to all [contributors](https://github.com/1c-syntax/bsl-language-server/graphs/contributors) to the project, to all who participated in the discussions, who helped with the testing. - -You are awesome! - -Thanks to companies supporting open source projects, and especially to those who supported us: - ---- - -[![JetBrains](assets/images/jetbrains-variant-4.png)](https://www.jetbrains.com?from=bsl-language-server) - -[JetBrains](https://www.jetbrains.com?from=bsl-language-server) is the creator of professional software for development. JetBrains has offered an open source license for his products, including `IntelliJ IDEA Ultimate`. - -`IntelliJ IDEA Ultimate` is one of the best tools in its class. - ---- - -[![Digilabs](https://digilabs.ru/1c359e054740a0b75966f8c4babc239a.svg)](https://Digilabs.ru) - -[Digilabs](https://digilabs.ru) - authors of `Alkir` - a software package for monitoring the performance of systems based on 1C:Enterprise 8. Digilabs provides us with server facilities for continuous performance testing of the BSL Language Server.