File tree Expand file tree Collapse file tree
services/apps/git_integration/src/crowdgit/services/license Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,18 @@ async def detect(self, repo_path: str) -> str | None:
3737 if matched_files
3838 else None
3939 )
40+
41+ # Mirror GitHub's threshold — below 98% similarity the match is unreliable.
42+ # Downgrade low-confidence matches to NOASSERTION so the distinction is clean:
43+ # NULL = no license file found
44+ # NOASSERTION = found a license file but couldn't reliably identify it
45+ # The UI should display NOASSERTION as "Other".
46+ if spdx_id and spdx_id != "NOASSERTION" and confidence is not None and confidence < 98 :
47+ self .logger .info (
48+ f"License downgraded to NOASSERTION: confidence { confidence } % below threshold in { repo_path } "
49+ )
50+ return "NOASSERTION"
51+
4052 if spdx_id :
4153 self .logger .info (
4254 f"License detected: { spdx_id } (confidence={ confidence } ) in { repo_path } "
You can’t perform that action at this time.
0 commit comments