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 "variableScope" hints from CppCheck #2807

Merged
merged 1 commit into from
Feb 2, 2019

Conversation

SunBlack
Copy link
Contributor

@SunBlack SunBlack commented Jan 25, 2019

There are 3 warnings left, which I didn't fixed, because it currently has a better readability.

Addiotnally: There are a lot of variableScope fixes, which are not detected by CppCheck. Seems CppCheck ignore hpp files and loops :(. Adjustments to loops are necessary, because Clang-tidy ignore them during modernize-loop-convert, if iterators are not defined within loop head.

Skipped doc/tutirals und OpenNurbs directory.

PS: Sorry for the big changes hog.cpp. I formated code to understand what CppCheck see there and after this I simplified duplicated code

@SunBlack SunBlack force-pushed the variableScope branch 3 times, most recently from 566e539 to 79423da Compare January 29, 2019 19:01
Copy link
Member

@SergioRAgostinho SergioRAgostinho left a comment

Choose a reason for hiding this comment

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

Thanks for submitting the changes. I have to admit that after spending 2 hours reviewing all the changes submitted, I am feeling slightly tired so excuse me for being brief. I've requested some changes with comments in situ as usual. Some additional comments:

  • Whatever you do from now on, please do not squash/force push. Just do regular commits on top, otherwise all the effort I put into this first review will be "lost".
  • There were a couple of changes submitted which seemed to change the current behavior of the code. I'm unsure if these were done automatically by clang-tidy or not. Maybe no logic is being changed and I'm just failing to see that. Anyway, I've pointed them out individually. In case they were manually made, please refrain from doing so. It's hard to capture the little nuances when there's a lot of other changes "polluting the reasoning context".
  • Next time, please split these over multiple PRs, focusing on a couple of modules in each. Take the threshold of 500 touched lines of code as a good rule of thumb to decide when to split.

apps/cloud_composer/src/signal_multiplexer.cpp Outdated Show resolved Hide resolved
apps/cloud_composer/src/signal_multiplexer.cpp Outdated Show resolved Hide resolved
apps/in_hand_scanner/src/icp.cpp Show resolved Hide resolved
apps/point_cloud_editor/src/cloud.cpp Show resolved Hide resolved
@taketwo
Copy link
Member

taketwo commented Jan 30, 2019

@SergioRAgostinho thanks for the review! Can I help somehow (without duplicating the effort)?

@SergioRAgostinho
Copy link
Member

@SergioRAgostinho thanks for the review! Can I help somehow (without duplicating the effort)?

Right now, you can double check the comments in which I claim "that functionality is being changed". I think this is one or two points. If you confirm that nothing is changed then mark the comment as resolved and it's less work for everyone. Some fresh eyes into these might help clear any mistakes I might have made.

@SunBlack
Copy link
Contributor Author

@taketwo: This PR needs already a merge, so I believe it is better to merge #2812 first, then merge and if all is reviewed maybe squash to keep log clean of reverted changes.

Copy link
Member

@SergioRAgostinho SergioRAgostinho left a comment

Choose a reason for hiding this comment

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

Thank you. I'm glad this one is done 😅

@SergioRAgostinho
Copy link
Member

For my side, this is ready for a rebase. Please wait for @taketwo 's green light just in case.

Copy link
Member

@taketwo taketwo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you guys for all the effort!

@SunBlack
Copy link
Contributor Author

So I can merge and rebase/squash now?

@taketwo
Copy link
Member

taketwo commented Jan 31, 2019

Yes! Please also fix the conflict in "visualization/src/pcl_visualizer.cpp", otherwise we can not merge.

@SergioRAgostinho
Copy link
Member

I merged #2812. Let's go for the final rebase/squash. 👍

@SunBlack SunBlack force-pushed the variableScope branch 2 times, most recently from 5c45db4 to 2187ec0 Compare February 1, 2019 10:13
…fixes, which are not detected by CppCheck (variableScope check seems to ignore loops and HPP files)
@SunBlack
Copy link
Contributor Author

SunBlack commented Feb 1, 2019

Needed to integrate some fixes

  • I had to revert changes to ply_parser (fixes test issues)
  • Adjusted doc/tutorials/.../supervoxel_clustering used invalid cbegin for adjacent_supervoxel_centers => begin
  • Adjusted lines in supervoxel_clustering.rst

@taketwo
Copy link
Member

taketwo commented Feb 2, 2019

@SergioRAgostinho merging?

@SergioRAgostinho
Copy link
Member

I didn't check the very last changes, but now they're squashed anyway. The test were failing and now they're not so everything is fine by me ^^

@SergioRAgostinho SergioRAgostinho merged commit ff3b812 into PointCloudLibrary:master Feb 2, 2019
@taketwo
Copy link
Member

taketwo commented Feb 2, 2019

Next time, please split these over multiple PRs, focusing on a couple of modules in each. Take the threshold of 500 touched lines of code as a good rule of thumb to decide when to split.

@SunBlack thanks for the effort with this (and all the other PRs). However, please do keep this request in mind.

@SunBlack SunBlack deleted the variableScope branch February 2, 2019 19:18
@taketwo taketwo added the c++14 label Jan 14, 2020
@taketwo taketwo changed the title Fixed most variableScope hints by CppCheck 1.86 Fix "variableScope" hints from CppCheck Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants