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
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -144,6 +144,13 @@ Function getFeaturizableFunction(Function f) {
144
144
* `enclosingFunctionBody` feature for an endpoint.
145
145
*/
146
146
stringgetBodyTokensFeature(Functionfunction){
147
+
// Performance optimization: If a function has more than 256 body subtokens, then featurize it as
148
+
// absent. This approximates the behavior of the classifer on non-generic body features where
149
+
// large body features are replaced by the absent token.
150
+
strictcount(ASTNodenode|
151
+
node=getAnASTNodeToFeaturize(function)and
152
+
exists(getTokenizedAstNode(node))
153
+
)<=256and
147
154
// Performance optimization: If a function has more than getMaxChars() characters in its body subtokens,
0 commit comments