Commit 4251995
committed
#267 Remove memory leak in license detection match merging
* Do not carry line_by_pos mapping in matches. Instead only inject
start and end line in matches at the end using the query line_by_pos
mapping kept only globally and not on a per-match basis.
This was the source of a major memory leak when license matches were
being updated and combined during a merge() run.
* Use a list-based mapping for line_by_pos instead of a dic for smaller
memory footprint.
* Use slots for QueryRun attributes for smaller memory footprint
* Replace "solid" attribute for Rules with a minimum_score that a match
to a rule must equal or exceed. solid is now minimum_score: 100. Use
this in other rules with various minimu score as needed.
* Remove remaining references to "gaps".
* Fix incorrect Rule thresholds computation for minimum lengths.
* Do not use license matches cache for now (the sqlite-backed
diskcache-based implementation is the source of major slowdown).
* Various minor cleanup and updates on rules, licenses and their
corresponding tests.
* New batch of frequent tokens for license detection.
* Add new tests contributed by @yahalom5776
* Add new license match filter for matches to a whole rule made of a
single token that is surrounded by unknown or single letter tokens
such as in "a b c d e GPL 1 2 3 4" to discard some false positive
(in this case for a GPL). This required to add tracking of query
tokens made on a single character.
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>1 parent 8d54e50 commit 4251995
137 files changed
Lines changed: 1141 additions & 425 deletions
File tree
- src
- licensedcode
- data
- licenses
- rules
- scancode
- tests/licensedcode
- data
- index
- licenses
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
1 | 8 | | |
2 | 9 | | |
3 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 3 | | |
10 | 4 | | |
11 | 5 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
0 commit comments