Apply suggestions from code review

Co-Authored-By: Felicity Chapman <felicitymay@github.com>
Co-Authored-By: Shati Patel <42641846+shati-patel@users.noreply.github.com>
This commit is contained in:
James Fletcher
2020-03-10 09:26:28 +00:00
committed by james
parent 6ff1c99ae3
commit b1a24705ad
5 changed files with 10 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
Refining a query to account for edge cases
==========================================
You can improve the results generated by a CodeQL query by adding conditions to remove false positives caused by common edge cases.
You can improve the results generated by a CodeQL query by adding conditions to remove false positive results caused by common edge cases.
Overview
--------
@@ -126,7 +126,7 @@ This case can be excluded by creating a recursive predicate. The recursive predi
Refinement 4—simplifying the query
----------------------------------
Finally we can simplify the query by using the transitive closure operator. In this final version of the query, ``c.calls*(fun)`` resolves to the set of all functions that are ``c`` itself, are called by ``c``, are called by a function that is called by ``c``, and so on. This eliminates the need to make a new predicate all together. For more information, see `transitive closures <https://help.semmle.com/QL/ql-handbook/recursion.html#transitive-closures>`__ in the QL language handbook.
Finally we can simplify the query by using the transitive closure operator. In this final version of the query, ``c.calls*(fun)`` resolves to the set of all functions that are ``c`` itself, are called by ``c``, are called by a function that is called by ``c``, and so on. This eliminates the need to make a new predicate all together. For more information, see `Transitive closures <https://help.semmle.com/QL/ql-handbook/recursion.html#transitive-closures>`__ in the QL language handbook.
.. code-block:: ql