From 1da6c0403f66ff1f8acc31eaf77ee462b9620176 Mon Sep 17 00:00:00 2001 From: Park Wonjae Date: Thu, 8 Oct 2026 14:27:54 +0900 Subject: [PATCH 1/3] feat(KB/SCANOSS): skip small files Signed-off-by: Park Wonjae --- src/fosslight_source/_exclude.py | 16 ++++++++++++- src/fosslight_source/_help.py | 3 +++ src/fosslight_source/_scan_item.py | 5 ++-- src/fosslight_source/cli.py | 36 +++++++++++++++++++++++------ src/fosslight_source/run_scanoss.py | 7 +++++- 5 files changed, 56 insertions(+), 11 deletions(-) diff --git a/src/fosslight_source/_exclude.py b/src/fosslight_source/_exclude.py index 830382f0..27081f2d 100644 --- a/src/fosslight_source/_exclude.py +++ b/src/fosslight_source/_exclude.py @@ -1,10 +1,14 @@ # Copyright (c) 2026 LG Electronics Inc. # SPDX-License-Identifier: Apache-2.0 -"""Source-scanner filename excludes (not applied to dependency discovery).""" +"""Source-scanner exclusion helpers (not applied to dependency discovery).""" + +import os from fosslight_util.exclude import is_excluded_filename +DEFAULT_SKIP_SMALL_FILE_SIZE = 150 + # Build/package config noise for license scans. EXCLUDE_FILENAME_SOURCE = frozenset({ "changelog", "config.guess", "config.sub", "changes", "ltmain.sh", @@ -19,3 +23,13 @@ def is_excluded_source_filename(file_path: str) -> bool: return is_excluded_filename(file_path, EXCLUDE_FILENAME_SOURCE) + + +def is_file_size_at_most(file_path: str, size_limit: int) -> bool: + """Return whether a file is at or below a positive size limit.""" + if size_limit <= 0: + return False + try: + return os.path.getsize(file_path) <= size_limit + except OSError: + return False diff --git a/src/fosslight_source/_help.py b/src/fosslight_source/_help.py index cd8844bf..ed59f7bc 100644 --- a/src/fosslight_source/_help.py +++ b/src/fosslight_source/_help.py @@ -47,6 +47,9 @@ --kb_token KB bearer token (priority: parameter > KB_TOKEN env) HTTPS uses the OS certificate store. Set KB_SSL_VERIFY=false only if certificate verification must be skipped. + --skip-small-file-size + Skip files at or below this size for KB and SCANOSS + (default: 150; use 0 to disable) 💡 Examples ──────────────────────────────────────────────────────────────────── diff --git a/src/fosslight_source/_scan_item.py b/src/fosslight_source/_scan_item.py index c0dce538..33b42f70 100644 --- a/src/fosslight_source/_scan_item.py +++ b/src/fosslight_source/_scan_item.py @@ -63,7 +63,7 @@ def __init__(self, value: str) -> None: self.checksum = get_checksum_sha1(value) self.kb_origin_url = "" # URL from OSS KB self.kb_evidence = "" # Evidence from KB API (exact_match or code snippet) - self._cached_kb_md5 = "" # MD5 precomputed for KB lookup (set by _collect_kb_file_hashes) + self._cached_kb_md5: str | None = None # None: not checked; empty: checked but no KB hash def __del__(self) -> None: pass @@ -192,8 +192,9 @@ def set_oss_item( item = OssItem(self.oss_name, self.oss_version, self.licenses) if kb_origin_urls and not self.is_license_text: md5_hash = self._cached_kb_md5 - if not md5_hash: + if md5_hash is None: md5_hash, _wfp = self._get_hash(path_to_scan) + self._cached_kb_md5 = md5_hash if md5_hash: origin_url = kb_origin_urls.get(md5_hash, "") if origin_url: diff --git a/src/fosslight_source/cli.py b/src/fosslight_source/cli.py index 3d1d7784..b6d10b2f 100755 --- a/src/fosslight_source/cli.py +++ b/src/fosslight_source/cli.py @@ -22,7 +22,12 @@ from fosslight_util.parsing_yaml import SUPPORT_OSS_INFO_FILES from .run_scancode import run_scan from fosslight_util.exclude import get_excluded_paths -from ._exclude import EXCLUDE_FILENAME_SOURCE, is_excluded_source_filename +from ._exclude import ( + DEFAULT_SKIP_SMALL_FILE_SIZE, + EXCLUDE_FILENAME_SOURCE, + is_excluded_source_filename, + is_file_size_at_most, +) from .run_scanoss import run_scanoss_py from .run_scanoss import get_scanoss_extra_info import yaml @@ -89,11 +94,11 @@ def main() -> None: parser.add_argument('--hide_progress', action='store_true', required=False) parser.add_argument('--kb_url', type=str, required=False, default="") parser.add_argument('--kb_token', type=str, required=False, default="") + parser.add_argument('--skip-small-file-size', type=int, default=DEFAULT_SKIP_SMALL_FILE_SIZE) parser.add_argument('--no_merge', action='store_true', required=False) parser.add_argument('--ui', action='store_true', required=False) args = parser.parse_args() - if args.help: print_help_msg_source_scanner() if args.version: @@ -118,6 +123,8 @@ def main() -> None: correct_filepath = path_to_scan if args.correct_fpath: correct_filepath = ''.join(args.correct_fpath) + if args.skip_small_file_size < 0: + parser.error('--skip-small-file-size must be zero or greater') hide_progress = args.hide_progress kb_url = args.kb_url kb_token = args.kb_token @@ -132,7 +139,8 @@ def main() -> None: print_matched_text, formats, time_out, correct_mode, correct_filepath, selected_scanner, path_to_exclude, hide_progress=hide_progress, kb_url=kb_url, kb_token=kb_token, - merge_by_folder=merge_by_folder, ui_mode=ui_mode) + merge_by_folder=merge_by_folder, ui_mode=ui_mode, + skip_small_file_size=args.skip_small_file_size) _result_log["Scan Result"] = result[1] try: @@ -352,6 +360,7 @@ def _collect_kb_file_hashes( path_to_scan: str, excluded_files: set, hide_progress: bool, + skip_small_file_size: int = DEFAULT_SKIP_SMALL_FILE_SIZE, ) -> tuple[list[str], list[tuple[SourceItem, str]]]: """Collect MD5 hashes from scancode results and walk targets, plus (extra_item, md5) candidates. @@ -362,6 +371,13 @@ def _collect_kb_file_hashes( extra_candidates: list[tuple[SourceItem, str]] = [] for item in scancode_result: + item_path = item.source_name_or_path + if not os.path.isabs(item_path): + item_path = os.path.join(path_to_scan, item_path) + if is_file_size_at_most(item_path, skip_small_file_size): + # An empty cached hash means this item is checked and not KB-eligible. + item._cached_kb_md5 = "" + continue if item.is_license_text or is_notice_file(item.source_name_or_path): continue if item.download_location: @@ -384,6 +400,8 @@ def _collect_kb_file_hashes( if (rel_path in scancode_paths or rel_path in excluded_files or is_excluded_source_filename(rel_path) or is_notice_file(file_path)): continue + if is_file_size_at_most(file_path, skip_small_file_size): + continue extra_item = SourceItem(rel_path) md5_hash, _wfp = extra_item._get_hash(path_to_scan) if md5_hash: @@ -398,7 +416,7 @@ def merge_results( scancode_result: list = [], scanoss_result: list = [], spdx_downloads: dict = {}, path_to_scan: str = "", run_kb: bool = False, manifest_licenses: dict = {}, excluded_files: set = None, hide_progress: bool = False, kb_url: str = "", kb_token: str = "", - ui_mode: bool = False + ui_mode: bool = False, skip_small_file_size: int = DEFAULT_SKIP_SMALL_FILE_SIZE ) -> tuple[list, Optional[str], int, int]: """ @@ -420,6 +438,7 @@ def merge_results( :param kb_url: KB API base URL. :param kb_token: KB API bearer token. :param ui_mode: if False, drop items with no download location and no license. + :param skip_small_file_size: maximum file size skipped for KB; 0 disables this filter. :return: (merged_result, kb failure message, requested file_hash count, returned match count). """ if excluded_files is None: @@ -479,7 +498,7 @@ def merge_results( extra_candidates: list[tuple[SourceItem, str]] = [] if run_kb: file_hashes, extra_candidates = _collect_kb_file_hashes( - scancode_result, path_to_scan, excluded_files, hide_progress + scancode_result, path_to_scan, excluded_files, hide_progress, skip_small_file_size ) if file_hashes: kb_result = fetch_origin_urls_via_scan_job(file_hashes, kb_url, kb_token) @@ -568,7 +587,7 @@ def run_scanners( selected_scanner: str = ALL_MODE, path_to_exclude: list = [], all_exclude_mode: tuple = (), hide_progress: bool = False, kb_url: str = "", kb_token: str = "", merge_by_folder: bool = True, - ui_mode: bool = False + ui_mode: bool = False, skip_small_file_size: int = DEFAULT_SKIP_SMALL_FILE_SIZE ) -> Tuple[bool, str, 'ScannerItem', list, list]: """ Run Scancode and scanoss.py for the given path. @@ -582,6 +601,7 @@ def run_scanners( :param format: output format (excel, csv, opossum). :param kb_url: KB API base URL. If empty, read KB_URL environment variable, then use default. :param kb_token: KB API bearer token. If empty, read KB_TOKEN environment variable. + :param skip_small_file_size: Skip files at or below this size for KB and SCANOSS; 0 disables. :return success: success or failure of scancode. :return result_log["Scan Result"]: :return merged_result: merged scan result of scancode and scanoss. @@ -657,7 +677,8 @@ def run_scanners( scanoss_result, scanoss_skipped = run_scanoss_py( path_to_scan, output_path, formats, True, num_cores, excluded_path_with_default_exclusion, excluded_files, - write_json_file, hide_progress, timeout=time_out + write_json_file, hide_progress, timeout=time_out, + skip_small_file_size=skip_small_file_size, ) run_kb_msg = "" @@ -674,6 +695,7 @@ def run_scanners( path_to_scan, run_kb, manifest_licenses, excluded_files, hide_progress, kb_url, kb_token, ui_mode=ui_mode, + skip_small_file_size=skip_small_file_size, ) if kb_status_message: run_kb_msg = f"KB({kb_url}) {kb_status_message}" diff --git a/src/fosslight_source/run_scanoss.py b/src/fosslight_source/run_scanoss.py index 51b0b99a..f3626d9d 100755 --- a/src/fosslight_source/run_scanoss.py +++ b/src/fosslight_source/run_scanoss.py @@ -10,6 +10,7 @@ import json from typing import Tuple import fosslight_util.constant as constant +from ._exclude import DEFAULT_SKIP_SMALL_FILE_SIZE from ._parsing_scanoss_file import parsing_scan_result # scanoss from ._parsing_scanoss_file import parsing_extra_info # scanoss from scanoss.scanner import Scanner, ScanType @@ -32,7 +33,8 @@ def run_scanoss_py(path_to_scan: str, output_path: str = "", format: list = [], called_by_cli: bool = False, num_threads: int = -1, path_to_exclude: list = [], excluded_files: set = None, write_json_file: bool = False, hide_progress: bool = False, - timeout: int = 120) -> Tuple[list, bool]: + timeout: int = 120, + skip_small_file_size: int = DEFAULT_SKIP_SMALL_FILE_SIZE) -> Tuple[list, bool]: """ Run scanoss.py for the given path. @@ -42,6 +44,7 @@ def run_scanoss_py(path_to_scan: str, output_path: str = "", format: list = [], :param called_by_cli: if not called by cli, initialize logger. :param write_json_file: if requested, keep the raw files. :param timeout: timeout in seconds for SCANOSS API request. + :param skip_small_file_size: Skip files at or below this size; 0 disables the additional size filter. :return scanoss_file_list: list of ScanItem (scanned result by files). """ @@ -70,6 +73,8 @@ def run_scanoss_py(path_to_scan: str, output_path: str = "", format: list = [], scan_options=ScanType.SCAN_SNIPPETS.value, nb_threads=num_threads if num_threads > 0 else 10, scanoss_settings=scanoss_settings, + # SCANOSS treats skip_size as the inclusive minimum accepted size. + skip_size=skip_small_file_size + 1 if skip_small_file_size > 0 else 0, timeout=timeout, retry=0 ) From 40960e9b186e0c8bee0443c55537c4d67228bd51 Mon Sep 17 00:00:00 2001 From: Park Wonjae Date: Thu, 8 Oct 2026 16:12:20 +0900 Subject: [PATCH 2/3] fix(KB/SCANOSS): remove option for small file Signed-off-by: Park Wonjae --- src/fosslight_source/_exclude.py | 8 +++----- src/fosslight_source/_help.py | 4 ---- src/fosslight_source/cli.py | 30 ++++++++--------------------- src/fosslight_source/run_scanoss.py | 11 ++++++----- 4 files changed, 17 insertions(+), 36 deletions(-) diff --git a/src/fosslight_source/_exclude.py b/src/fosslight_source/_exclude.py index 27081f2d..cb05fcf3 100644 --- a/src/fosslight_source/_exclude.py +++ b/src/fosslight_source/_exclude.py @@ -25,11 +25,9 @@ def is_excluded_source_filename(file_path: str) -> bool: return is_excluded_filename(file_path, EXCLUDE_FILENAME_SOURCE) -def is_file_size_at_most(file_path: str, size_limit: int) -> bool: - """Return whether a file is at or below a positive size limit.""" - if size_limit <= 0: - return False +def is_small_file(file_path: str) -> bool: + """Return whether a file is at or below the KB/SCANOSS size threshold.""" try: - return os.path.getsize(file_path) <= size_limit + return os.path.getsize(file_path) <= DEFAULT_SKIP_SMALL_FILE_SIZE except OSError: return False diff --git a/src/fosslight_source/_help.py b/src/fosslight_source/_help.py index ed59f7bc..0051bf79 100644 --- a/src/fosslight_source/_help.py +++ b/src/fosslight_source/_help.py @@ -47,10 +47,6 @@ --kb_token KB bearer token (priority: parameter > KB_TOKEN env) HTTPS uses the OS certificate store. Set KB_SSL_VERIFY=false only if certificate verification must be skipped. - --skip-small-file-size - Skip files at or below this size for KB and SCANOSS - (default: 150; use 0 to disable) - 💡 Examples ──────────────────────────────────────────────────────────────────── # Scan current directory diff --git a/src/fosslight_source/cli.py b/src/fosslight_source/cli.py index b6d10b2f..58f1fb21 100755 --- a/src/fosslight_source/cli.py +++ b/src/fosslight_source/cli.py @@ -22,12 +22,7 @@ from fosslight_util.parsing_yaml import SUPPORT_OSS_INFO_FILES from .run_scancode import run_scan from fosslight_util.exclude import get_excluded_paths -from ._exclude import ( - DEFAULT_SKIP_SMALL_FILE_SIZE, - EXCLUDE_FILENAME_SOURCE, - is_excluded_source_filename, - is_file_size_at_most, -) +from ._exclude import EXCLUDE_FILENAME_SOURCE, is_excluded_source_filename, is_small_file from .run_scanoss import run_scanoss_py from .run_scanoss import get_scanoss_extra_info import yaml @@ -94,7 +89,6 @@ def main() -> None: parser.add_argument('--hide_progress', action='store_true', required=False) parser.add_argument('--kb_url', type=str, required=False, default="") parser.add_argument('--kb_token', type=str, required=False, default="") - parser.add_argument('--skip-small-file-size', type=int, default=DEFAULT_SKIP_SMALL_FILE_SIZE) parser.add_argument('--no_merge', action='store_true', required=False) parser.add_argument('--ui', action='store_true', required=False) @@ -123,8 +117,6 @@ def main() -> None: correct_filepath = path_to_scan if args.correct_fpath: correct_filepath = ''.join(args.correct_fpath) - if args.skip_small_file_size < 0: - parser.error('--skip-small-file-size must be zero or greater') hide_progress = args.hide_progress kb_url = args.kb_url kb_token = args.kb_token @@ -139,8 +131,7 @@ def main() -> None: print_matched_text, formats, time_out, correct_mode, correct_filepath, selected_scanner, path_to_exclude, hide_progress=hide_progress, kb_url=kb_url, kb_token=kb_token, - merge_by_folder=merge_by_folder, ui_mode=ui_mode, - skip_small_file_size=args.skip_small_file_size) + merge_by_folder=merge_by_folder, ui_mode=ui_mode) _result_log["Scan Result"] = result[1] try: @@ -360,7 +351,6 @@ def _collect_kb_file_hashes( path_to_scan: str, excluded_files: set, hide_progress: bool, - skip_small_file_size: int = DEFAULT_SKIP_SMALL_FILE_SIZE, ) -> tuple[list[str], list[tuple[SourceItem, str]]]: """Collect MD5 hashes from scancode results and walk targets, plus (extra_item, md5) candidates. @@ -374,7 +364,7 @@ def _collect_kb_file_hashes( item_path = item.source_name_or_path if not os.path.isabs(item_path): item_path = os.path.join(path_to_scan, item_path) - if is_file_size_at_most(item_path, skip_small_file_size): + if is_small_file(item_path): # An empty cached hash means this item is checked and not KB-eligible. item._cached_kb_md5 = "" continue @@ -400,7 +390,7 @@ def _collect_kb_file_hashes( if (rel_path in scancode_paths or rel_path in excluded_files or is_excluded_source_filename(rel_path) or is_notice_file(file_path)): continue - if is_file_size_at_most(file_path, skip_small_file_size): + if is_small_file(file_path): continue extra_item = SourceItem(rel_path) md5_hash, _wfp = extra_item._get_hash(path_to_scan) @@ -416,7 +406,7 @@ def merge_results( scancode_result: list = [], scanoss_result: list = [], spdx_downloads: dict = {}, path_to_scan: str = "", run_kb: bool = False, manifest_licenses: dict = {}, excluded_files: set = None, hide_progress: bool = False, kb_url: str = "", kb_token: str = "", - ui_mode: bool = False, skip_small_file_size: int = DEFAULT_SKIP_SMALL_FILE_SIZE + ui_mode: bool = False ) -> tuple[list, Optional[str], int, int]: """ @@ -438,7 +428,6 @@ def merge_results( :param kb_url: KB API base URL. :param kb_token: KB API bearer token. :param ui_mode: if False, drop items with no download location and no license. - :param skip_small_file_size: maximum file size skipped for KB; 0 disables this filter. :return: (merged_result, kb failure message, requested file_hash count, returned match count). """ if excluded_files is None: @@ -498,7 +487,7 @@ def merge_results( extra_candidates: list[tuple[SourceItem, str]] = [] if run_kb: file_hashes, extra_candidates = _collect_kb_file_hashes( - scancode_result, path_to_scan, excluded_files, hide_progress, skip_small_file_size + scancode_result, path_to_scan, excluded_files, hide_progress ) if file_hashes: kb_result = fetch_origin_urls_via_scan_job(file_hashes, kb_url, kb_token) @@ -587,7 +576,7 @@ def run_scanners( selected_scanner: str = ALL_MODE, path_to_exclude: list = [], all_exclude_mode: tuple = (), hide_progress: bool = False, kb_url: str = "", kb_token: str = "", merge_by_folder: bool = True, - ui_mode: bool = False, skip_small_file_size: int = DEFAULT_SKIP_SMALL_FILE_SIZE + ui_mode: bool = False ) -> Tuple[bool, str, 'ScannerItem', list, list]: """ Run Scancode and scanoss.py for the given path. @@ -601,7 +590,6 @@ def run_scanners( :param format: output format (excel, csv, opossum). :param kb_url: KB API base URL. If empty, read KB_URL environment variable, then use default. :param kb_token: KB API bearer token. If empty, read KB_TOKEN environment variable. - :param skip_small_file_size: Skip files at or below this size for KB and SCANOSS; 0 disables. :return success: success or failure of scancode. :return result_log["Scan Result"]: :return merged_result: merged scan result of scancode and scanoss. @@ -677,8 +665,7 @@ def run_scanners( scanoss_result, scanoss_skipped = run_scanoss_py( path_to_scan, output_path, formats, True, num_cores, excluded_path_with_default_exclusion, excluded_files, - write_json_file, hide_progress, timeout=time_out, - skip_small_file_size=skip_small_file_size, + write_json_file, hide_progress, timeout=time_out ) run_kb_msg = "" @@ -695,7 +682,6 @@ def run_scanners( path_to_scan, run_kb, manifest_licenses, excluded_files, hide_progress, kb_url, kb_token, ui_mode=ui_mode, - skip_small_file_size=skip_small_file_size, ) if kb_status_message: run_kb_msg = f"KB({kb_url}) {kb_status_message}" diff --git a/src/fosslight_source/run_scanoss.py b/src/fosslight_source/run_scanoss.py index f3626d9d..c616e5bd 100755 --- a/src/fosslight_source/run_scanoss.py +++ b/src/fosslight_source/run_scanoss.py @@ -33,8 +33,7 @@ def run_scanoss_py(path_to_scan: str, output_path: str = "", format: list = [], called_by_cli: bool = False, num_threads: int = -1, path_to_exclude: list = [], excluded_files: set = None, write_json_file: bool = False, hide_progress: bool = False, - timeout: int = 120, - skip_small_file_size: int = DEFAULT_SKIP_SMALL_FILE_SIZE) -> Tuple[list, bool]: + timeout: int = 120) -> Tuple[list, bool]: """ Run scanoss.py for the given path. @@ -44,7 +43,6 @@ def run_scanoss_py(path_to_scan: str, output_path: str = "", format: list = [], :param called_by_cli: if not called by cli, initialize logger. :param write_json_file: if requested, keep the raw files. :param timeout: timeout in seconds for SCANOSS API request. - :param skip_small_file_size: Skip files at or below this size; 0 disables the additional size filter. :return scanoss_file_list: list of ScanItem (scanned result by files). """ @@ -66,6 +64,11 @@ def run_scanoss_py(path_to_scan: str, output_path: str = "", format: list = [], try: logger.debug(f"|---Running SCANOSS on {path_to_scan}") scanoss_settings = ScanossSettings() + scanoss_settings.data = { + "settings": {"skip": {"sizes": {"scanning": [ + {"patterns": ["**"], "min": DEFAULT_SKIP_SMALL_FILE_SIZE + 1} + ]}}} + } scanner = Scanner( ignore_cert_errors=True, skip_folders=list(path_to_exclude) if path_to_exclude else [], @@ -73,8 +76,6 @@ def run_scanoss_py(path_to_scan: str, output_path: str = "", format: list = [], scan_options=ScanType.SCAN_SNIPPETS.value, nb_threads=num_threads if num_threads > 0 else 10, scanoss_settings=scanoss_settings, - # SCANOSS treats skip_size as the inclusive minimum accepted size. - skip_size=skip_small_file_size + 1 if skip_small_file_size > 0 else 0, timeout=timeout, retry=0 ) From f2ad8e8283dc191a3f872e80b4c61c2c52cf1f94 Mon Sep 17 00:00:00 2001 From: Soim Kim Date: Mon, 12 Oct 2026 07:41:34 +0900 Subject: [PATCH 3/3] perf(KB/SCANOSS): simplify small-file filtering Use SCANOSS skip_size instead of per-file size patterns. Skip known KB exclusions before checking file sizes and cache their ineligible state to avoid fallback hashing. Signed-off-by: Soim Kim --- src/fosslight_source/cli.py | 7 +++---- src/fosslight_source/run_scanoss.py | 6 +----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/fosslight_source/cli.py b/src/fosslight_source/cli.py index 58f1fb21..00b64a64 100755 --- a/src/fosslight_source/cli.py +++ b/src/fosslight_source/cli.py @@ -361,6 +361,9 @@ def _collect_kb_file_hashes( extra_candidates: list[tuple[SourceItem, str]] = [] for item in scancode_result: + if item.is_license_text or item.download_location or is_notice_file(item.source_name_or_path): + item._cached_kb_md5 = "" + continue item_path = item.source_name_or_path if not os.path.isabs(item_path): item_path = os.path.join(path_to_scan, item_path) @@ -368,10 +371,6 @@ def _collect_kb_file_hashes( # An empty cached hash means this item is checked and not KB-eligible. item._cached_kb_md5 = "" continue - if item.is_license_text or is_notice_file(item.source_name_or_path): - continue - if item.download_location: - continue md5_hash, _wfp = item._get_hash(path_to_scan) if md5_hash: item._cached_kb_md5 = md5_hash diff --git a/src/fosslight_source/run_scanoss.py b/src/fosslight_source/run_scanoss.py index c616e5bd..4217286a 100755 --- a/src/fosslight_source/run_scanoss.py +++ b/src/fosslight_source/run_scanoss.py @@ -64,14 +64,10 @@ def run_scanoss_py(path_to_scan: str, output_path: str = "", format: list = [], try: logger.debug(f"|---Running SCANOSS on {path_to_scan}") scanoss_settings = ScanossSettings() - scanoss_settings.data = { - "settings": {"skip": {"sizes": {"scanning": [ - {"patterns": ["**"], "min": DEFAULT_SKIP_SMALL_FILE_SIZE + 1} - ]}}} - } scanner = Scanner( ignore_cert_errors=True, skip_folders=list(path_to_exclude) if path_to_exclude else [], + skip_size=DEFAULT_SKIP_SMALL_FILE_SIZE + 1, scan_output=output_json_file, scan_options=ScanType.SCAN_SNIPPETS.value, nb_threads=num_threads if num_threads > 0 else 10,