Skip to content

Commit 8e4278d

Browse files
Fix license clues bug
The license clue detection step was in the wrong order for file detections. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent c79a086 commit 8e4278d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/licensedcode/detection.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,9 @@ def has_correct_license_clue_matches(license_matches):
11391139
Return True if all the matches in ``license_matches`` List of LicenseMatch
11401140
has True for the `is_license_clue` rule attribute.
11411141
"""
1142-
return is_correct_detection(license_matches) and all(match.rule.is_license_clue for match in license_matches)
1142+
return is_correct_detection(license_matches) and all(
1143+
match.rule.is_license_clue for match in license_matches
1144+
)
11431145

11441146

11451147
def is_low_quality_matches(license_matches):
@@ -1554,13 +1556,13 @@ def analyze_detection(license_matches, package_license=False):
15541556
):
15551557
return DetectionCategory.FALSE_POSITVE.value
15561558

1559+
elif has_correct_license_clue_matches(license_matches=license_matches):
1560+
return DetectionCategory.LICENSE_CLUES.value
1561+
15571562
# Case where all matches have `matcher` as `1-hash` or `4-spdx-id`
15581563
elif is_correct_detection_non_unknown(license_matches=license_matches):
15591564
return DetectionCategory.PERFECT_DETECTION.value
15601565

1561-
elif has_correct_license_clue_matches(license_matches=license_matches):
1562-
return DetectionCategory.LICENSE_CLUES.value
1563-
15641566
# Case where even though the matches have perfect coverage, they have
15651567
# matches with `unknown` rule identifiers
15661568
elif has_unknown_matches(license_matches=license_matches):

0 commit comments

Comments
 (0)