Run analyzes the coverage of relationships, attributes, and assertions for a given schema shape and returns the coverage information
(shape file.Shape)
| 72 | // Run analyzes the coverage of relationships, attributes, and assertions |
| 73 | // for a given schema shape and returns the coverage information |
| 74 | func 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 |
| 87 | func parseAndCompileSchema(schema string) ([]*base.EntityDefinition, error) { |
no test coverage detected