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: static analysis problems #785

Merged
merged 4 commits into from
Oct 8, 2022
Merged

fix: static analysis problems #785

merged 4 commits into from
Oct 8, 2022

Conversation

cetius
Copy link
Contributor

@cetius cetius commented Oct 6, 2022

fixes #784 - warnings reported by Klocwork in CLI11 v2.2.0

marrcin8 and others added 2 commits October 6, 2022 18:43
* fix to warrnings reported by Klocwork in CLI11 v2.2.0
@@ -750,7 +750,7 @@ class AsNumberWithUnit : public Validator {

// transform function
func_ = [mapping, opts](std::string &input) -> std::string {
Number num;
Number num{};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure this is necessary, but it's okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand that this is just a cosmetic change. I just wanted to hold the tool back from moaning.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it's just a cosmetic change, I'd have no problem with it. I think it might zero initialize some types, which is technically wasteful, the will only be written to. But in the scope of parsing CLI code, it's totally acceptable.

Choose a reason for hiding this comment

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

Yep. That was my take also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I completely understand your point of view

@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Base: 99.29% // Head: 99.29% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (5031c4b) compared to base (a66ae41).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #785   +/-   ##
=======================================
  Coverage   99.29%   99.29%           
=======================================
  Files          16       16           
  Lines        3973     3974    +1     
=======================================
+ Hits         3945     3946    +1     
  Misses         28       28           
Impacted Files Coverage Δ
include/CLI/FormatterFwd.hpp 100.00% <ø> (ø)
include/CLI/Validators.hpp 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

cetius and others added 2 commits October 6, 2022 19:24
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
@henryiii henryiii merged commit 9a6c6f6 into CLIUtils:main Oct 8, 2022
@github-actions github-actions bot added needs changelog Hasn't been added to the changelog yet needs README Needs to be mentioned in the README labels Oct 8, 2022
@henryiii henryiii removed the needs README Needs to be mentioned in the README label Oct 28, 2022
@henryiii henryiii removed the needs changelog Hasn't been added to the changelog yet label Jan 3, 2023
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.

Static analysis issues
4 participants