Skip to content

Commit 095beb3

Browse files
Esben Sparre AndreasenStephan Brandauer
authored andcommitted
add docstring examples
1 parent 548f028 commit 095beb3

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

  • javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointFeatures.qll

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,15 @@ private module SyntacticUtilities {
533533
* "Containment" is syntactic, and currently means that the endpoint is an argument to the call, or that the endpoint is a (nested) property value of an argument.
534534
*
535535
* This feature is intended as a superior version of the many `Callee*` features.
536+
*
537+
* Examples:
538+
* ```
539+
* foo(endpoint); // -> foo
540+
* foo.bar(endpoint); // -> foo.bar
541+
* foo.bar({ baz: endpoint }); // -> foo.bar
542+
* this.foo.bar(endpoint); // -> this.foo.bar
543+
* foo[complex()].bar(endpoint); // -> foo.?.bar
544+
* ```
536545
*/
537546
class Callee_AccessPath extends EndpointFeature, TCallee_AccessPath {
538547
override string getName() { result = "Callee_AccessPath" }
@@ -558,6 +567,13 @@ class Callee_AccessPath extends EndpointFeature, TCallee_AccessPath {
558567
* "Containment" is syntactic, and currently means that the endpoint is an argument to the call, or that the endpoint is a (nested) property value of an argument.
559568
*
560569
* This feature is intended as a superior version of the `ArgumentIndexFeature`.
570+
*
571+
* Examples:
572+
* ```
573+
* foo(endpoint); // -> 0
574+
* foo({ bar: endpoint }); // -> 0.bar
575+
* foo(x, { bar: { baz: endpoint } }); // -> 1.bar.baz
576+
* ```
561577
*/
562578
class Input_ArgumentIndexAndAccessPathFromCallee extends EndpointFeature,
563579
TInput_ArgumentIndexAndAccessPathFromCallee {
@@ -582,6 +598,12 @@ class Input_ArgumentIndexAndAccessPathFromCallee extends EndpointFeature,
582598
* "Containment" is syntactic, and currently means that the endpoint is an argument to the call, or that the endpoint is a (nested) property value of an argument.
583599
*
584600
* This feature is intended as a superior version of the `ArgumentIndexFeature`.
601+
*
602+
* Examples:
603+
* ```
604+
* foo({ bar: endpoint }); // -> bar
605+
* foo(x, { bar: { baz: endpoint } }); // -> bar.baz
606+
* ```
585607
*/
586608
class Input_AccessPathFromCallee extends EndpointFeature, TInput_AccessPathFromCallee {
587609
override string getName() { result = "Input_AccessPathFromCallee" }
@@ -602,6 +624,13 @@ class Input_AccessPathFromCallee extends EndpointFeature, TInput_AccessPathFromC
602624
* "Containment" is syntactic, and currently means that the endpoint is an argument to the call, or that the endpoint is a (nested) property value of an argument.
603625
*
604626
* This feature is intended as a superior version of the `ArgumentIndexFeature`.
627+
*
628+
* Examples:
629+
* ```
630+
* foo(endpoint); // -> 0
631+
* foo({ bar: endpoint }); // -> 0
632+
* foo(x, { bar: { baz: endpoint } }); // -> 1
633+
* ```
605634
*/
606635
class Input_ArgumentIndex extends EndpointFeature, TInput_ArgumentIndex {
607636
override string getName() { result = "Input_ArgumentIndex" }

0 commit comments

Comments
 (0)