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

Class FacetTallies

src/summarycode/tallies.py:366–389  ·  view source on GitHub ↗

Compute tallies for a scan at the codebase level, grouping by facets.

Source from the content-addressed store, hash-verified

364
365@post_scan_impl
366class FacetTallies(PostScanPlugin):
367 """
368 Compute tallies for a scan at the codebase level, grouping by facets.
369 """
370 run_order = 200
371 sort_order = 200
372 codebase_attributes = dict(tallies_by_facet=attr.ib(default=attr.Factory(list)))
373
374 options = [
375 PluggableCommandLineOption(('--tallies-by-facet',),
376 is_flag=True, default=False,
377 help='Compute tallies for license, copyright and other scans and group the '
378 'results by facet.',
379 help_group=POST_SCAN_GROUP,
380 required_options=['facet', 'tallies']
381 )
382 ]
383
384 def is_enabled(self, tallies_by_facet, **kwargs):
385 return tallies_by_facet
386
387 def process_codebase(self, codebase, tallies_by_facet, **kwargs):
388 if TRACE_LIGHT: logger_debug('FacetTallies:process_codebase')
389 tally_codebase_by_facet(codebase, **kwargs)
390
391
392def tally_codebase_by_facet(codebase, **kwargs):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected