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

UPL-1.0 or Apache-2.0 is detected instead of just Apache-2.0 #2274

Open
fviernau opened this issue Oct 12, 2020 · 1 comment
Open

UPL-1.0 or Apache-2.0 is detected instead of just Apache-2.0 #2274

fviernau opened this issue Oct 12, 2020 · 1 comment
Labels

Comments

@fviernau
Copy link
Contributor

fviernau commented Oct 12, 2020

Description

Scannning this line results in upl-1.0 being detected in addition to apache-2.0 via this rule.

How To Reproduce

./scancode in.txt -l --json-pp out.txt

System configuration

  • Ubuntu 20.04
  • scancode 3.2.1rc2
  • release archive
@fviernau fviernau added the bug label Oct 12, 2020
@pombredanne
Copy link
Member

@fviernau Thanks
The text at play is:
licenses := Seq("Apache 2.0 License" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")),
and if I run scancode --license --license-text --license-text-diagnostics ... we get:

          "matched_rule": {
            "identifier": "upl-1.0_or_apache-2.0_1.RULE",
            "license_expression": "upl-1.0 OR apache-2.0",
            "licenses": [
              "upl-1.0",
              "apache-2.0"
            ],
            "is_license_text": false,
            "is_license_notice": true,
            "is_license_reference": false,
            "is_license_tag": false,
            "matcher": "3-seq",
            "rule_length": 50,
            "matched_length": 10,
            "match_coverage": 20.0,
            "rule_relevance": 100.0
          },
          "matched_text": "licenses := [Seq](\"[Apache] [2].[0] License\" -> [url](\"http://www.apache.org/licenses/LICENSE-2.0."

The way I would go about solving this would be:

  1. edit upl-1.0_or_apache-2.0_1.yml to add a minimum_coverage: 50 as a coverage of 20 (e.g. 10/50 words) is not enough to be good.
  2. create two new rules that only report license_expression: apache-2.0 'is_license_tag: yes minimum_coverage: 95andrelevance: 100` with these texts:
  • licenses := Seq("Apache 2.0 License" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"
  • "Apache 2.0 License" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"

@AyanSinhaMahapatra what do you think?

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

No branches or pull requests

2 participants