Print out graph's nodes and edges to logs for debugging
@@ -321,6 +321,7 @@ public class VulnerabilityCacheProcessorPlugin extends Plugin {
logger.info("No Vulnerabilities Found. Skipping processing of revision.");
persistOutput(revision, "{}");
// continue;
+ return;
} else {
logger.info("Vulnerable IDs: " + vulnerableDependencies.toString());
}
@@ -328,15 +329,18 @@ public class VulnerabilityCacheProcessorPlugin extends Plugin {
depIds.add(revision.id);
var databaseMerger = new CGMerger(depIds, dbContext, graphDao);
var graph = databaseMerger.mergeAllDeps();
+
if (graph == null || graph.numNodes() == 0) {
logger.info("Empty Graph for: " + revision.toString());
persistOutput(revision, "{}");
+ return;
// continue;
} else {
logger.info("Graph exists for: " + revision.toString());
+ logger.info(graph.nodes().toString());
+ logger.info(graph.edgeSet().toString());
}
- assert graph != null;
var vulnerabilities = kbDao.findVulnerableCallables(vulnerableDependencies, graph.nodes());
logger.info("Graph contains vulnerable callables: " + vulnerabilities.keySet().size());
