Return True if all the matches in ``license_matches`` List of LicenseMatch are perfect license detections.
(license_matches)
| 1076 | |
| 1077 | |
| 1078 | def 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 | |
| 1095 | def is_match_coverage_less_than_threshold(license_matches, threshold, any_matches=True): |