Skip to content

Conversation

@Grufoony
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 43.58974% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.20%. Comparing base (7afeff6) to head (2385164).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/dsf/mdt/TrajectoryCollection.cpp 43.58% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #371      +/-   ##
==========================================
- Coverage   83.34%   83.20%   -0.15%     
==========================================
  Files          52       52              
  Lines        5207     5233      +26     
  Branches      593      596       +3     
==========================================
+ Hits         4340     4354      +14     
- Misses        855      867      +12     
  Partials       12       12              
Flag Coverage Δ
unittests 83.20% <43.58%> (-0.15%) ⬇️

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.

auto const& lons = std::get<std::vector<double>>(dataframe.at("lon"));

auto const bbox_set =
!(bbox[0] == 0.0 && bbox[1] == 0.0 && bbox[2] == 0.0 && bbox[3] == 0.0);

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
tbb::concurrent_set<Id> to_split;

// Returns true if speed between two points is below max_speed_kph
auto check_max_speed = [](PointsCluster const& currentCluster,

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule

// Returns true if speed between two points is below max_speed_kph
auto check_max_speed = [](PointsCluster const& currentCluster,
PointsCluster const& previousCluster,

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
// Returns true if speed between two points is below max_speed_kph
auto check_max_speed = [](PointsCluster const& currentCluster,
PointsCluster const& previousCluster,
double const max_speed_kph) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 13.1 rule Note

MISRA 13.1 rule
if (current_time <= previous_time) {
spdlog::warn(
"Non-increasing timestamps detected. Skipping speed check for these points.");
return true;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule

Choose a reason for hiding this comment

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

ok

[&to_remove,
&to_split,
check_max_speed,
check_min_duration,

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
to_split.insert(uid);
return;
}
if (i > 0) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 10.4 rule Note

MISRA 10.4 rule
return;
}
if (i > 0) {
auto const& previousCluster = points[i - 1];

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 10.4 rule Note

MISRA 10.4 rule

bool bShouldSplit = false;

if (i > 0) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 10.4 rule Note

MISRA 10.4 rule
bool bShouldSplit = false;

if (i > 0) {
auto const& previousCluster = points[i - 1];

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 10.4 rule Note

MISRA 10.4 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 PR attempts to fix bugs in the trajectory filtering logic related to min_duration and max_speed constraints. The changes introduce helper lambda functions for speed and duration checks, refactor the filtering logic to use these helpers, and move the bbox_set calculation outside the loop for performance.

Key Changes:

  • Added check_max_speed and check_min_duration helper lambdas to encapsulate constraint validation logic
  • Introduced time conversion constants (SECONDS_IN_MINUTE, SECONDS_IN_HOUR) to avoid magic numbers
  • Refactored both the detection phase (lines 144-158) and splitting phase (lines 184-203) to use the new helper functions

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

@Grufoony Grufoony merged commit c10ef00 into main Nov 25, 2025
41 of 43 checks passed
@Grufoony Grufoony deleted the fixMDT branch November 25, 2025 16:05
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.

3 participants