Skip to content

Commit 8be9b8b

Browse files
committed
Add note about collapsing multiple rows into one
1 parent e2511cd commit 8be9b8b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/codeql/codeql-language-guides/customizing-library-models-for-csharp.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,19 @@ The remaining values are used to define the ``access path``, the ``kind``, and t
192192
- The ninth value ``taint`` is the kind of the flow. ``taint`` means that taint is propagated through the call.
193193
- The tenth value ``manual`` is the provenance of the summary, which is used to identify the origin of the summary.
194194

195+
It would also be possible to merge the two rows into one by using a comma separated list in the seventh value. This would be useful if the method has many arguments and the flow is the same for all of them.
196+
197+
.. code-block:: yaml
198+
199+
extensions:
200+
- addsTo:
201+
pack: codeql/csharp-all
202+
extensible: summaryModel
203+
data:
204+
- ["System", "String", False, "Concat", "(System.Object,System.Object)", "", "Argument[0,1]", "ReturnValue", "taint", "manual"]
205+
206+
This row defines flow from both the first and the second argument to the return value. The seventh value ``Argument[0,1]`` is shorthand for specifying an access path to both ``Argument[0]`` and ``Argument[1]``.
207+
195208
Example: Add flow through the ``Trim`` method
196209
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
197210
This example shows how the C# query pack models flow through a method for a simple case.

0 commit comments

Comments
 (0)