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

Function _print_rule_stats

src/licensedcode/models.py:2852–2873  ·  view source on GitHub ↗

Print rules statistics.

()

Source from the content-addressed store, hash-verified

2850
2851
2852def _print_rule_stats():
2853 """
2854 Print rules statistics.
2855 """
2856 from licensedcode.cache import get_index
2857 idx = get_index()
2858 rules = idx.rules_by_rid
2859 sizes = Counter(r.length for r in rules)
2860 print('Top 15 lengths: ', sizes.most_common(15))
2861 print(
2862 '15 smallest lengths: ',
2863 sorted(sizes.items(),
2864 key=itemgetter(0))[:15],
2865 )
2866
2867 high_sizes = Counter(r.high_length for r in rules)
2868 print('Top 15 high lengths: ', high_sizes.most_common(15))
2869 print(
2870 '15 smallest high lengths: ',
2871 sorted(high_sizes.items(),
2872 key=itemgetter(0))[:15],
2873 )
2874
2875
2876def update_ignorables(licensish, verbose=False):

Callers

nothing calls this directly

Calls 1

get_indexFunction · 0.90

Tested by

no test coverage detected