From f77c6e4bbe5816914189c5fe41ce331a6eb22904 Mon Sep 17 00:00:00 2001 From: Mathias Morbitzer Date: Fri, 10 Nov 2023 12:45:26 +0100 Subject: [PATCH] improved output --- .../src/main/kotlin/de/fraunhofer/aisec/cpg/query/Query.kt | 2 +- .../src/main/kotlin/de/fraunhofer/aisec/cpg/query/QueryTree.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/Query.kt b/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/Query.kt index 89aa74fa0b3..fcef8d986a7 100644 --- a/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/Query.kt +++ b/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/Query.kt @@ -197,7 +197,7 @@ fun max(n: Node?, eval: ValueEvaluator = MultiValueEvaluator()): QueryTree { val evalRes = from.followNextDFGEdgesUntilHit { it == to } val allPaths = evalRes.fulfilled.map { QueryTree(it) }.toMutableList() - allPaths.addAll(evalRes.failed.map { QueryTree(it) }) + // allPaths.addAll(evalRes.failed.map { QueryTree(it) }) return QueryTree( evalRes.fulfilled.isNotEmpty(), allPaths.toMutableList(), diff --git a/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/QueryTree.kt b/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/QueryTree.kt index 02d0dde2ec1..65bd5a46a96 100644 --- a/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/QueryTree.kt +++ b/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/QueryTree.kt @@ -63,7 +63,7 @@ open class QueryTree( fun printNicely(depth: Int = 0): String { var res = " ".repeat(depth) + - "$stringRepresentation (==> $value)\n" + + "$stringRepresentation (==> ${if (value is List<*>) (value as List<*>).joinToString("\n","[", "]") else value})\n" + "--------".repeat(depth + 1) if (children.isNotEmpty()) { res += "\n"