aboutcode-org / aboutcode-org/scancode-toolkit

--only-findings doesn't filter out uninteresting files in --package mode

未關閉
#3,700 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Python
星號
2.6k
分支
791
平均合併
1 天 12 小時
30 天內合併 PR
5

描述

### Description

When using --only-findings together with --package, the only-findings filtering doesn't take effect since the for_packages attribute is always set. This rather defeats the purpose and leads to output files that are 100s of times bigger than really needed.

I suggest that https://github.com/nexB/scancode-toolkit/blob/develop/src/scancode/plugin_only_findings.py needs an exception to ignore for_packages

### How To Reproduce

e.g. `scancode --package --copyright --license --license-text --only-findings --classify --summary --tallies --license-clarity-score --json-pp=scancode-package-and-only-findings.json PATH`

where PATH could be extracted from something like `https://repo1.maven.org/maven2/log4j/log4j/1.2.17/log4j-1.2.17.jar`

The resulting json is about 10,000 lines (instead of 1000 you'd get without the packages option) due to uninformative items like:

```
{
"path": "log4j-1.2.17.jar-extract/org/apache/log4j/Appender.class",
"type": "file",
"package_data": [],
"for_packages": [
"pkg:maven/log4j/log4j@1.2.17?uuid=03c476c1-0273-4156-ba39-639b19b337c5"
],
"is_legal": false,
"is_manifest": false,
"is_readme": false,
"is_top_level": false,
"is_key_file": false,
"detected_license_expression": null,
"detected_license_expression_spdx": null,
"license_detections": [],
"license_clues": [],
"percentage_of_license_text": 0,
"copyrights": [],
"holders": [],
"authors": [],
"scan_errors": []
},
```
### System configuration

* Linux
* scancode-toolkit v 32.0.8
* Installed using pip

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。