aboutcode-org / aboutcode-org/scancode.io

Update D2D purldb matching to pick best match

オープン
#943 コメント 0 件 リアクション 0 件 担当者 1 名 @JonoYang が担当を希望しています GitHub で見る
enhancement
主要言語
Python
スター
215
フォーク
203
平均マージ
4日 8時間
マージ済み PR(30日)
6

説明

In the D2D pipeline, when we match a Resource or Directory against purldb, we return all packages that match to the Resource or Directory. This process should be improved upon, where we choose the best package match. This would reduce the number of extraneous results and provide more accurate results.

Talking with @pombredanne, we should start with figuring out how to best pick the best package match when we are matching package archives. A heuristic that can be used would be to consider the older package that was matched to an archive to be the definitive match.

For matching individual class files, in the case where we get multiple matches on a class file, we should consider the length (number of classpath segments) of the package namespace. The longer the maven package namespace, the more likely we have run into a package that's been repackaged. For example, say we have a class file that was matched to these two packages:

- https://repo1.maven.org/maven2/org/apache/axis/axis/1.4/axis-1.4.jar
- This would have a purl of `pkg:maven/org.apache.axis/axis@1.4`
- https://repo1.maven.org/maven2/com/liferay/org.apache.axis/1.4.LIFERAY-PATCHED-7/org.apache.axis-1.4.LIFERAY-PATCHED-7.jar
- This would have a purl of `pkg:maven/com.liferay.org.apache.axis/axis@1.4.LIFERAY-PATCHED-7`

We would consider `pkg:maven/org.apache.axis/axis@1.4` to be the best match for the class file over `pkg:maven/com.liferay.org.apache.axis/axis@1.4.LIFERAY-PATCHED-7`,

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。