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

C/C++ : Useless test #7787

Merged
merged 5 commits into from Feb 1, 2022
Merged

C/C++ : Useless test #7787

merged 5 commits into from Feb 1, 2022

Conversation

@Yonah125
Copy link

@Yonah125 Yonah125 commented Jan 30, 2022

This query finds any useless test of kind a==8 && a!=7.

This query found an useless test on the Suricata project that can you see in this Pull Request :

OISF/suricata#6897

@catenacyber
Copy link
Contributor

@catenacyber catenacyber commented Jan 31, 2022

cc @HauwaOtori : this is a first PR from my students project aka CodeQL versus Suricata
cc @xcorail

PS @Yonah125 do you want to co-author commits with your comrades ?

@MathiasVP MathiasVP self-assigned this Jan 31, 2022
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Thanks for your contribution @Yonah125,

Here are my initial comments. Note that CI is unhappy because the query isn't hasn't been auto-formatted (see the Formatting section in https://github.com/github/codeql/blob/main/CONTRIBUTING.md#submitting-a-new-experimental-query).

None of my comments are really blocking this PR: It's mostly to help you learn to be efficient writing CodeQL queries :) If you're happy with the results you're finding with the query I'll merge it as soon as the PR is green.

cpp/ql/src/experimental/Best Practices/UselessTest.ql Outdated Show resolved Hide resolved
cpp/ql/src/experimental/Best Practices/UselessTest.ql Outdated Show resolved Hide resolved
cpp/ql/src/experimental/Best Practices/UselessTest.ql Outdated Show resolved Hide resolved
cpp/ql/src/experimental/Best Practices/UselessTest.qhelp Outdated Show resolved Hide resolved
cpp/ql/src/experimental/Best Practices/UselessTest.ql Outdated Show resolved Hide resolved
@Yonah125
Copy link
Author

@Yonah125 Yonah125 commented Jan 31, 2022

Thank you very much for you feedback. I just fixed multiple issues that you mentionned.

About the auto-formatting, I used the 'Format Document' command in VSC, is the output bad ?

@MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Jan 31, 2022

About the auto-formatting, I used the 'Format Document' command in VSC, is the output bad ?

Excellent. That should all be fine now, then. Let's see what CI thinks about it now 🤞.

@catenacyber
Copy link
Contributor

@catenacyber catenacyber commented Feb 1, 2022

CI looks green now 👏

@MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Feb 1, 2022

CI looks green now 👏

Indeed, it is 🎉!

@catenacyber has this been resolved:

PS @Yonah125 do you want to co-author commits with your comrades ?

?

Because I think we're ready to merge this PR once you're all happy with the commit history.

@catenacyber
Copy link
Contributor

@catenacyber catenacyber commented Feb 1, 2022

Commit history is good enough for me :-)

Copy link
Contributor

@MathiasVP MathiasVP left a comment

LGTM!

@MathiasVP MathiasVP merged commit 3597d80 into github:main Feb 1, 2022
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants