Skip to content

fix(ndt_scan_matcher): fix to pass clang-tidy's check #7479

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

Conversation

SakodaShintaro
Copy link
Contributor

@SakodaShintaro SakodaShintaro commented Jun 13, 2024

Description

(1)

To avoid warning: function 'callback_sensor_points_main' has cognitive complexity of 26 (threshold 25) [readability-function-cognitive-complexity], I changed from for statement to stl algorithm.

This change was made only to avoid warnings, and it is possible that readability has not improved but has actually decreased. I think it would be reasonable for this pull request to be judged as Reject on this reason. There is a possibility that it is better to properly separate the big function callback_sensor_points_main.

(2)

To solve warning: do not access members of unions; use (boost::)variant instead [cppcoreguidelines-pro-type-union-access], I added // NOLINT to those lines.

Tests performed

logging_simulator works well as before.

Effects on system behavior

There are no effects on system behavior.

Interface changes

There are no interface changes.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
@SakodaShintaro SakodaShintaro added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) tag:run-clang-tidy-differential labels Jun 13, 2024
@SakodaShintaro SakodaShintaro self-assigned this Jun 13, 2024
@github-actions github-actions bot added the component:localization Vehicle's position determination in its environment. (auto-assigned) label Jun 13, 2024
@KYabuuchi
Copy link
Contributor

This change was made only to avoid warnings, and it is possible that readability has not improved but has actually decreased. I think it would be reasonable for this pull request to be judged as Reject on this reason.

Honestly, I think the source code has become harder to understand 😢

@SakodaShintaro
Copy link
Contributor Author

Thank you for your comment.
I will fix this pull request because I found it difficult to read when I read the changes again.

@SakodaShintaro SakodaShintaro marked this pull request as draft June 14, 2024 04:04
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 23.51%. Comparing base (507e3f4) to head (98b93e7).
Report is 37 commits behind head on main.

Files Patch % Lines
...ion/ndt_scan_matcher/src/ndt_scan_matcher_core.cpp 33.33% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7479       +/-   ##
===========================================
+ Coverage   14.84%   23.51%    +8.66%     
===========================================
  Files        1999       54     -1945     
  Lines      139163     3071   -136092     
  Branches    43716      732    -42984     
===========================================
- Hits        20661      722    -19939     
+ Misses      95731     2288    -93443     
+ Partials    22771       61    -22710     
Flag Coverage Δ
differential 23.51% <60.00%> (?)
total ?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:localization Vehicle's position determination in its environment. (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