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

Method is_small

src/licensedcode/match.py:704–733  ·  view source on GitHub ↗

Return True if this match is "small" based on its rule lengths and thresholds. Small matches are spurious matches that are discarded.

(self)

Source from the content-addressed store, hash-verified

702 return self
703
704 def is_small(self):
705 """
706 Return True if this match is "small" based on its rule lengths and
707 thresholds. Small matches are spurious matches that are discarded.
708 """
709 matched_len = self.len()
710 min_matched_len = self.rule.min_matched_length
711
712 high_matched_len = self.hilen()
713 min_high_matched_len = self.rule.min_high_matched_length
714
715 if TRACE_FILTER_SHORT:
716 logger_debug(
717 f'LicenseMatch.is_small(): {self!r}: coverage: {self.coverage()}'
718 )
719
720 if matched_len < min_matched_len or high_matched_len < min_high_matched_len:
721 if TRACE_FILTER_SHORT:
722 logger_debug(' LicenseMatch.is_small(): CASE 1')
723 return True
724
725 if self.rule.is_small and self.coverage() < 80:
726 if TRACE_FILTER_SHORT:
727 logger_debug(' LicenseMatch.is_small(): CASE 2')
728 return True
729
730 if TRACE_FILTER_SHORT:
731 logger_debug(' LicenseMatch.is_small(): not small')
732
733 return False
734
735 def itokens(self, idx):
736 """

Callers 2

filter_too_short_matchesFunction · 0.80

Calls 4

lenMethod · 0.95
hilenMethod · 0.95
coverageMethod · 0.95
logger_debugFunction · 0.70

Tested by 1