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

Function extractCoveredAttributes

pkg/development/coverage/coverage.go:365–383  ·  view source on GitHub ↗

extractCoveredAttributes extracts covered attributes for a given entity from the shape

(entityName string, attributes []string)

Source from the content-addressed store, hash-verified

363
364// extractCoveredAttributes extracts covered attributes for a given entity from the shape
365func extractCoveredAttributes(entityName string, attributes []string) []string {
366 covered := []string{}
367
368 for _, attrStr := range attributes {
369 a, err := attribute.Attribute(attrStr)
370 if err != nil {
371 continue
372 }
373
374 if a.GetEntity().GetType() != entityName {
375 continue
376 }
377
378 formatted := formatAttribute(a.GetEntity().GetType(), a.GetAttribute())
379 covered = append(covered, formatted)
380 }
381
382 return covered
383}
384
385// extractCoveredAssertions extracts covered assertions for a given entity from checks and filters
386func extractCoveredAssertions(entityName string, checks []file.Check, filters []file.EntityFilter) []string {

Callers 1

findUncoveredAttributesFunction · 0.85

Calls 5

AttributeFunction · 0.92
formatAttributeFunction · 0.85
GetTypeMethod · 0.65
GetEntityMethod · 0.45
GetAttributeMethod · 0.45

Tested by

no test coverage detected