Skip to content

Commit

Permalink
update rtc status for some failure condition
Browse files Browse the repository at this point in the history
Signed-off-by: Go Sakayori <gsakayori@gmail.com>
  • Loading branch information
go-sakayori committed Aug 24, 2024
1 parent b9b0fa9 commit 63a8851
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,17 @@ bool LaneChangeInterface::canTransitFailureState()

if (!module_type_->isValidPath()) {
log_debug_throttled("Transit to failure state due not to find valid path");
updateRTCStatus(

Check warning on line 261 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/interface.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/interface.cpp#L261

Added line #L261 was not covered by tests
std::numeric_limits<double>::lowest(), std::numeric_limits<double>::lowest(), true,
State::FAILED);
return true;
}

if (module_type_->isAbortState() && module_type_->hasFinishedAbort()) {
log_debug_throttled("Abort process has completed.");
updateRTCStatus(

Check warning on line 269 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/interface.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/interface.cpp#L269

Added line #L269 was not covered by tests
std::numeric_limits<double>::lowest(), std::numeric_limits<double>::lowest(), true,
State::FAILED);

Check notice on line 271 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/interface.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Complex Method

LaneChangeInterface::canTransitFailureState already has high cyclomatic complexity, and now it increases in Lines of Code from 100 to 106. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
return true;
}

Expand Down

0 comments on commit 63a8851

Please sign in to comment.