4 ms·
I think the QL handbook is what you're looking for: https://help.semmle.com/QL/ql-handbook/ https://help.semmle.com/QL/ql-handbook/ Other QL references (such a
by spatulon 8y ago
I think the QL handbook is what you're looking for: https://help.semmle.com/QL/ql-handbook/ https://help.semmle.com/QL/ql-handbook/
Other QL references (such as the reference manuals for the language-specific libraries) are linked from here: https://help.semmle.com/QL/ql-home.html https://help.semmle.com/QL/ql-home.html
Personally (having joined the company reasonably recently), I haven't found it particularly hard to figure out how to express my intentions in QL. Most complex queries start their lives as simple ones that return too many results; the complexity comes from adding extra conditions to refine the results, and is generally manageable. However, I do occasionally have difficulties where a query I'm developing returns no results, and my years of experience debugging imperative programs don't really help as much as I would like in figuring out what's wrong. It can also be quite easy for beginners to write queries that are interminably slow for non-obvious reasons; I believe we're working on documentation to help with that.
We do have a database of all the default queries here: https://help.semmle.com/wiki/display/QL/Built-in+queries https://help.semmle.com/wiki/display/QL/Built-in+queries
But I notice that not all of them have examples, and many of the examples we do have are fairly contrived. I like your idea of taking snippets from matching OSS projects.
Edit: our CEO gently reminded me that, if you look at the help page on lgtm.com for a particular query/rule/alert, you can get a list of all results across every OSS project we analyse, e.g. https://lgtm.com/rules/1506728586782/alerts/ https://lgtm.com/rules/1506728586782/alerts/
- walterbell 8y agoThanks for the references, that last link is very cool! > It can also be quite easy for beginners to write queries that are interminably slow for non-obvious reasons; I believe we're working on documentation to help with that RDBMS have the same challenge. Data visibility for query parser internals can help, https://www.embarcadero.com/images/dm/technical-papers/sybase-ase-query-optimization.pdf https://www.embarcadero.com/images/dm/technical-papers/sybas...