aboutcode-org / aboutcode-org/scancode-toolkit

scancode can not find "license agreement" if there is not a comment with "code" in the file

Open
#4,538 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
2.6k
Forks
791
Avg merge
1d 12h
Merged PRs (30d)
5

Description

### Description

> I have a cuple of C-Header files from a third party library. We have a license agreement and I want to use ORT for documentation. Scancode detects some of the header files, as expected with a unknown license. Other files are not detected. In most of the files is exactly the same notice, similar to:
```
// ---------------------------------------------------------------------------
// Some produkt - (C) some company
// ---------------------------------------------------------------------------
// This software is supplied under the terms of a license agreement or
// nondisclosure agreement with MYSTERY BRAND and may not be copied or
// disclosed except in accordance with the terms of that agreement.
// ---------------------------------------------------------------------------
```
The files that were license_detection'ed match "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/license-intro_22.RULE"
The files not detected produce a license_clue for "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/proprietary-license_782.RULE"
I see some words matching the second one. It looks to me, as if 782 is overriding 22 and than it is thrown away because not enought words are matching. Just a guess... It tried to enable logging but I can't find my way to the failing line.
Funny think: If I put a comment line containing "code" somewhere in line 21 of one of the files it will be detected by rule 22 but i can not reproduce this with the example files.

### How To Reproduce

> I will attach a small example, with some files containing the notice and some dummy code.

scancode -clip --json-pp - ~/dummy/

### System configuration

> For bug reports, it really helps us to know:

* What OS are you running on? (Windows/MacOS/Linux)
ubuntu-jammy in a WSL on windows 11
* What version of scancode-toolkit was used to generate the scan file?
ScanCode version: 32.3.1
ScanCode Output Format version: 4.0.0
SPDX License list version: 3.25
* What installation method was used to install/run scancode? (pip/source download/other)
some custom steps as part of the toolchain we use. It works fine on many packages.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.