Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong GPL version detection due to rule gpl_35.RULE #2124

Closed
Toniprni opened this issue Jul 23, 2020 · 2 comments
Closed

Wrong GPL version detection due to rule gpl_35.RULE #2124

Toniprni opened this issue Jul 23, 2020 · 2 comments

Comments

@Toniprni
Copy link

Description

Due to ScanCode's rule gpl_35.RULE, a clear GPL-3.0-or-later hit was marked as GPL-1.0-or-later with a high license score 98.08. This also happened in other files. See the ScanCode results for the file below.

    {
        "path": "bc-1.07.1.tar.gz-extract/bc-1.07.1/bc/storage.c",
        "type": "file",
        "name": "storage.c",
        "base_name": "storage",
        "extension": ".c",
        "size": 22842,
        "date": "2017-04-07",
        "sha1": "e583fcf6e057c894e1ed820d5a78603f197374c0",
        "md5": "2a5785494bfb7e97194f05810c19656a",
        "mime_type": "text/x-c",
        "file_type": "C source, ASCII text",
        "programming_language": "C++",
        "is_binary": false,
        "is_text": true,
        "is_archive": false,
        "is_media": false,
        "is_source": true,
        "is_script": false,
        "licenses": [
            {
                "key": "gpl-1.0-plus",
                "score": 98.08,
                "name": "GNU General Public License 1.0 or later",
                "short_name": "GPL 1.0 or later",
                "category": "Copyleft",
                "is_exception": false,
                "owner": "Free Software Foundation (FSF)",
                "homepage_url": "http://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html",
                "text_url": "http://www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html",
                "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:gpl-1.0-plus",
                "spdx_license_key": "GPL-1.0-or-later",
                "spdx_url": "https://spdx.org/licenses/GPL-1.0-or-later",
                "start_line": 5,
                "end_line": 17,
                "matched_rule": {
                    "identifier": "gpl_35.RULE",
                    "license_expression": "gpl-1.0-plus",
                    "licenses": [
                        "gpl-1.0-plus"
                    ],
                    "is_license_text": false,
                    "is_license_notice": true,
                    "is_license_reference": false,
                    "is_license_tag": false,
                    "matcher": "3-seq",
                    "rule_length": 104,
                    "matched_length": 102,
                    "match_coverage": 98.08,
                    "rule_relevance": 100
                }
            }
        ],

How To Reproduce

Scan the following:
bc-1.07.1.tar.gz

File path: bc-1.07.1.tar.gz-extract/bc-1.07.1/bc/storage.c

Gives result => GPL-1.0-or-later and uses rule gpl_35.RULE

System configuration

  • What OS are you running on? (Windows Subsystem For Linux (Ubuntu 18.04))
  • What version of scancode-toolkit was used to generate the scan file? Version 3.1.1 AND develop branch (both produce the same issue)
  • What installation method was used to install/run scancode? (source download)
@Toniprni Toniprni added the bug label Jul 23, 2020
@pombredanne
Copy link
Member

@Toniprni Thank you ++ for this report! that's a great catch!

FYI, If you run with these extra options it help see what the problem is:

  • --license-text see the actual license text detected
  • --license-text-diagnostics with the above, in the matched license text, include diagnostic highlighting with surrounding square brackets [] the words that are not matched.

See for instance: bc.json.txt
There are a few extra issues there that should be easy to fix with a few updated and new license detection rules.

pombredanne added a commit that referenced this issue Sep 7, 2020
Reported-by: Toniprni @Toniprni
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@pombredanne
Copy link
Member

This has been fixed and merged in develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants