Skip to content

Conversation

@payetvin
Copy link
Contributor

@payetvin payetvin commented Nov 26, 2025

No description provided.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Nov 26, 2025
}
}

void checkModel(Model& model)
Copy link
Contributor

Choose a reason for hiding this comment

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

const

}
}

void checkLocations(Modeler::Data& data)
Copy link
Contributor

Choose a reason for hiding this comment

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

const

@payetvin payetvin marked this pull request as ready for review December 1, 2025 15:37
Comment on lines 36 to 45
const std::vector<const Node*> ParentNode::getConstOperands() const
{
std::vector<const Node*> constOperands;
for (const auto* operand: operands_)
{
constOperands.push_back(operand);
}
return constOperands;
}

Copy link
Member

Choose a reason for hiding this comment

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

  1. Naming You can have 2 member functions with the same name but different constness. The compiler will get the correct one without any problem
  2. Style You can construct a std::vector from two iterators
Suggested change
const std::vector<const Node*> ParentNode::getConstOperands() const
{
std::vector<const Node*> constOperands;
for (const auto* operand: operands_)
{
constOperands.push_back(operand);
}
return constOperands;
}
const std::vector<const Node*> ParentNode::getOperands() const
{
std::vector<const Node*> constOperands(operands_.begin(), operands_.end());
return constOperands;
}

Copy link
Member

Choose a reason for hiding this comment

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

  1. Style For a function f, ReturnType f() and const ReturnType f() are equivalent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Functions that differ only in their return type cannot be overloaded
ParentNode.h:74:31: note: previous declaration is here [ovl_diff_return_type]

// Convert the tree to a string, used for error messages
Expressions::Visitors::PrintVisitor printVisitor;
std::string nodeExpression = printVisitor.dispatch(n);

Copy link
Member

Choose a reason for hiding this comment

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

Print the whole expression, don't bother

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our expression object contains the node, in this instance we only have the node.
I created a function expressionAtPortField to avoid using the printVisitor

Comment on lines 36 to 45
const std::vector<const Node*> ParentNode::getConstOperands() const
{
std::vector<const Node*> constOperands;
for (const auto* operand: operands_)
{
constOperands.push_back(operand);
}
return constOperands;
}

Copy link
Member

Choose a reason for hiding this comment

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

  1. Style For a function f, ReturnType f() and const ReturnType f() are equivalent

@flomnes flomnes changed the title Modeler 6.5: valid location Modeler 6.5: valid location [ANT-4045] Dec 9, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 9, 2025

@flomnes flomnes merged commit 82458d9 into develop Dec 10, 2025
10 checks passed
@flomnes flomnes deleted the feature/valid-location branch December 10, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants