mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-05-01 12:54:22 +02:00
Lazy-load of dependency details
This commit is contained in:
@@ -121,6 +121,7 @@ object DependencyCheckReportsParser{
|
||||
lazy val groupedDependencies = allDependencies.groupBy(_._1.hashes).values.map(GroupedDependency(_)).toSeq
|
||||
lazy val groupedDependenciesByPlainLibraryIdentifier: Map[PlainLibraryIdentifier, Set[GroupedDependency]] =
|
||||
groupedDependencies.toSet.flatMap((grDep: GroupedDependency) => grDep.plainLibraryIdentifiers.map(_ -> grDep)).groupBy(_._1).mapValues(_.map(_._2)).map(identity)
|
||||
lazy val groupedDependenciesByHashes: Map[Hashes, GroupedDependency] = groupedDependencies.map(gd => gd.hashes -> gd).toMap
|
||||
lazy val vulnerableDependencies = groupedDependencies.filter(_.vulnerabilities.nonEmpty)
|
||||
lazy val suppressedOnlyDependencies = groupedDependencies.filter(gd => gd.vulnerabilities.isEmpty && gd.suppressedIdentifiers.nonEmpty)
|
||||
|
||||
|
||||
@@ -274,6 +274,17 @@ class Statistics @Inject()(
|
||||
}
|
||||
}
|
||||
|
||||
def dependencyDetails(selectorOption: Option[String], depPrefix: String, depId: Hashes) = ReadAction.async { implicit req =>
|
||||
val (lastRefreshTime, resultsFuture) = projectReportsProvider.resultsForVersions(versions)
|
||||
resultsFuture flatMap { allResults =>
|
||||
println(selectorOption)
|
||||
select(allResults, selectorOption).fold(Future.successful(notFound())) { selection =>
|
||||
val dep = selection.result.groupedDependenciesByHashes(depId)
|
||||
Future.successful(Ok(views.html.dependencyDetailsInner(depPrefix = depPrefix, dep = dep, selectorOption = selectorOption)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def allFiles(selectorOption: Option[String]) = ReadAction.async { implicit req =>
|
||||
val (lastRefreshTime, resultsFuture) = projectReportsProvider.resultsForVersions(versions)
|
||||
resultsFuture flatMap { allResults =>
|
||||
|
||||
Reference in New Issue
Block a user