aboutcode-org / aboutcode-org/scancode-toolkit

`unknown-license-reference` to complex paths are not followed

Open
#4,487 1 comment 0 reactions 0 assignees View on GitHub
bug improve-license-detection license-reference
Dominant language
Python
Stars
2.6k
Forks
791
Avg merge
1d 12h
Merged PRs (30d)
5

Description

### Description

https://github.com/Automattic/node-canvas with tag 3.1.2 is being identified as LicenseRef-scancode-unknown-license-reference AND MIT

is this a scancode issue, or is this node-canvas s fault?
There are a very similar issues:
- https://github.com/aboutcode-org/scancode-toolkit/issues/4387
- https://github.com/aboutcode-org/scancode-toolkit/issues/4481

### How To Reproduce

```sh
git clone git@github.com:Automattic/node-canvas.git
git checkout 3.1.2
scancode --license --json-pp /tmp/results.json node-cookie-signature
````
results in
```json
{
"path": "node-canvas/Readme.md",
"type": "file",
"detected_license_expression": "mit AND (mit AND unknown-license-reference)",
"detected_license_expression_spdx": "MIT AND (MIT AND LicenseRef-scancode-unknown-license-reference)",
"license_detections": [
{
"license_expression": "mit",
"license_expression_spdx": "MIT",
"matches": [
{
"license_expression": "mit",
"spdx_license_expression": "MIT",
"from_file": "node-canvas/Readme.md",
"start_line": 632,
"end_line": 632,
"matcher": "2-aho",
"score": 100,
"matched_length": 3,
"match_coverage": 100,
"rule_relevance": 100,
"rule_identifier": "mit_27.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mit_27.RULE"
}
],
"identifier": "mit-3ab5a1cd-6f73-3105-a815-d0d7c55b1922"
},
{
"license_expression": "mit AND unknown-license-reference",
"license_expression_spdx": "MIT AND LicenseRef-scancode-unknown-license-reference",
"matches": [
{
"license_expression": "mit",
"spdx_license_expression": "MIT",
"from_file": "node-canvas/Readme.md",
"start_line": 638,
"end_line": 653,
"matcher": "2-aho",
"score": 100,
"matched_length": 161,
"match_coverage": 100,
"rule_relevance": 100,
"rule_identifier": "mit.LICENSE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.LICENSE"
},
{
"license_expression": "unknown-license-reference",
"spdx_license_expression": "LicenseRef-scancode-unknown-license-reference",
"from_file": "node-canvas/Readme.md",
"start_line": 657,
"end_line": 657,
"matcher": "2-aho",
"score": 100,
"matched_length": 2,
"match_coverage": 100,
"rule_relevance": 100,
"rule_identifier": "unknown-license-reference_see-license_1.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/unknown-license-reference_see-license_1.RULE"
}
],
"identifier": "mit_and_unknown_license_reference-ca4b59e1-36db-1321-b1ca-a4fad99cffb0"
}
],
"license_clues": [],
"percentage_of_license_text": 4.26,
"scan_errors": []
}
```

### System configuration

> For bug reports, it really helps us to know:

* What OS are you running on? (Windows/MacOS/Linux)
Fedora 42

* What version of scancode-toolkit was used to generate the scan file?
```sh
% scancode --version
ScanCode version: 32.2.0
ScanCode Output Format version: 3.2.0
SPDX License list version: 3.24
```

* What installation method was used to install/run scancode? (pip/source download/other)
dnf

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.