Skip to content

Commit

Permalink
fix grammatical
Browse files Browse the repository at this point in the history
Signed-off-by: Zulfaqar Azmi <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 committed Dec 3, 2024
1 parent 3c4b9d6 commit 1dc7809
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ bool filter_target_lane_objects(
* @return true if any of the object's predicted paths overlap with the lanes polygon, false
* otherwise.
*/
bool is_object_path_overlapped_lanes(
bool object_path_overlaps_lanes(
const ExtendedPredictedObject & object, const lanelet::BasicPolygon2d & lanes_polygon);
} // namespace autoware::behavior_path_planner::utils::lane_change
#endif // AUTOWARE__BEHAVIOR_PATH_LANE_CHANGE_MODULE__UTILS__UTILS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ bool has_overtaking_turn_lane_object(
return true;
}

return is_object_path_overlapped_lanes(object, common_data_ptr->lanes_polygon_ptr->target);
return object_path_overlaps_lanes(object, common_data_ptr->lanes_polygon_ptr->target);

Check warning on line 1174 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp#L1174

Added line #L1174 was not covered by tests
};

return std::any_of(
Expand Down Expand Up @@ -1207,7 +1207,7 @@ bool filter_target_lane_objects(
}

return !is_stopped && is_vehicle(object.classification) &&
is_object_path_overlapped_lanes(object, lanes_polygon.target);
object_path_overlaps_lanes(object, lanes_polygon.target);

Check warning on line 1210 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp#L1210

Added line #L1210 was not covered by tests
});

if (overlapped_target_lanes) {

Check warning on line 1213 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

filter_target_lane_objects increases in cyclomatic complexity from 13 to 16, 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 1213 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Bumpy Road Ahead

filter_target_lane_objects increases from 2 to 3 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.
Expand Down Expand Up @@ -1250,7 +1250,7 @@ bool filter_target_lane_objects(
return false;
}

bool is_object_path_overlapped_lanes(
bool object_path_overlaps_lanes(

Check warning on line 1253 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp#L1253

Added line #L1253 was not covered by tests
const ExtendedPredictedObject & object, const lanelet::BasicPolygon2d & lanes_polygon)
{
return ranges::any_of(get_line_string_paths(object), [&](const auto & path) {

Check warning on line 1256 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp#L1256

Added line #L1256 was not covered by tests
Expand Down

0 comments on commit 1dc7809

Please sign in to comment.