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
The refactoring to remove the `CodeToFeatures` AST reintroduced a
performance problem. This commit resolves it by pushing size
restrictions into intermediate predicates.
Copy file name to clipboardExpand all lines: javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointFeatures.qll
Copy file name to clipboardExpand all lines: javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/FunctionBodyFeatures.qll
@@ -107,20 +109,38 @@ Function getRepresentativeFunctionForEndpoint(DataFlow::Node endpoint) {
107
109
)
108
110
}
109
111
110
-
/** 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. */
/** 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. */
120
+
stringgetBodyTokensFeature(Functionfunction){
115
121
// Performance optimization: If a function has more than 256 body subtokens, then featurize it as absent. This
116
122
// approximates the behavior of the classifer on non-generic body features where large body
117
123
// features are replaced by the absent token.
118
124
//
119
125
// We count nodes instead of tokens because tokens are often not unique.
0 commit comments