Skip to content

Commit

Permalink
Better Description for Stats and added "Used Directly By"
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Sep 30, 2024
1 parent 10d52aa commit 8f76b28
Show file tree
Hide file tree
Showing 3 changed files with 236 additions and 205 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ class ReportDataRepo(
}
}


fun moduleDirectlyUsedBy(path: ModulePath): Flow<Map<ModulePath, List<ConfigurationName>>?> =
collectedDataRepo.directDependenciesData.mapLatest { directDependenciesData ->
val directDependencies = directDependenciesData?.directDependencies
directDependencies?.entries?.filter { (modulePath, configurationToDependencyIds) ->
configurationToDependencyIds.any { it.value.contains(path) }
}?.associate { (modulePath, configurationToDependencyIds) ->
modulePath to configurationToDependencyIds.keys.toList()
}
}

fun moduleTransitivelyUsedBy(path: ModulePath): Flow<Map<ModulePath, List<ConfigurationName>>?> =
allInvertedDependencies.mapLatest { allInvertedDependenciesMap: Map<DependencyId, Map<ModulePath, List<ConfigurationName>>>? ->
if (allInvertedDependenciesMap != null) {
Expand All @@ -214,8 +225,8 @@ class ReportDataRepo(


fun directDependenciesOf(modulePath: ModulePath?): Flow<Map<ConfigurationName, Set<DependencyId>>?> =
collectedDataRepo.directDependenciesData.mapLatest { directDependenciesData ->
directDependenciesData?.directDependencies?.get(modulePath)
allDirectDependencies.mapLatest { directDependenciesData ->
directDependenciesData?.get(modulePath)
}

fun statsForKey(statKey: StatKey): Flow<MutableList<ModuleOwnerAndCodeReference>> =
Expand Down
Loading

0 comments on commit 8f76b28

Please sign in to comment.