-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed description and added new func #79
Conversation
WalkthroughThe changes in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Module
User ->> Module: Call function to process query
Module ->> УдалитьНенужныеПоля: Remove unnecessary fields
УдалитьНенужныеПоля ->> Module: Return cleaned query
Module ->> User: Return processed result
Possibly related issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/cf/CommonModules/пбп_СхемыЗапросов/Ext/Module.bsl (4 hunks)
Additional context used
GitHub Check: 1C: Project SubSystems Library Sonarqube Results
src/cf/CommonModules/пбп_СхемыЗапросов/Ext/Module.bsl
[warning] 783-783: src/cf/CommonModules/пбп_СхемыЗапросов/Ext/Module.bsl#L783
Создайте константу с понятным названием, присвойте ей значение "20" и используйте эту константу вместо магического числа.
Additional comments not posted (1)
src/cf/CommonModules/пбп_СхемыЗапросов/Ext/Module.bsl (1)
Line range hint
139-231
: Ensure consistency and correctness in the newly addedДобавитьПоляВыборкиВЗапрос
.The function
ДобавитьПоляВыборкиВЗапрос
properly handles different types of input and extends the functionality to handle multiple fields. Make sure that all edge cases are covered in unit tests, especially the conditions underЕсли ТипЗнч(ИзменяемыйЗапрос) = Тип("ЗапросУничтоженияТаблицыСхемыЗапроса")
.
Процедура УдалитьНенужныеПоля(ТекстЗапроса) | ||
|
||
// Удалим "мусор" схемы запроса | ||
НомерПоля = 1; | ||
ИскомаяПодстрока = " КАК Поле" + НомерПоля; | ||
НайденоМусорноеПоле = СтрНайти(ТекстЗапроса, ИскомаяПодстрока) > 0; | ||
Пока НайденоМусорноеПоле И НомерПоля < 20 Цикл | ||
ТекстЗапроса = СтрЗаменить(ТекстЗапроса, ИскомаяПодстрока, ""); | ||
|
||
НомерПоля = НомерПоля + 1; | ||
ИскомаяПодстрока = " КАК Поле" + НомерПоля; | ||
НайденоМусорноеПоле = СтрНайти(ТекстЗапроса, ИскомаяПодстрока) > 0; | ||
КонецЦикла; | ||
|
||
КонецПроцедуры |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimize the procedure УдалитьНенужныеПоля
by using a constant.
- Пока НайденоМусорноеПоле И НомерПоля < 20 Цикл
+ Константа МаксимальноеКоличествоПолей = 20
+ Пока НайденоМусорноеПоле И НомерПоля < МаксимальноеКоличествоПолей Цикл
This change, as suggested by the static analysis tool, will make the code more readable by replacing the "magic number" with a named constant, clarifying its purpose.
Committable suggestion was skipped due to low confidence.
Tools
GitHub Check: 1C: Project SubSystems Library Sonarqube Results
[warning] 783-783: src/cf/CommonModules/пбп_СхемыЗапросов/Ext/Module.bsl#L783
Создайте константу с понятным названием, присвойте ей значение "20" и используйте эту константу вместо магического числа.
// Удалим "мусор" схемы запроса | ||
УдалитьНенужныеПоля(НовыйТекстЗапроса); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor the call to УдалитьНенужныеПоля
to ensure it's only performed if needed.
Consider checking if there are actually fields to remove before calling УдалитьНенужныеПоля
to avoid unnecessary processing:
+ Если ЕстьПоляДляУдаления(НовыйТекстЗапроса) Тогда
УдалитьНенужныеПоля(НовыйТекстЗапроса);
+ КонецЕсли;
You might need to implement ЕстьПоляДляУдаления
to check for fields that qualify as "unnecessary" based on your application's logic.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// Удалим "мусор" схемы запроса | |
УдалитьНенужныеПоля(НовыйТекстЗапроса); | |
// Удалим "мусор" схемы запроса | |
Если ЕстьПоляДляУдаления(НовыйТекстЗапроса) Тогда | |
УдалитьНенужныеПоля(НовыйТекстЗапроса); | |
КонецЕсли; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/cf/CommonModules/пбп_СхемыЗапросов/Ext/Module.bsl (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/cf/CommonModules/пбп_СхемыЗапросов/Ext/Module.bsl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/cf/CommonModules/пбп_СхемыЗапросов/Ext/Module.bsl (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/cf/CommonModules/пбп_СхемыЗапросов/Ext/Module.bsl
Summary by CodeRabbit