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

Function is_correct_detection

src/licensedcode/detection.py:1078–1092  ·  view source on GitHub ↗

Return True if all the matches in ``license_matches`` List of LicenseMatch are perfect license detections.

(license_matches)

Source from the content-addressed store, hash-verified

1076
1077
1078def is_correct_detection(license_matches):
1079 """
1080 Return True if all the matches in ``license_matches`` List of LicenseMatch
1081 are perfect license detections.
1082 """
1083 matchers = (license_match.matcher for license_match in license_matches)
1084 is_match_coverage_perfect = [
1085 license_match.coverage() == 100
1086 for license_match in license_matches
1087 ]
1088
1089 return (
1090 all(matcher in ("1-hash", "1-spdx-id", "2-aho") for matcher in matchers)
1091 and all(is_match_coverage_perfect)
1092 )
1093
1094
1095def is_match_coverage_less_than_threshold(license_matches, threshold, any_matches=True):

Calls 1

coverageMethod · 0.45