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

Function Run

pkg/development/coverage/coverage.go:74–84  ·  view source on GitHub ↗

Run analyzes the coverage of relationships, attributes, and assertions for a given schema shape and returns the coverage information

(shape file.Shape)

Source from the content-addressed store, hash-verified

72// Run analyzes the coverage of relationships, attributes, and assertions
73// for a given schema shape and returns the coverage information
74func Run(shape file.Shape) SchemaCoverageInfo {
75 definitions, err := parseAndCompileSchema(shape.Schema)
76 if err != nil {
77 return SchemaCoverageInfo{}
78 }
79
80 refs := extractSchemaReferences(definitions)
81 entityCoverageInfos := calculateEntityCoverages(refs, shape)
82
83 return buildSchemaCoverageInfo(entityCoverageInfos)
84}
85
86// parseAndCompileSchema parses and compiles the schema into entity definitions
87func parseAndCompileSchema(schema string) ([]*base.EntityDefinition, error) {

Callers 1

coverage_test.goFile · 0.70

Calls 4

parseAndCompileSchemaFunction · 0.85
extractSchemaReferencesFunction · 0.85
calculateEntityCoveragesFunction · 0.85
buildSchemaCoverageInfoFunction · 0.85

Tested by

no test coverage detected