Skip to content

Conversation

@Grufoony
Copy link
Collaborator

@Grufoony Grufoony commented Apr 15, 2025

Close #297

@Grufoony Grufoony requested review from Copilot and filippodll April 15, 2025 15:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

@codecov
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 68.80734% with 34 lines in your changes missing coverage. Please review.

Project coverage is 86.62%. Comparing base (9eb43b4) to head (24f7960).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/dsm/headers/RoadDynamics.hpp 60.25% 31 Missing ⚠️
src/dsm/sources/RoadNetwork.cpp 50.00% 2 Missing ⚠️
src/dsm/sources/Road.cpp 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #298      +/-   ##
==========================================
- Coverage   86.92%   86.62%   -0.30%     
==========================================
  Files          38       38              
  Lines        5844     5938      +94     
  Branches      581      597      +16     
==========================================
+ Hits         5080     5144      +64     
- Misses        764      794      +30     
Flag Coverage Δ
unittests 86.62% <68.80%> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

if (pStreetTemp->nExitingAgents() == 0) {
continue;
}
if (intersection.streetPriorities().contains(streetId)) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 14.4 rule Note

MISRA 14.4 rule
// The problem arises only when you have to turn left
for (auto i{0}; i < pStreetTemp->nLanes(); ++i) {
// check queue is not empty and take the top agent
if (pStreetTemp->queue(i).empty()) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 14.4 rule Note

MISRA 14.4 rule
auto const& pStreetTemp{this->graph().edge(streetId)};
for (auto i{0}; i < pStreetTemp->nLanes(); ++i) {
// check queue is not empty and take the top agent
if (pStreetTemp->queue(i).empty()) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 14.4 rule Note

MISRA 14.4 rule
for (auto const& sourceId :
this->graph().adjacencyMatrix().getCol(pNode->id())) {
auto const streetId = sourceId * N + pNode->id();
auto const streetId{sourceId * N + pNode->id()};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
case Direction::LEFT:
pStreet->enqueue(nLanes - 1);
break;
case Direction::RIGHT:

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 16.2 rule Note

MISRA 16.2 rule
Direction Road::turnDirection(double const& previousStreetAngle) const {
auto const deltaAngle{this->deltaAngle(previousStreetAngle)};
if (std::abs(deltaAngle) >= std::numbers::pi) {
return Direction::UTURN;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
if (std::abs(deltaAngle) >= std::numbers::pi) {
return Direction::UTURN;
}
if (std::abs(deltaAngle) < std::numbers::pi / 8) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
return Direction::UTURN;
}
if (std::abs(deltaAngle) < std::numbers::pi / 8) {
return Direction::STRAIGHT;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
return Direction::STRAIGHT;
}
if (deltaAngle < 0.) {
return Direction::RIGHT;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
@Grufoony Grufoony requested a review from Copilot April 16, 2025 08:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

test/Test_dynamics.cpp:1028

  • Ensure that the updated expected value (1 agent) accurately reflects the intended right of way behavior and that the removal of a previously expected agent is deliberate in the simulation logic.
CHECK_EQ(nodeO.agents().size(), 1);

src/dsm/headers/RoadDynamics.hpp:669

  • Ensure that comparisons between Direction enums using >= and < accurately reflect their intended ordering; consider clarifying the enum definitions to support these comparisons.
else if (thisDirection >= Direction::LEFT) {

@Grufoony Grufoony merged commit 2be99ad into main Apr 16, 2025
29 of 31 checks passed
@Grufoony Grufoony deleted the EnhanceRightOfWay branch April 16, 2025 08:31
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.

Refactor Intersection

2 participants