Skip to content

Commit

Permalink
Merge pull request #15 from sinha108/main
Browse files Browse the repository at this point in the history
Added null check on IR for cyclomatic complexity computation
  • Loading branch information
sinha108 authored May 3, 2024
2 parents 147e449 + 865b3db commit 23dbbdd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/ibm/northstar/SystemDependencyGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.ibm.wala.ipa.slicer.SDG;
import com.ibm.wala.ipa.slicer.Slicer;
import com.ibm.wala.ipa.slicer.Statement;
import com.ibm.wala.ssa.IR;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.graph.Graph;
Expand Down Expand Up @@ -233,7 +234,10 @@ public static String construct(
for (IMethod method: cls.getAllMethods()) {
Callable callable = getCallableFromSymbolTable(method).getRight();
if (callable != null) {
callable.setCyclomaticComplexity(getCyclomaticComplexity(cache.getIR(method)));
IR ir = cache.getIR(method);
if (ir != null) {
callable.setCyclomaticComplexity(getCyclomaticComplexity(ir));
}
}
}
}
Expand Down

0 comments on commit 23dbbdd

Please sign in to comment.