Skip to content

Commit

Permalink
fix detekt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingDepot committed Apr 29, 2024
1 parent 92e603a commit afdc925
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ class PrecedesEvaluator(val prevOp: Op, val thisOp: Op) : Evaluator {
val passMessage = ruleAnnotation?.passMessage?.takeIf { it.isNotEmpty() } ?: defaultPassMessage

for (target in thisNodes) {
/*
val paths = prevNodes
.map { start -> start.followNextEOGEdgesUntilHit { target == it } }
.fold(FulfilledAndFailedPaths(listOf(), listOf())) { acc, next ->
FulfilledAndFailedPaths(acc.fulfilled + next.fulfilled, acc.failed + next.failed)
}
*/
val paths = target.followPrevEOGEdgesUntilHit { prevNodes.contains(it) }

val newFindings =
Expand All @@ -77,11 +70,11 @@ class PrecedesEvaluator(val prevOp: Op, val thisOp: Op) : Evaluator {
listOf(
CpgFinding(
message = "Complies with rule: ${availablePrevNodes.joinToString(
prefix = "\"",
separator = "\", \"",
postfix = "\"",
transform = { node -> node.code ?: node.toString() }
)} precedes ${target.code}. $passMessage",
prefix = "\"",
separator = "\", \"",
postfix = "\"",
transform = { node -> node.code ?: node.toString() }
)} precedes ${target.code}. $passMessage",
kind = Finding.Kind.Pass,
node = target,
relatedNodes = availablePrevNodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import org.junit.jupiter.api.Test
import java.nio.file.Path
import kotlin.io.path.*
import kotlin.reflect.full.valueParameters
import kotlin.test.Ignore
import kotlin.test.assertFalse
import kotlin.test.assertNotNull
import kotlin.test.assertTrue
Expand Down

0 comments on commit afdc925

Please sign in to comment.