Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(radar_object_tracker): fix duplicateBranch warning #7697

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Tier IV, Inc.

Check notice on line 1 in perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 5.38 to 5.25, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -137,22 +137,8 @@
} else {
P_v_xy = R * P_v_xy_local * R.transpose();
}
// acceleration covariance often written in object frame
const bool has_acceleration_covariance =
false; // currently message does not have acceleration covariance
if (has_acceleration_covariance) {
// const auto ax_cov =
// object.kinematics.acceleration_with_covariance.covariance[utils::MSG_COV_IDX::X_X]; // This
// is future update
// const auto ay_cov =
// object.kinematics.acceleration_with_covariance.covariance[utils::MSG_COV_IDX::Y_Y]; // This
// is future update
// Eigen::Matrix2d P_a_xy_local;
// P_a_xy_local << ax_cov, 0.0, 0.0, ay_cov;
P_a_xy = R * P_a_xy_local * R.transpose();
} else {
P_a_xy = R * P_a_xy_local * R.transpose();
}

P_a_xy = R * P_a_xy_local * R.transpose();

Check notice on line 141 in perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Large Method

LinearMotionTracker::LinearMotionTracker decreases from 76 to 70 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.

Check warning on line 141 in perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp

View check run for this annotation

Codecov / codecov/patch

perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp#L141

Added line #L141 was not covered by tests

// put value in P matrix
// use block description. This assume x,y,vx,vy,ax,ay in this order
Expand Down
Loading