Skip to content

Commit 2713bfb

Browse files
update version, update help, disable dynamic ranges
1 parent 59a6a3f commit 2713bfb

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

inc/scanoss.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#define WFP_LN 4
3434
#define WFP_REC_LN 18
3535

36-
#define SCANOSS_VERSION "5.4.19"
36+
#define SCANOSS_VERSION "5.4.20"
3737

3838
/* Log files */
3939
#define SCAN_LOG "/tmp/scanoss_scan.log"

src/help.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ Configuration:\n\
5555
-T, --tolerance NUM Set snippet scanning tolerance percentage (default: 0.1).\n\
5656
-r, --rank NUM Set maximum component rank accepted (default: %d).\n\
5757
--max-files NUM Set maximum number of files to fetch during matching (default: 12000).\n\
58-
--min-match-hits NUM Set minimum snippet ID hits for a match (default: 3, disables auto-adjust).\n\
59-
--min-match-lines NUM Set minimum matched lines for a range (default: 10, disables auto-adjust).\n\
58+
--min-snippet-hits NUM Set minimum snippet ID hits for a match (default: 3, disables auto-adjust).\n\
59+
--min-snippet-lines NUM Set minimum matched lines for a range (default: 10, disables auto-adjust).\n\
6060
--range-tolerance NUM Set max non-matched lines tolerated in a range (default: 5).\n\
6161
--ignore-file-ext Ignore file extension during snippet matching (default: honor extension).\n\
6262
-s, --sbom FILE Include assets from a JSON SBOM file (CycloneDX/SPDX2.2 format) in identification.\n\
6363
-b, --blacklist FILE Exclude matches from assets listed in JSON SBOM file (CycloneDX/SPDX2.2 format).\n\
64-
--force-snippet FILE Same as \"-b\" but with forced snippet scanning.\n\
64+
--force-snippet Force snippet scanning (no full file matching).\n\
6565
-a, --attribution FILE Show attribution notices for the provided SBOM.json file.\n\
6666
-c, --component HINT Add a component HINT to guide scan results.\n\
6767
-k, --key KEY Show contents of the specified KEY file from MZ sources archive.\n\

src/snippet_selection.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void add_snippet_ids(match_data_t *match, char *snippet_ids, long from, long to)
242242
* @param scan[out] pointer to scan data
243243
* @return hits
244244
*/
245-
int ranges_assemble(matchmap_range *ranges, char *line_ranges, char *oss_ranges, int min_match_lines, int ranges_number)
245+
int ranges_assemble(matchmap_range *ranges, char *line_ranges, char *oss_ranges, int min_range_lines, int ranges_number)
246246
{
247247
int out = 0;
248248
/* Walk ranges */
@@ -257,7 +257,7 @@ int ranges_assemble(matchmap_range *ranges, char *line_ranges, char *oss_ranges,
257257
if (from == 0)
258258
from = 1;
259259
//discard snippets below the limit of detection
260-
if (to - from < min_match_lines)
260+
if (to - from < min_range_lines)
261261
continue;
262262
/* Add commas unless it is the first range */
263263
if (*line_ranges)
@@ -290,10 +290,11 @@ int range_comp(const void *a, const void *b)
290290
* @brief Join overlapping ranges
291291
* @param ranges ranges list to process
292292
*/
293-
matchmap_range * ranges_join_overlapping(matchmap_range *ranges, int size, int range_tolerance, bool fixed_ranges)
293+
matchmap_range * ranges_join_overlapping(matchmap_range *ranges, int size, int range_tolerance, bool dynamic_ranges)
294294
{
295295
int out_size = MATCHMAP_RANGES;
296-
if (fixed_ranges)
296+
dynamic_ranges = false; // TODO: disable dynamic ranges for now
297+
if (dynamic_ranges)
297298
out_size = size;
298299

299300
matchmap_range *out_ranges = calloc(out_size, sizeof(matchmap_range));
@@ -321,7 +322,7 @@ matchmap_range * ranges_join_overlapping(matchmap_range *ranges, int size, int r
321322
else
322323
{
323324
out_ranges_index++;
324-
if (out_ranges_index == MATCHMAP_RANGES && !fixed_ranges)
325+
if (out_ranges_index == MATCHMAP_RANGES && !dynamic_ranges)
325326
break;
326327
out_ranges[out_ranges_index].from = ranges[i].from;
327328
out_ranges[out_ranges_index].to = ranges[i].to;
@@ -330,7 +331,7 @@ matchmap_range * ranges_join_overlapping(matchmap_range *ranges, int size, int r
330331
processed++;
331332
}
332333
}
333-
if (fixed_ranges)
334+
if (dynamic_ranges)
334335
break;
335336
tolerance *= 2;
336337
}

0 commit comments

Comments
 (0)