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_velocity_smoother): fix duplicateBreak warning #7699

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

veqcc
Copy link
Contributor

@veqcc veqcc commented Jun 26, 2024

Description

This is a fix based on cppcheck duplicateBreak warning

planning/autoware_velocity_smoother/src/node.cpp:1016:3: style: Consecutive return, break, continue, goto or throw statements are unnecessary. [duplicateBreak]
  return AlgorithmType::INVALID;
  ^

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Jun 26, 2024
Copy link

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@veqcc veqcc self-assigned this Jun 26, 2024
@veqcc veqcc added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jun 26, 2024
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 18.07%. Comparing base (507e3f4) to head (3f1307e).
Report is 145 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7699       +/-   ##
===========================================
+ Coverage   14.84%   18.07%    +3.22%     
===========================================
  Files        1999      485     -1514     
  Lines      139163    38936   -100227     
  Branches    43716    11125    -32591     
===========================================
- Hits        20661     7038    -13623     
+ Misses      95731    30915    -64816     
+ Partials    22771      983    -21788     
Flag Coverage Δ
differential 18.07% <ø> (?)
total ?

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@TakaHoribe TakaHoribe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know this code causes an error message, but this fix makes sense to me.

Copy link
Contributor

@rej55 rej55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@veqcc
Copy link
Contributor Author

veqcc commented Jun 26, 2024

@TakaHoribe

I didn't know this code causes an error message

This is because throw std::domain_error("[VelocitySmootherNode] undesired algorithm is selected."); will exit the code and the following return AlgorithmType::INVALID; will not be executed.
The warning duplicateBreak means ""Consecutive return, break, continue, goto or throw statements are unnecessary"" (cited from https://github.com/danmar/cppcheck/blob/1668b0b689885b703039af1eb27c76da77f6445d/lib/checkother.cpp#L893 )

@veqcc veqcc merged commit 7a28691 into autowarefoundation:main Jun 26, 2024
41 checks passed
@veqcc veqcc deleted the fix_duplicate_break2 branch June 26, 2024 06:35
simon-eisenmann-driveblocks pushed a commit to simon-eisenmann-driveblocks/autoware.universe that referenced this pull request Jun 26, 2024
mitukou1109 pushed a commit to mitukou1109/autoware.universe that referenced this pull request Jul 2, 2024
palas21 pushed a commit to palas21/autoware.universe that referenced this pull request Jul 12, 2024
tby-udel pushed a commit to tby-udel/autoware.universe that referenced this pull request Jul 14, 2024
KhalilSelyan pushed a commit that referenced this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants