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

More Cppcheck use stl alg warning fixes #37357

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

jhaigh0
Copy link
Contributor

@jhaigh0 jhaigh0 commented May 14, 2024

Description of work

Dealing with the remaining (there are ~4 left which I think aren't worth changing) cppcheck warnings for using stl algorithms (first part #37205).

Should help make code safer and faster, as well as chipping away at the cppcheck suppressions backlog.
This was also a bit of training for me to build confidence with the stl algorithms.

There is no associated issue.

To test:

  • Tests should pass
  • Once again, careful code review needed. Obviously in an ideal world any behaviour changes would result in tests failing, but we know that's not always the case.
  • Cppcheck is now warning that the function makeMappings from SaveNexusProcessed.cpp is now only going to return false (specifically the call at line 572) I can't see how this is the case, so I've suppressed the knownConditionTrueFalse warning. I would appreciate someone else checking though.

Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@jhaigh0 jhaigh0 added Maintenance Unassigned issues to be addressed in the next maintenance period. ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS labels May 14, 2024
@jhaigh0 jhaigh0 added this to the Release 6.11 milestone May 14, 2024
@jhaigh0 jhaigh0 force-pushed the more_use_stl_algorithm_cppcheck branch 5 times, most recently from 474f9ce to 5db2f1e Compare May 14, 2024 15:13
@jhaigh0 jhaigh0 force-pushed the more_use_stl_algorithm_cppcheck branch from 5db2f1e to 32ad86b Compare May 14, 2024 15:24
@jhaigh0 jhaigh0 force-pushed the more_use_stl_algorithm_cppcheck branch 2 times, most recently from 8c909ca to bfd7503 Compare June 10, 2024 13:35
try removing const to fix linux test
@jhaigh0 jhaigh0 force-pushed the more_use_stl_algorithm_cppcheck branch from bfd7503 to e0aaf30 Compare June 10, 2024 13:36
@jhaigh0 jhaigh0 marked this pull request as ready for review June 11, 2024 07:51
Copy link
Contributor

@jclarkeSTFC jclarkeSTFC left a comment

Choose a reason for hiding this comment

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

I looked through the code, no change in functionality. I also opened Workbench and did some random things like loading files, fitting, plotting, everything seemed to work.

Framework/DataHandling/src/SaveISISNexus.cpp Outdated Show resolved Hide resolved
Framework/Kernel/src/NexusDescriptor.cpp Outdated Show resolved Hide resolved
Framework/Kernel/src/NexusHDF5Descriptor.cpp Outdated Show resolved Hide resolved
Framework/MDAlgorithms/src/AccumulateMD.cpp Outdated Show resolved Hide resolved
Framework/Nexus/src/NexusClasses.cpp Outdated Show resolved Hide resolved
Framework/Nexus/src/NexusClasses.cpp Outdated Show resolved Hide resolved
Framework/Nexus/src/NexusClasses.cpp Outdated Show resolved Hide resolved
Framework/Parallel/src/IO/Chunker.cpp Outdated Show resolved Hide resolved
Co-authored-by: James Clarke <[email protected]>
@thomashampson thomashampson merged commit 647fe86 into main Jun 13, 2024
10 checks passed
@thomashampson thomashampson deleted the more_use_stl_algorithm_cppcheck branch June 13, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS Maintenance Unassigned issues to be addressed in the next maintenance period.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants