aboutcode-org / aboutcode-org/scancode-toolkit

Got CC-BY-NC-SA-3.0 for file mentioning elements under CC-BY-SA-3.0

未關閉
#3,703 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Python
星號
2.6k
分支
791
平均合併
1 天 12 小時
30 天內合併 PR
5

描述

### Description
This code snippet:
~~~
/*
* Simple square root algorithm. This is from:
* http://stackoverflow.com/questions/1623375/writing-your-own-square-root-function
* Written by Chihung Yu
* Creative Commons license
* http://creativecommons.org/licenses/by-sa/3.0/legalcode
* It has been modified to compile correctly, and for U-Boot style.
*/
static double tt_sqrt(double value)
{
double lo = 1.0;
double hi = value;

while (hi - lo > 0.00001) {
double mid = lo + (hi - lo) / 2;

if (mid * mid - value > 0.00001)
hi = mid;
else
lo = mid;
}

return lo;
}
~~~
from https://github.com/Xilinx/u-boot-xlnx/blob/3290b109bfa70d65ed4ce49ed84afed0ed4335e0/drivers/video/console_truetype.c#L39 gets detected as `CC-BY-NC-SA-3.0` instead of `CC-BY-SA-3.0`

### How To Reproduce
~~~Console
user@laptop:~$ scancode --license --copyright --json-pp uboot-test.json ./drivers/video/console_truetype.c
~~~

I have tested it also with the patches from https://github.com/nexB/scancode-toolkit/pull/3644, but it does not fix the issue.

### Logs
Log Snippet with `SCANCODE_DEBUG_LICENSE=True`:
~~~
LicenseMatch: 'cc-by-3.0', lines=(0, 0), matcher='3-seq', rid=cc-by-3.0_23.RULE, sc=54.55, cov=54.55, len=6, hilen=3, rlen=11, qreg=(87, 92), ireg=(1, 8)
...
LicenseMatch: 'cc-by-nc-sa-3.0', lines=(0, 0), matcher='3-seq', rid=cc-by-nc-sa-3.0_23.RULE, sc=54.55, cov=54.55, len=12, hilen=4, rlen=22, qreg=(85, 96), ireg=(3, 21)
...
LicenseMatch: 'cc-by-sa-3.0', lines=(0, 0), matcher='3-seq', rid=cc-by-sa-3.0_1.RULE, sc=100.0, cov=100.0, len=8, hilen=2, rlen=8, qreg=(88, 95), ireg=(0, 7)

...

matches before final merge: 2
matches before final merge MATCHED TEXTS
LicenseMatch: 'cc-by-nc-sa-3.0', lines=(43, 44), matcher='3-seq', rid=cc-by-nc-sa-3.0_23.RULE, sc=54.55, cov=54.55, len=12, hilen=4, rlen=22, qreg=(85, 96), ireg=(3, 21)
MATCHED QUERY TEXT: Creative Commons license *
http://creativecommons.org/licenses/by-sa/3.0/legalcode
MATCHED RULE TEXT: creative commons license <3> <0>
http creativecommons org licenses by sa 3 0 legalcode
LicenseMatch: 'gpl-2.0-plus', lines=(4, 4), matcher='1-spdx-id', rid=spdx-license-identifier-gpl_2_0_plus-6a7800b229dd3f061ec9f8deeaf5fc1cd1310d8d, sc=100.0, cov=100.0, len=6, hilen=3, rlen=6, qreg=(5, 10), ireg=(0, 5)
MATCHED QUERY TEXT: SPDX-License-Identifier: GPL-2.0+
MATCHED RULE TEXT: spdx license identifier gpl 2 0+
final matches: 2
final matches MATCHED TEXTS
LicenseMatch: 'gpl-2.0-plus', lines=(4, 4), matcher='1-spdx-id', rid=spdx-license-identifier-gpl_2_0_plus-6a7800b229dd3f061ec9f8deeaf5fc1cd1310d8d, sc=100.0, cov=100.0, len=6, hilen=3, rlen=6, qreg=(5, 10), ireg=(0, 5)
MATCHED QUERY TEXT: SPDX-License-Identifier: GPL-2.0+
MATCHED RULE TEXT: spdx license identifier gpl 2 0+
LicenseMatch: 'cc-by-nc-sa-3.0', lines=(43, 44), matcher='3-seq', rid=cc-by-nc-sa-3.0_23.RULE, sc=54.55, cov=54.55, len=12, hilen=4, rlen=22, qreg=(85, 96), ireg=(3, 21)
MATCHED QUERY TEXT: Creative Commons license *
http://creativecommons.org/licenses/by-sa/3.0/legalcode
MATCHED RULE TEXT: creative commons license <3> <0>
http creativecommons org licenses by sa 3 0 legalcode
~~~

How do I need to interpret the log output? Is the token `` of the URL optional here? Why is the match for `src/licensedcode/data/rules/cc-by-3.0_1.RULE` with 100% cov not considered?

### System configuration
* OS: Linux (openSUSE 15.5)
* scancode-toolkit version: 32.0.8
* Installation Method: pip and source from git

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。