@@ -128,28 +128,27 @@ ASTNode getAnASTNodeWithAFeature(Function f) {
128
128
}
129
129
130
130
int getNumCharsInFunction ( Function f ) {
131
- result = strictsum ( int i |
132
- exists ( ASTNode node | node = getAnASTNodeWithAFeature ( f ) and i = getTokenizedAstNode ( node ) .length ( ) ) |
133
- i
134
- )
131
+ result =
132
+ strictsum ( ASTNode node | node = getAnASTNodeWithAFeature ( f ) | getTokenizedAstNode ( node ) .length ( ) )
135
133
}
136
134
137
135
// Evaluator string limit is 5395415 characters. We choose a limit lower than this.
138
136
private int getMaxChars ( ) { result = 1000000 }
139
137
140
138
Function getFeaturizableFunction ( Function f ) {
141
- result = f and getNumCharsInFunction ( f ) <= getMaxChars ( )
139
+ result = f and getNumCharsInFunction ( f ) <= getMaxChars ( )
142
140
}
143
141
144
142
/**
145
143
* Returns a featurized representation of the function that can be used to populate the
146
144
* `enclosingFunctionBody` feature for an endpoint.
147
145
*/
148
146
string getBodyTokensFeature ( Function function ) {
149
- // Performance optimization: If a function has more than getMaxChars() characters in its body subtokens,
147
+ // Performance optimization: If a function has more than getMaxChars() characters in its body subtokens,
150
148
// then featurize it as absent.
151
149
function = getFeaturizableFunction ( function ) and
152
- result = strictconcat ( Location l , string token |
150
+ result =
151
+ strictconcat ( Location l , string token |
153
152
// The use of a nested exists here allows us to avoid duplicates due to two AST nodes in the
154
153
// same location featurizing to the same token. By using a nested exists, we take only unique
155
154
// (location, token) pairs.
0 commit comments