@@ -227,21 +227,6 @@ public static String construct(
227
227
IAnalysisCacheView cache = new AnalysisCacheImpl (AstIRFactory .makeDefaultFactory (),
228
228
options .getSSAOptions ());
229
229
230
- // set cyclomatic complexity for callables in the symbol table
231
- int numClasses = cha .getNumberOfClasses ();
232
- for (Iterator <IClass > classIter = cha .iterator (); classIter .hasNext (); ) {
233
- IClass cls = classIter .next ();
234
- for (IMethod method : cls .getAllMethods ()) {
235
- Callable callable = getCallableFromSymbolTable (method ).getRight ();
236
- if (callable != null ) {
237
- IR ir = cache .getIR (method );
238
- if (ir != null ) {
239
- callable .setCyclomaticComplexity (getCyclomaticComplexity (ir ));
240
- }
241
- }
242
- }
243
- }
244
-
245
230
// Build call graph
246
231
Log .info ("Building call graph." );
247
232
@@ -264,6 +249,14 @@ public static String construct(
264
249
Log .done ("Finished construction of call graph. Took "
265
250
+ Math .ceil ((double ) (System .currentTimeMillis () - start_time ) / 1000 ) + " seconds." );
266
251
252
+ // set cyclomatic complexity for callables in the symbol table
253
+ callGraph .forEach (cgNode -> {
254
+ Callable callable = getCallableFromSymbolTable (cgNode .getMethod ()).getRight ();
255
+ if (callable != null ) {
256
+ callable .setCyclomaticComplexity (getCyclomaticComplexity (cgNode .getIR ()));
257
+ }
258
+ });
259
+
267
260
// Build SDG graph
268
261
Log .info ("Building System Dependency Graph." );
269
262
SDG <? extends InstanceKey > sdg = new SDG <>(
0 commit comments