![JAR search and dependency download from the Maven repository](/logo.png)
com.jetbrains.pluginverifier.dependencies.processing.DependenciesGraphCycleFinder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of verifier-intellij Show documentation
Show all versions of verifier-intellij Show documentation
JetBrains Plugin Verifier Classes for IntelliJ Platform integration with API usage detection and reporting.
/*
* Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.jetbrains.pluginverifier.dependencies.processing
import com.jetbrains.pluginverifier.dependencies.DependenciesGraph
import com.jetbrains.pluginverifier.dependencies.DependencyNode
import org.jgrapht.Graph
import org.jgrapht.alg.cycle.JohnsonSimpleCycles
import org.jgrapht.graph.DefaultDirectedGraph
import org.jgrapht.graph.DefaultEdge
data class DependenciesGraphCycleFinder(val dependenciesGraph: DependenciesGraph) {
fun findAllCycles(): List> {
val graph: Graph = DefaultDirectedGraph(DefaultEdge::class.java)
dependenciesGraph.vertices.forEach { graph.addVertex(it) }
dependenciesGraph.edges.forEach { graph.addEdge(it.from, it.to) }
//TODO: solve the problem here actually
return try {
JohnsonSimpleCycles(graph).findSimpleCycles()
} catch (e: Exception) {
emptyList()
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy