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

Function calculateAverageCoverage

pkg/development/coverage/coverage.go:331–336  ·  view source on GitHub ↗

calculateAverageCoverage calculates average coverage with zero-division guard

(total, covered int)

Source from the content-addressed store, hash-verified

329
330// calculateAverageCoverage calculates average coverage with zero-division guard
331func calculateAverageCoverage(total, covered int) int {
332 if total == 0 {
333 return 100
334 }
335 return covered / total
336}
337
338// extractCoveredRelationships extracts covered relationships for a given entity from the shape
339func extractCoveredRelationships(entityName string, relationships []string) []string {

Callers 1

calculateTotalCoverageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected