aboutcode-org / aboutcode-org/scancode-toolkit

python-2.0 license false positive

Đang mở
#2,377 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug license scan
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
When trying to scan the project https://github.com/keras-team/keras with latest scancode, It get two false positives.
Two files are:
https://github.com/keras-team/keras/blob/master/keras/distribute/sidecar_evaluator.py
and
https://github.com/keras-team/keras/blob/master/keras/utils/generic_utils.py

"License" and "python" are there in consecutive lines, it is detected as python-2.0 license
```
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Python module for evaluation loop."""

from __future__ import absolute_import
```

```
{
"key": "python",
"score": 100.0,
"name": "Python Software Foundation License v2",
"short_name": "Python License 2.0",
"category": "Permissive",
"is_exception": false,
"owner": "Python Software Foundation (PSF)",
"homepage_url": "http://docs.python.org/license.html",
"text_url": "http://spdx.org/licenses/Python-2.0",
"reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:python",
"spdx_license_key": "Python-2.0",
"spdx_url": "https://spdx.org/licenses/Python-2.0",
"start_line": 13,
"end_line": 15,
"matched_rule": {
"identifier": "python_13.RULE",
"license_expression": "python",
"licenses": [
"python"
],
"is_license_text": false,
"is_license_notice": false,
"is_license_reference": false,
"is_license_tag": true,
"matcher": "2-aho",
"rule_length": 2,
"matched_length": 2,
"match_coverage": 100.0,
"rule_relevance": 100.0
},
"matched_text": "# limitations under the License.\n# ==============================================================================\n\"\"\"Python utilities required by Keras.\"\"\""
}
```
and
```
{
"key": "python",
"score": 100.0,
"name": "Python Software Foundation License v2",
"short_name": "Python License 2.0",
"category": "Permissive",
"is_exception": false,
"owner": "Python Software Foundation (PSF)",
"homepage_url": "http://docs.python.org/license.html",
"text_url": "http://spdx.org/licenses/Python-2.0",
"reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:python",
"spdx_license_key": "Python-2.0",
"spdx_url": "https://spdx.org/licenses/Python-2.0",
"start_line": 14,
"end_line": 16,
"matched_rule": {
"identifier": "python_13.RULE",
"license_expression": "python",
"licenses": [
"python"
],
"is_license_text": false,
"is_license_notice": false,
"is_license_reference": false,
"is_license_tag": true,
"matcher": "2-aho",
"rule_length": 2,
"matched_length": 2,
"match_coverage": 100.0,
"rule_relevance": 100.0
},
"matched_text": "# limitations under the License.\n# ==============================================================================\n\"\"\"Python module for evaluation loop.\"\"\""
}
```
Text for [python_13.RULE](https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/rules/python_13.RULE) is ``` license = "Python"```
### How To Reproduce

scancode -li --license-text --json-pp - generic_utils.py
scancode -li --license-text --json-pp - sidecar_evaluator.py

### System configuration

* What OS are you running on? (Windows/MacOS/Linux)
Ubuntu18.04
* What version of scancode-toolkit was used to generate the scan file?
ScanCode 3.2.3
* What installation method was used to install/run scancode? (pip/source download/other)
pip
* Python version
Python 3.6.12

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.