-
-
Notifications
You must be signed in to change notification settings - Fork 600
Open
Labels
Description
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
user@laptop:~$ scancode --license --copyright --json-pp uboot-test.json ./drivers/video/console_truetype.c
I have tested it also with the patches from #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 <attribution> <noncommercial> <sharealike> <3> <0>
<unported> http creativecommons org licenses by <nc> 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 <attribution> <noncommercial> <sharealike> <3> <0>
<unported> http creativecommons org licenses by <nc> sa 3 0 legalcode
How do I need to interpret the log output? Is the token <nc>
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