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(autoware_euclidean_cluster): fix bugprone-misplaced-widening-cast #9227

Merged
merged 1 commit into from
Nov 3, 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
Expand Up @@ -117,7 +117,9 @@
voxel_grid_.getCentroidIndexAt(voxel_grid_.getGridCoordinates(point.x, point.y, point.z));
if (map.find(index) != map.end()) {
auto & cluster_data_size = clusters_data_size.at(map[index]);
if (cluster_data_size > std::size_t(max_cluster_size_ * point_step)) {
if (
cluster_data_size >
static_cast<std::size_t>(max_cluster_size_) * static_cast<std::size_t>(point_step)) {

Check warning on line 122 in perception/autoware_euclidean_cluster/lib/voxel_grid_based_euclidean_cluster.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

VoxelGridBasedEuclideanCluster::cluster already has high cyclomatic complexity, and now it increases in Lines of Code from 96 to 98. 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.
continue;
}
std::memcpy(
Expand Down
Loading