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: javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/FunctionBodyFeatures.qll
+16-10Lines changed: 16 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,7 @@ import javascript
8
8
privateimport FeaturizationConfig
9
9
10
10
/**
11
-
* Returns a tokenized representation of the AST node for use in the `enclosingFunctionBody`
12
-
* feature.
11
+
* Gets a tokenized representation of the AST node for use in the `enclosingFunctionBody` feature.
/** Holds if `location` is the location of an AST node within the function `function` and `token` is a node attribute associated with that AST node. */
130
+
/**
131
+
* Returns a featurized representation of the function that can be used to populate the
132
+
* `enclosingFunctionBody` feature for an endpoint.
133
+
*/
128
134
stringgetBodyTokensFeature(Functionfunction){
129
-
// Performance optimization: If a function has more than 256 body subtokens, then featurize it as absent. This
130
-
// approximates the behavior of the classifer on non-generic body features where large body
131
-
// features are replaced by the absent token.
135
+
// Performance optimization: If a function has more than 256 body subtokens, then featurize it as
136
+
// absent. This approximates the behavior of the classifer on non-generic body features where
137
+
// large body features are replaced by the absent token.
132
138
//
133
139
// We count nodes instead of tokens because tokens are often not unique.
0 commit comments