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_image_transport_decompressor): fix bugprone-branch-clone #9724

Merged
merged 1 commit into from
Dec 23, 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 @@ -107,13 +107,12 @@
}
} else {
std::string image_encoding;
if (encoding_ == std::string("default")) {
image_encoding = input_compressed_image_msg->format.substr(0, split_pos);
} else if (encoding_ == std::string("rgb8")) {
if (encoding_ == std::string("rgb8")) {
image_encoding = "rgb8";
} else if (encoding_ == std::string("bgr8")) {
image_encoding = "bgr8";
} else {
// default encoding

Check notice on line 115 in sensing/autoware_image_transport_decompressor/src/image_transport_decompressor.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Complex Method

ImageTransportDecompressor::onCompressedImage decreases in cyclomatic complexity from 25 to 24, 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.
image_encoding = input_compressed_image_msg->format.substr(0, split_pos);
}

Expand Down
Loading