You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/codeql/codeql-language-guides/customizing-library-models-for-go.rst
-34Lines changed: 0 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -309,40 +309,6 @@ For the remaining values for both rows:
309
309
310
310
That is, the first row specifies that values can flow from the elements of the qualifier enumerable into the first argument of the function provided to ``Select``. The second row specifies that values can flow from the return value of the function to the elements of the enumerable returned from ``Select``.
311
311
312
-
Example: Add a ``neutral`` method
313
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
314
-
This example shows how we can model a method as being neutral with respect to flow. We will also cover how to model a property by modeling the getter of the ``Now`` property of the ``DateTime`` class as neutral.
315
-
A neutral model is used to define that there is no flow through a method.
316
-
317
-
.. code-block:: csharp
318
-
319
-
publicstaticvoidTaintFlow() {
320
-
System.DateTimet=System.DateTime.Now; // There is no flow from Now to t.
321
-
...
322
-
}
323
-
324
-
We need to add a tuple to the ``neutralModel``\(namespace, type, name, signature, kind, provenance) extensible predicate by updating a data extension file.
Since we are adding a neutral model, we need to add tuples to the ``neutralModel`` extensible predicate.
337
-
The first four values identify the callable (in this case the getter of the ``Now`` property) to be modeled as a neutral, the fifth value is the kind, and the sixth value is the provenance (origin) of the neutral.
338
-
339
-
- The first value ``System`` is the namespace name.
340
-
- The second value ``DateTime`` is the class (type) name.
341
-
- The third value ``get_Now`` is the method name. Getter and setter methods are named ``get_<name>`` and ``set_<name>`` respectively.
342
-
- The fourth value ``()`` is the method input type signature.
343
-
- The fifth value ``summary`` is the kind of the neutral.
344
-
- The sixth value ``manual`` is the provenance of the neutral.
345
-
346
312
Example: Accessing the ``Body`` field of an HTTP request
0 commit comments