Skip to content

Commit

Permalink
minor edit to fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
  • Loading branch information
zulfaqar-azmi-t4 committed Aug 13, 2024
1 parent 52cfe7b commit e2be56d
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ bool LaneChangeInterface::canTransitFailureState()

if (module_type_->is_near_terminal()) {
log_debug_throttled("Unsafe, but ego is approaching terminal. Continue lane change");

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

if (module_type_->isRequiredStop(post_process_safety_status_.is_trailing_object)) {
log_debug_throttled("Module require stopping");

Check warning on line 272 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#L272

Added line #L272 was not covered by tests
}
return false;

Check warning on line 274 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#L274

Added line #L274 was not covered by tests
}

Check warning on line 276 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 increases in cyclomatic complexity from 21 to 23, threshold = 9. 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.

Check warning on line 276 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)

❌ New issue: Bumpy Road Ahead

LaneChangeInterface::canTransitFailureState has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
Expand Down Expand Up @@ -295,11 +299,6 @@ bool LaneChangeInterface::canTransitFailureState()

if (post_process_safety_status_.is_safe) {
log_debug_throttled("Can't transit to failure state. Ego is on prepare, and it's safe.");

if (module_type_->isRequiredStop(post_process_safety_status_.is_object_coming_from_rear)) {
log_debug_throttled("Module require stopping");
}

return false;
}

Expand Down

0 comments on commit e2be56d

Please sign in to comment.