Skip to content

Conversation

@Grufoony
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 70.52632% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.36%. Comparing base (953ae8d) to head (91bcf15).

Files with missing lines Patch % Lines
src/dsf/mobility/RoadNetwork.cpp 66.66% 56 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #385      +/-   ##
==========================================
- Coverage   83.55%   83.36%   -0.20%     
==========================================
  Files          53       53              
  Lines        5466     5505      +39     
  Branches      634      636       +2     
==========================================
+ Hits         4567     4589      +22     
- Misses        888      905      +17     
  Partials       11       11              
Flag Coverage Δ
unittests 83.36% <70.52%> (-0.20%) ⬇️

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.

RoadNetwork graph{};
// Node 1 is the intersection
// Edge 1: 0 -> 1 (HIGHWAY)
Street s1(1, std::make_pair(0, 1), 100., 30., 1);

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule

MISRA 12.3 rule
s1.setRoadType(RoadType::HIGHWAY);

// Edge 2: 2 -> 1 (HIGHWAY)
Street s2(2, std::make_pair(2, 1), 100., 30., 1);

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule

MISRA 12.3 rule
s2.setRoadType(RoadType::HIGHWAY);

// Edge 3: 3 -> 1 (SECONDARY)
Street s3(3, std::make_pair(3, 1), 100., 30., 1);

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule

MISRA 12.3 rule
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.

Pull request overview

This pull request refactors the road priority system from a numeric priority value (int m_priority) to a boolean flag (bool m_hasPriority) that indicates whether a road has priority or not. It also introduces a new method autoAssignRoadPriorities() that automatically assigns priorities based on road types at intersections.

Changes:

  • Changed priority from a numeric value to a boolean flag indicating presence/absence of priority
  • Updated autoMapStreetLanes() to use estimated flow (maxSpeed × nLanes) instead of numeric priorities
  • Added autoAssignRoadPriorities() method to automatically assign priorities based on road types

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/dsf/mobility/Road.hpp Changed m_priority from int to bool m_hasPriority, updated setPriority() to take no parameters and priority() to hasPriority()
src/dsf/mobility/Road.cpp Removed the constructor initialization of m_priority and the setPriority(int) method implementation
src/dsf/mobility/Street.cpp Updated equality operator to compare m_hasPriority instead of m_priority
src/dsf/mobility/RoadNetwork.hpp Added declaration for autoAssignRoadPriorities() method
src/dsf/mobility/RoadNetwork.cpp Updated autoMapStreetLanes() to use estimated flow calculations; added autoAssignRoadPriorities() implementation
test/mobility/Test_street.cpp Updated tests to use hasPriority() and parameter-less setPriority()
test/mobility/Test_graph.cpp Added test case for autoAssignRoadPriorities()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/// @brief Automatically re-maps street lanes basing on network's topology
/// @details For example, if one street has the right turn forbidden, then the right lane becomes a straight one
void autoMapStreetLanes();

Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The new autoAssignRoadPriorities() method lacks documentation. Add a @brief comment explaining what this method does, such as '@brief Automatically assigns road priorities based on road types at intersections'.

Suggested change
/// @brief Automatically assigns road priorities based on road types at intersections.

Copilot uses AI. Check for mistakes.
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.

2 participants