Skip to content

Fix/interface#127

Open
MksmOrlov wants to merge 6 commits intomainfrom
fix/interface
Open

Fix/interface#127
MksmOrlov wants to merge 6 commits intomainfrom
fix/interface

Conversation

@MksmOrlov
Copy link
Copy Markdown
Member

@MksmOrlov MksmOrlov commented May 19, 2025


Important

Refactor sc-component-manager interface by renaming classes, removing unused code, and adding new command handling functionalities.

  • Renames:
    • CommandsConstantsFlags to CommandsSearchFlags in command_constants.hpp and command_constants.cpp.
  • Removals:
    • Removed GetCommandParameters from common_utils.hpp and common_utils.cpp.
    • Removed several unused keynodes from sc_component_manager_keynodes.hpp.
  • Additions:
    • Added sc_component_manager_command_handler.cpp and sc_component_manager_command_handler.hpp for handling commands.
    • Added sc_component_manager_command_parser.hpp for parsing commands.
  • Modifications:
    • Refactored Execute in sc_component_manager_command_search.cpp to use template-based search.
    • Updated Initialize and Shutdown in sc_component_manager_module.cpp to use new command handler.
    • Updated ScComponentManager in sc_component_manager.hpp to manage command handling threads.

This description was created by Ellipsis for 89aba98. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to 89aba98 in 1 minute and 56 seconds. Click for details.
  • Reviewed 742 lines of code in 13 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/manager/console-interface/command_handler/sc_component_manager_command_handler.cpp:44
  • Draft comment:
    Typo: The variable 'm_searchQuasybinaryRelations' is misspelled. Consider renaming it to 'm_searchQuasibinaryRelations' for clarity.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While the comment identifies a potential spelling issue, several factors make me lean towards removing it: 1) The spelling difference is minor and both variants could be valid 2) The code is functional either way 3) Without more domain context, we can't be certain which spelling is actually correct 4) Variable naming suggestions that don't impact functionality should be very compelling to keep. I could be wrong about the domain terminology - perhaps "quasibinary" is definitively incorrect in this context. Also, consistent terminology is important for maintainability. While consistency is important, we don't have enough context about the correct domain terminology, and the comment doesn't demonstrate strong evidence that this is actually incorrect. The comment should be removed as it makes a spelling suggestion without strong evidence that the current spelling is actually wrong, and the change would not materially improve the code.
2. src/manager/console-interface/command_handler/sc_component_manager_command_handler.cpp:132
  • Draft comment:
    There is duplicated logic in FormSearchActionNodeParameter for building the scsTemplate. Consider refactoring to reduce duplication and improve readability.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
3. src/manager/console-interface/command_handler/sc_component_manager_command_handler.cpp:31
  • Draft comment:
    Consider using a smart pointer (e.g., std::unique_ptr) for m_context instead of raw new/delete to improve exception safety and reduce the risk of memory leaks.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
4. src/manager/console-interface/command_parser/sc_component_manager_command_parser.hpp:162
  • Draft comment:
    The DeleteMultipleSpaces() function manually loops to remove extra spaces. Consider using std::regex_replace or a standard algorithm for improved clarity and maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
5. src/manager/console-interface/command_handler/sc_component_manager_command_handler.hpp:30
  • Draft comment:
    Typo: "m_searchQuasybinaryRelations" likely meant to be "m_searchQuasiBinaryRelations". Please correct if appropriate.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While this appears to be a legitimate typo (quasy vs quasi), our rules state we should only keep comments that clearly require code changes. Variable naming is important for code quality, but without more context about the codebase's conventions or whether this is actually incorrect (could be an intentional domain-specific spelling), we can't be 100% certain this needs to change. The comment is also phrased tentatively with "likely meant to be" and "if appropriate". The spelling could be intentional or follow some domain-specific convention we're not aware of. The comment also asks for confirmation rather than making a direct assertion. Even if this is a real typo, the tentative nature of the comment and our rule against asking for confirmations suggests we should err on the side of removing it. Delete this comment as it's speculative and asks for confirmation rather than making a clear assertion about a required change.

Workflow ID: wflow_FMzlYyyLmKNMY7iC

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.


for (auto const & [parameterName, parameterRelation, templateAlias] : searchByRelation)
context->SearchByTemplate(searchTemplate,
[&context, searchStructure](ScTemplateResultItem const & item)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lambda in Execute() (lines 27-34) does not update or accumulate any search results. This empty block may be a bug as componentsSpecifications remains always empty.

Suggested change
[&context, searchStructure](ScTemplateResultItem const & item)
[&context, &componentsSpecifications, searchStructure](ScTemplateResultItem const & item)

{CommandsSearchFlags::IDTF, keynodes::ScComponentManagerKeynodes::rrel_components},
{CommandsSearchFlags::SET, keynodes::ScComponentManagerKeynodes::rrel_sets}};

m_searchQuasybinaryRelations = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typographical Issue: The variable name m_searchQuasybinaryRelations uses 'quasybinary' which appears to be a misspelling of 'quasibinary' (as indicated by the comment and related context). Consider renaming it for consistency.

void Run();

/*!
* @brief Stor sc-component-manager. Join its thread instance
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typographical error in the doc comment: Stor sc-component-manager. Join its thread instance. It seems you meant Stop sc-component-manager. Join its thread instance. Please fix the typo.

Suggested change
* @brief Stor sc-component-manager. Join its thread instance
* @brief Stop sc-component-manager. Join its thread instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant