aboutcode-org / aboutcode-org/scancode-toolkit

Scancode is not filling the "packages" - attribute in the scanresult when a folder is existent, that in order, is before node_modules

Đang mở
#3,168 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
2.6k
Fork
791
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
5

Mô tả

### Description

There seems to be some problem with analyzing the installed packages when not following a certain structure:

The example given is based on an npm project:

Lets say we have a project called "test"
This project has one module installed (e.g. "ajv") via npm

1 folder and 2 files are present:

node_modules
package.json
package-lock.json

Scanning this project returns a scanfile where the package-attribute contains 6 packages (ajv and its dependencies)

If i however create a folder (doesnt matter if the folder is empty or not) and i name this folder "nn", the returned packages will shrink down to 1.
Naming the folder "np" instead, will return the packages as expected.

This somehow has to do with the order of the folder. If the Folder is alphabetically before the node_modules folder, it will screw up the result.
If the folder stands after the node_modules folder, it will work.

This bug is reproducable by following the described steps.
I don't know if this happens with other package managers also, i just tried this with npm.

### System configuration

Scancode-version:
scancode-toolkit-v31.2.1

Scancode-command:
"../scancode-toolkit-v31.2.1/scancode -clpui -n 6 --json-pp "./scannerResult/scanner-result.json" "../test"

Model Name: MacBook Pro
Model Identifier: MacBookPro18,3
Model Number: Z15J00090D/A
Chip: Apple M1 Pro
Total Number of Cores: 10 (8 performance and 2 efficiency)
Memory: 32 GB
System Firmware Version: 8419.41.10
OS Loader Version: 8419.41.10

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.