MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / compute_path_facets

Function compute_path_facets

src/summarycode/facet.py:157–169  ·  view source on GitHub ↗

Return a sorted list of unique facet strings for `path` using the `facet_definitions` mapping of {pattern: [facet, facet]}.

(path, facet_definitions)

Source from the content-addressed store, hash-verified

155
156
157def compute_path_facets(path, facet_definitions):
158 """
159 Return a sorted list of unique facet strings for `path` using the
160 `facet_definitions` mapping of {pattern: [facet, facet]}.
161 """
162
163 if not path or not path.strip() or not facet_definitions:
164 return []
165
166 facets = set()
167 for matches in get_fileset_matches(path, facet_definitions, all_matches=True):
168 facets.update(matches)
169 return sorted(facets)
170
171
172def build_facets(facets, known_facet_names=FACETS):

Callers 1

process_codebaseMethod · 0.85

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected