MCPcopy Create free account
hub / github.com/Permify/permify / buildSchemaCoverageInfo

Function buildSchemaCoverageInfo

pkg/development/coverage/coverage.go:279–288  ·  view source on GitHub ↗

buildSchemaCoverageInfo builds the final SchemaCoverageInfo with total coverage

(entityCoverageInfos []EntityCoverageInfo)

Source from the content-addressed store, hash-verified

277
278// buildSchemaCoverageInfo builds the final SchemaCoverageInfo with total coverage
279func buildSchemaCoverageInfo(entityCoverageInfos []EntityCoverageInfo) SchemaCoverageInfo {
280 relationshipsCoverage, attributesCoverage, assertionsCoverage := calculateTotalCoverage(entityCoverageInfos)
281
282 return SchemaCoverageInfo{
283 EntityCoverageInfo: entityCoverageInfos,
284 TotalRelationshipsCoverage: relationshipsCoverage,
285 TotalAttributesCoverage: attributesCoverage,
286 TotalAssertionsCoverage: assertionsCoverage,
287 }
288}
289
290// calculateCoveragePercent calculates coverage percentage based on total and uncovered elements
291func calculateCoveragePercent(totalElements, uncoveredElements []string) int {

Callers 1

RunFunction · 0.85

Calls 1

calculateTotalCoverageFunction · 0.85

Tested by

no test coverage detected