Skip to content

CPP: New query for similarly named variables.#71

Closed
geoffw0 wants to merge 1 commit intogithub:masterfrom
geoffw0:varnames
Closed

CPP: New query for similarly named variables.#71
geoffw0 wants to merge 1 commit intogithub:masterfrom
geoffw0:varnames

Conversation

@geoffw0
Copy link
Copy Markdown
Contributor

@geoffw0 geoffw0 commented Aug 17, 2018

This query comes from an idea that popped into my head while I was on holiday.

I haven't written tags, qldoc, tests or a change note for it yet - I'd prefer to solicit some feedback on whether we think this query is worthwhile first.

Typical results are variables called:

gl
g1

I
l

I062_080_MD5
I062_080_MDS

mode1
model

@geoffw0 geoffw0 added the C++ label Aug 17, 2018
@ghost
Copy link
Copy Markdown

ghost commented Aug 17, 2018

CLA assistant check
All committers have signed the CLA.

@jbj
Copy link
Copy Markdown
Contributor

jbj commented Aug 20, 2018

Nice idea. I'm running the query on 41 projects here: https://lgtm.com/query/1506524156925/

@jbj
Copy link
Copy Markdown
Contributor

jbj commented Aug 20, 2018

Does anyone see a genuine bug among the results? I think there should be a few good results before it makes sense to include this query by default. Maybe the same idea is better applied to JavaScript/Python or to string literals.

@geoffw0
Copy link
Copy Markdown
Contributor Author

geoffw0 commented Aug 22, 2018

On string literals it doesn't produce interesting results, even with short strings filtered out:

"cppcheck: argument to '-I' is missing."
"cppcheck: argument to '-l' is missing."

"Ctrl+O"
"Ctrl+0"

"KEYCODE_I"
"KEYCODE_1"

"11.bin"
"1l.bin" --- these occur in what appears to be generated or reverse-engineered code

I'm not set up to try out the query on JavaScript or Python. Mentioning @xiemaisi and I'll ping Mark in case they think it's worth a try.

@geoffw0
Copy link
Copy Markdown
Contributor Author

geoffw0 commented Aug 22, 2018

Nothing interesting turned up on Python: https://lgtm.com/query/1506522147600/

@geoffw0
Copy link
Copy Markdown
Contributor Author

geoffw0 commented Aug 24, 2018

Closing due to little interest.

@geoffw0 geoffw0 closed this Aug 24, 2018
aibaars added a commit that referenced this pull request Oct 14, 2021
Create disjoint db types for different operators
smowton pushed a commit to smowton/codeql that referenced this pull request Dec 6, 2021
Kotlin: Add support for more kinds of entity
erik-krogh pushed a commit to erik-krogh/ql that referenced this pull request Dec 15, 2021
erik-krogh pushed a commit to erik-krogh/ql that referenced this pull request Dec 15, 2021
dbartol pushed a commit that referenced this pull request Dec 18, 2024
feat(query): New queries for incorrect secrets handling
MathiasVP pushed a commit to MathiasVP/ql that referenced this pull request Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants