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

refactor(mission_planner): remove redundant is_reroute check #6980

Merged
merged 1 commit into from
May 11, 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 2019 Autoware Foundation

Check notice on line 1 in planning/mission_planner/src/mission_planner/mission_planner.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 4.76 to 4.67, 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 @@ -250,7 +250,7 @@

if (is_reroute && !check_reroute_safety(*current_route_, route)) {
cancel_route();
change_state(is_reroute ? RouteState::SET : RouteState::UNSET);
change_state(RouteState::SET);

Check notice on line 253 in planning/mission_planner/src/mission_planner/mission_planner.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Complex Method

MissionPlanner::on_set_lanelet_route decreases in cyclomatic complexity from 19 to 18, 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.
throw service_utils::ServiceException(
ResponseCode::ERROR_REROUTE_FAILED, "New route is not safe. Reroute failed.");
}
Expand Down Expand Up @@ -298,7 +298,7 @@

if (is_reroute && !check_reroute_safety(*current_route_, route)) {
cancel_route();
change_state(is_reroute ? RouteState::SET : RouteState::UNSET);
change_state(RouteState::SET);

Check notice on line 301 in planning/mission_planner/src/mission_planner/mission_planner.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Complex Method

MissionPlanner::on_set_waypoint_route decreases in cyclomatic complexity from 19 to 18, 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.
throw service_utils::ServiceException(
ResponseCode::ERROR_REROUTE_FAILED, "New route is not safe. Reroute failed.");
}
Expand Down
Loading