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

fix(route_handler): planning route with goal lanelet in candidate_lanelets #6802

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 7 additions & 6 deletions planning/route_handler/src/route_handler.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2023 Tier IV, Inc.

Check notice on line 1 in planning/route_handler/src/route_handler.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.50 to 4.49, 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 @@ -587,12 +587,13 @@
}
candidate_lanelets = prev_lanes;
}
// loop check
if (std::any_of(
candidate_lanelets.begin(), candidate_lanelets.end(),
[lanelet](auto & prev_llt) { return lanelet.id() == prev_llt.id(); })) {
break;
}

// loop check, remove goal lanelet from candidate lanelets
candidate_lanelets.erase(
std::remove_if(
candidate_lanelets.begin(), candidate_lanelets.end(),
[lanelet](auto & prev_llt) { return lanelet.id() == prev_llt.id(); }),
candidate_lanelets.end());

Check notice on line 596 in planning/route_handler/src/route_handler.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Complex Method

RouteHandler::getLaneletSequenceUpTo decreases in cyclomatic complexity from 15 to 14, 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.
sebekx marked this conversation as resolved.
Show resolved Hide resolved

// If lanelet_sequence_backward with input lanelet contains all candidate lanelets,
// break the loop.
Expand Down
Loading