Skip to content

Commit

Permalink
fix int_occ virt_wall pos when absence_tl
Browse files Browse the repository at this point in the history
Signed-off-by: Mamoru Sobue <[email protected]>
  • Loading branch information
soblin committed Oct 3, 2023
1 parent e59f18b commit 880ae61
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1107,9 +1107,10 @@ IntersectionModule::DecisionResult IntersectionModule::modifyPathVelocityDetail(
occlusion_stop_line_idx};
}
} else {
const auto occlusion_stop_line = planner_param_.occlusion.temporal_stop_before_attention_area
? first_attention_stop_line_idx
: occlusion_stop_line_idx;
const auto occlusion_stop_line =
(planner_param_.occlusion.temporal_stop_before_attention_area || !has_traffic_light_)
? first_attention_stop_line_idx
: occlusion_stop_line_idx;
return IntersectionModule::FirstWaitBeforeOcclusion{

Check warning on line 1114 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_velocity_intersection_module/src/scene_intersection.cpp#L1114

Added line #L1114 was not covered by tests
is_occlusion_cleared_with_margin, closest_idx, default_stop_line_idx, occlusion_stop_line};
}

Check notice on line 1116 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Bumpy Road Ahead

IntersectionModule::modifyPathVelocityDetail decreases from 5 to 2 logical blocks with deeply nested code, threshold is one single 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.

Check notice on line 1116 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Complex Method

IntersectionModule::modifyPathVelocityDetail increases in cyclomatic complexity from 56 to 57, 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 notice on line 1116 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ No longer an issue: Deep, Nested Complexity

IntersectionModule::modifyPathVelocityDetail is no longer above the threshold for nested complexity depth. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
Expand Down

0 comments on commit 880ae61

Please sign in to comment.