aboutcode-org / aboutcode-org/scancode-toolkit

Incorrect license detection

Đang mở
#4,942 0 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

```
"license_expression": "(gpl-2.0 AND unknown) AND (gpl-2.0 OR bsd-simplified)",
"license_expression_spdx": "(GPL-2.0-only AND LicenseRef-scancode-unknown) AND (GPL-2.0-only OR BSD-2-Clause)",
"detection_count": 6,
"reference_matches": [
{
"license_expression": "gpl-2.0 AND unknown",
"license_expression_spdx": "GPL-2.0-only AND LicenseRef-scancode-unknown",
"from_file": "test.cpp",
"start_line": 7,
"end_line": 7,
"matcher": "3-seq",
"score": 5.1,
"matched_length": 5,
"match_coverage": 5.1,
"rule_relevance": 100,
"rule_identifier": "gpl-2.0_and_unknown_trommel_2.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/gpl-2.0_and_unknown_trommel_2.RULE",
"matched_text": " * released under GNU GPL v2 only licence"
},
{
"license_expression": "gpl-2.0 OR bsd-simplified",
"license_expression_spdx": "GPL-2.0-only OR BSD-2-Clause",
"from_file": "test.cpp",
"start_line": 7,
"end_line": 7,
"matcher": "3-seq",
"score": 16.13,
"matched_length": 5,
"match_coverage": 16.13,
"rule_relevance": 100,
"rule_identifier": "gpl-2.0_or_bsd-simplified_20.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/gpl-2.0_or_bsd-simplified_20.RULE",
"matched_text": " * released under GNU GPL v2 only licence"
}
]

.
.
.

"reference_matches": [
{
"license_expression": "gpl-2.0 AND unknown",
"license_expression_spdx": "GPL-2.0-only AND LicenseRef-scancode-unknown",
"from_file": "tmp.cpp",
"start_line": 7,
"end_line": 7,
"matcher": "3-seq",
"score": 5.1,
"matched_length": 5,
"match_coverage": 5.1,
"rule_relevance": 100,
"rule_identifier": "gpl-2.0_and_unknown_trommel_2.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/gpl-2.0_and_unknown_trommel_2.RULE",
"matched_text": " * released under GNU GPL v2 licence"
},
{
"license_expression": "gpl-2.0 OR bsd-simplified",
"license_expression_spdx": "GPL-2.0-only OR BSD-2-Clause",
"from_file": "tmp.cpp",
"start_line": 7,
"end_line": 7,
"matcher": "3-seq",
"score": 12.9,
"matched_length": 4,
"match_coverage": 12.9,
"rule_relevance": 100,
"rule_identifier": "gpl-2.0_or_bsd-simplified_20.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/gpl-2.0_or_bsd-simplified_20.RULE",
"matched_text": " * released under GNU GPL v2 licence"
}
]
```
In this scan output, the matched texts are
`* released under GNU GPL v2 only licence`
and
`* released under GNU GPL v2 licence`

However, because the rules overlap on similar wording, the tool currently returns `(gpl-2.0 AND unknown) AND (gpl-2.0 OR bsd-simplified)` which is incorrect. The expected result, based on the actual matched text should be `gpl-2.0`

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.