aboutcode-org / aboutcode-org/scancode-toolkit

python-2.0 license false positive

Abierto
#2,377 3 comentarios 0 reacciones 0 asignados Ver en GitHub
bug license scan
Lenguaje dominante
Python
Estrellas
2.6k
Forks
791
Merge medio
1 d 12 h
PR fusionados (30 d)
5

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.