scanoss 1.35.0__py3-none-any.whl → 1.36.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scanoss/__init__.py +1 -1
- scanoss/api/common/v2/scanoss_common_pb2_grpc.py +1 -0
- scanoss/cli.py +34 -0
- scanoss/constants.py +4 -1
- scanoss/data/build_date.txt +1 -1
- scanoss/file_filters.py +1 -158
- scanoss/scanners/folder_hasher.py +23 -9
- scanoss/scanners/scanner_hfh.py +22 -6
- {scanoss-1.35.0.dist-info → scanoss-1.36.0.dist-info}/METADATA +1 -1
- {scanoss-1.35.0.dist-info → scanoss-1.36.0.dist-info}/RECORD +14 -14
- {scanoss-1.35.0.dist-info → scanoss-1.36.0.dist-info}/WHEEL +0 -0
- {scanoss-1.35.0.dist-info → scanoss-1.36.0.dist-info}/entry_points.txt +0 -0
- {scanoss-1.35.0.dist-info → scanoss-1.36.0.dist-info}/licenses/LICENSE +0 -0
- {scanoss-1.35.0.dist-info → scanoss-1.36.0.dist-info}/top_level.txt +0 -0
scanoss/__init__.py
CHANGED
scanoss/cli.py
CHANGED
|
@@ -59,7 +59,10 @@ from . import __version__
|
|
|
59
59
|
from .components import Components
|
|
60
60
|
from .constants import (
|
|
61
61
|
DEFAULT_API_TIMEOUT,
|
|
62
|
+
DEFAULT_HFH_DEPTH,
|
|
63
|
+
DEFAULT_HFH_MIN_ACCEPTED_SCORE,
|
|
62
64
|
DEFAULT_HFH_RANK_THRESHOLD,
|
|
65
|
+
DEFAULT_HFH_RECURSIVE_THRESHOLD,
|
|
63
66
|
DEFAULT_POST_SIZE,
|
|
64
67
|
DEFAULT_RETRY,
|
|
65
68
|
DEFAULT_TIMEOUT,
|
|
@@ -869,6 +872,27 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915
|
|
|
869
872
|
help='Filter results to only show those with rank value at or below this threshold (e.g., --rank-threshold 3 '
|
|
870
873
|
'returns results with rank 1, 2, or 3). Lower rank values indicate higher quality matches.',
|
|
871
874
|
)
|
|
875
|
+
p_folder_scan.add_argument(
|
|
876
|
+
'--depth',
|
|
877
|
+
type=int,
|
|
878
|
+
default=DEFAULT_HFH_DEPTH,
|
|
879
|
+
help=f'Defines how deep to scan the root directory (optional - default {DEFAULT_HFH_DEPTH})',
|
|
880
|
+
)
|
|
881
|
+
p_folder_scan.add_argument(
|
|
882
|
+
'--recursive-threshold',
|
|
883
|
+
type=float,
|
|
884
|
+
default=DEFAULT_HFH_RECURSIVE_THRESHOLD,
|
|
885
|
+
help=f'Minimum score threshold to consider a match (optional - default: {DEFAULT_HFH_RECURSIVE_THRESHOLD})',
|
|
886
|
+
)
|
|
887
|
+
p_folder_scan.add_argument(
|
|
888
|
+
'--min-accepted-score',
|
|
889
|
+
type=float,
|
|
890
|
+
default=DEFAULT_HFH_MIN_ACCEPTED_SCORE,
|
|
891
|
+
help=(
|
|
892
|
+
'Only show results with a score at or above this threshold '
|
|
893
|
+
f'(optional - default: {DEFAULT_HFH_MIN_ACCEPTED_SCORE})'
|
|
894
|
+
),
|
|
895
|
+
)
|
|
872
896
|
p_folder_scan.set_defaults(func=folder_hashing_scan)
|
|
873
897
|
|
|
874
898
|
# Sub-command: folder-hash
|
|
@@ -887,6 +911,12 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915
|
|
|
887
911
|
default='json',
|
|
888
912
|
help='Result output format (optional - default: json)',
|
|
889
913
|
)
|
|
914
|
+
p_folder_hash.add_argument(
|
|
915
|
+
'--depth',
|
|
916
|
+
type=int,
|
|
917
|
+
default=DEFAULT_HFH_DEPTH,
|
|
918
|
+
help=f'Defines how deep to hash the root directory (optional - default {DEFAULT_HFH_DEPTH})',
|
|
919
|
+
)
|
|
890
920
|
p_folder_hash.set_defaults(func=folder_hash)
|
|
891
921
|
|
|
892
922
|
# Output options
|
|
@@ -2456,6 +2486,9 @@ def folder_hashing_scan(parser, args):
|
|
|
2456
2486
|
client=client,
|
|
2457
2487
|
scanoss_settings=scanoss_settings,
|
|
2458
2488
|
rank_threshold=args.rank_threshold,
|
|
2489
|
+
depth=args.depth,
|
|
2490
|
+
recursive_threshold=args.recursive_threshold,
|
|
2491
|
+
min_accepted_score=args.min_accepted_score,
|
|
2459
2492
|
)
|
|
2460
2493
|
|
|
2461
2494
|
if scanner.scan():
|
|
@@ -2489,6 +2522,7 @@ def folder_hash(parser, args):
|
|
|
2489
2522
|
scan_dir=args.scan_dir,
|
|
2490
2523
|
config=folder_hasher_config,
|
|
2491
2524
|
scanoss_settings=scanoss_settings,
|
|
2525
|
+
depth=args.depth,
|
|
2492
2526
|
)
|
|
2493
2527
|
|
|
2494
2528
|
folder_hasher.hash_directory(args.scan_dir)
|
scanoss/constants.py
CHANGED
|
@@ -13,4 +13,7 @@ DEFAULT_URL2 = 'https://api.scanoss.com' # default premium service URL
|
|
|
13
13
|
|
|
14
14
|
DEFAULT_API_TIMEOUT = 600
|
|
15
15
|
|
|
16
|
-
DEFAULT_HFH_RANK_THRESHOLD = 5
|
|
16
|
+
DEFAULT_HFH_RANK_THRESHOLD = 5
|
|
17
|
+
DEFAULT_HFH_DEPTH = 1
|
|
18
|
+
DEFAULT_HFH_RECURSIVE_THRESHOLD = 0.8
|
|
19
|
+
DEFAULT_HFH_MIN_ACCEPTED_SCORE = 0.15
|
scanoss/data/build_date.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
date:
|
|
1
|
+
date: 20251013130805, utime: 1760360885
|
scanoss/file_filters.py
CHANGED
|
@@ -269,162 +269,6 @@ DEFAULT_SKIPPED_EXT = {
|
|
|
269
269
|
'sqlite3',
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
# TODO: For hfh add the .gitignore patterns
|
|
273
|
-
DEFAULT_SKIPPED_EXT_HFH = {
|
|
274
|
-
'.1',
|
|
275
|
-
'.2',
|
|
276
|
-
'.3',
|
|
277
|
-
'.4',
|
|
278
|
-
'.5',
|
|
279
|
-
'.6',
|
|
280
|
-
'.7',
|
|
281
|
-
'.8',
|
|
282
|
-
'.9',
|
|
283
|
-
'.ac',
|
|
284
|
-
'.adoc',
|
|
285
|
-
'.am',
|
|
286
|
-
'.asciidoc',
|
|
287
|
-
'.bmp',
|
|
288
|
-
'.build',
|
|
289
|
-
'.cfg',
|
|
290
|
-
'.chm',
|
|
291
|
-
'.class',
|
|
292
|
-
'.cmake',
|
|
293
|
-
'.cnf',
|
|
294
|
-
'.conf',
|
|
295
|
-
'.config',
|
|
296
|
-
'.contributors',
|
|
297
|
-
'.copying',
|
|
298
|
-
'.crt',
|
|
299
|
-
'.csproj',
|
|
300
|
-
'.css',
|
|
301
|
-
'.csv',
|
|
302
|
-
'.dat',
|
|
303
|
-
'.data',
|
|
304
|
-
'.dtd',
|
|
305
|
-
'.dts',
|
|
306
|
-
'.iws',
|
|
307
|
-
'.c9',
|
|
308
|
-
'.c9revisions',
|
|
309
|
-
'.dtsi',
|
|
310
|
-
'.dump',
|
|
311
|
-
'.eot',
|
|
312
|
-
'.eps',
|
|
313
|
-
'.geojson',
|
|
314
|
-
'.gif',
|
|
315
|
-
'.glif',
|
|
316
|
-
'.gmo',
|
|
317
|
-
'.guess',
|
|
318
|
-
'.hex',
|
|
319
|
-
'.htm',
|
|
320
|
-
'.html',
|
|
321
|
-
'.ico',
|
|
322
|
-
'.iml',
|
|
323
|
-
'.in',
|
|
324
|
-
'.inc',
|
|
325
|
-
'.info',
|
|
326
|
-
'.ini',
|
|
327
|
-
'.ipynb',
|
|
328
|
-
'.jpeg',
|
|
329
|
-
'.jpg',
|
|
330
|
-
'.json',
|
|
331
|
-
'.jsonld',
|
|
332
|
-
'.lock',
|
|
333
|
-
'.log',
|
|
334
|
-
'.m4',
|
|
335
|
-
'.map',
|
|
336
|
-
'.md5',
|
|
337
|
-
'.meta',
|
|
338
|
-
'.mk',
|
|
339
|
-
'.mxml',
|
|
340
|
-
'.o',
|
|
341
|
-
'.otf',
|
|
342
|
-
'.out',
|
|
343
|
-
'.pbtxt',
|
|
344
|
-
'.pdf',
|
|
345
|
-
'.pem',
|
|
346
|
-
'.phtml',
|
|
347
|
-
'.plist',
|
|
348
|
-
'.png',
|
|
349
|
-
'.prefs',
|
|
350
|
-
'.properties',
|
|
351
|
-
'.pyc',
|
|
352
|
-
'.qdoc',
|
|
353
|
-
'.result',
|
|
354
|
-
'.rgb',
|
|
355
|
-
'.rst',
|
|
356
|
-
'.scss',
|
|
357
|
-
'.sha',
|
|
358
|
-
'.sha1',
|
|
359
|
-
'.sha2',
|
|
360
|
-
'.sha256',
|
|
361
|
-
'.sln',
|
|
362
|
-
'.spec',
|
|
363
|
-
'.sub',
|
|
364
|
-
'.svg',
|
|
365
|
-
'.svn-base',
|
|
366
|
-
'.tab',
|
|
367
|
-
'.template',
|
|
368
|
-
'.test',
|
|
369
|
-
'.tex',
|
|
370
|
-
'.tiff',
|
|
371
|
-
'.ttf',
|
|
372
|
-
'.txt',
|
|
373
|
-
'.utf-8',
|
|
374
|
-
'.vim',
|
|
375
|
-
'.wav',
|
|
376
|
-
'.woff',
|
|
377
|
-
'.woff2',
|
|
378
|
-
'.xht',
|
|
379
|
-
'.xhtml',
|
|
380
|
-
'.xml',
|
|
381
|
-
'.xpm',
|
|
382
|
-
'.xsd',
|
|
383
|
-
'.xul',
|
|
384
|
-
'.yaml',
|
|
385
|
-
'.yml',
|
|
386
|
-
'.wfp',
|
|
387
|
-
'.editorconfig',
|
|
388
|
-
'.dotcover',
|
|
389
|
-
'.pid',
|
|
390
|
-
'.lcov',
|
|
391
|
-
'.egg',
|
|
392
|
-
'.manifest',
|
|
393
|
-
'.cache',
|
|
394
|
-
'.coverage',
|
|
395
|
-
'.cover',
|
|
396
|
-
'.gem',
|
|
397
|
-
'.lst',
|
|
398
|
-
'.pickle',
|
|
399
|
-
'.pdb',
|
|
400
|
-
'.gml',
|
|
401
|
-
'.pot',
|
|
402
|
-
'.plt',
|
|
403
|
-
'.whml',
|
|
404
|
-
'.pom',
|
|
405
|
-
'.smtml',
|
|
406
|
-
'.min.js',
|
|
407
|
-
'.mf',
|
|
408
|
-
'.base64',
|
|
409
|
-
'.s',
|
|
410
|
-
'.diff',
|
|
411
|
-
'.patch',
|
|
412
|
-
'.rules',
|
|
413
|
-
# File endings
|
|
414
|
-
'-doc',
|
|
415
|
-
'config',
|
|
416
|
-
'news',
|
|
417
|
-
'readme',
|
|
418
|
-
'swiftdoc',
|
|
419
|
-
'texidoc',
|
|
420
|
-
'todo',
|
|
421
|
-
'version',
|
|
422
|
-
'ignore',
|
|
423
|
-
'manifest',
|
|
424
|
-
'sqlite',
|
|
425
|
-
'sqlite3',
|
|
426
|
-
}
|
|
427
|
-
|
|
428
272
|
|
|
429
273
|
class FileFilters(ScanossBase):
|
|
430
274
|
"""
|
|
@@ -707,9 +551,8 @@ class FileFilters(ScanossBase):
|
|
|
707
551
|
bool: True if file should be skipped, False otherwise
|
|
708
552
|
"""
|
|
709
553
|
file_name = os.path.basename(file_rel_path)
|
|
710
|
-
|
|
554
|
+
DEFAULT_SKIPPED_EXT_LIST = {} if self.is_folder_hashing_scan else DEFAULT_SKIPPED_EXT
|
|
711
555
|
DEFAULT_SKIPPED_FILES_LIST = DEFAULT_SKIPPED_FILES_HFH if self.is_folder_hashing_scan else DEFAULT_SKIPPED_FILES
|
|
712
|
-
DEFAULT_SKIPPED_EXT_LIST = DEFAULT_SKIPPED_EXT_HFH if self.is_folder_hashing_scan else DEFAULT_SKIPPED_EXT
|
|
713
556
|
|
|
714
557
|
if not self.hidden_files_folders and file_name.startswith('.'):
|
|
715
558
|
self.print_debug(f'Skipping file: {file_rel_path} (hidden file)')
|
|
@@ -6,6 +6,7 @@ from typing import Dict, List, Literal, Optional
|
|
|
6
6
|
|
|
7
7
|
from progress.bar import Bar
|
|
8
8
|
|
|
9
|
+
from scanoss.constants import DEFAULT_HFH_DEPTH
|
|
9
10
|
from scanoss.file_filters import FileFilters
|
|
10
11
|
from scanoss.scanoss_settings import ScanossSettings
|
|
11
12
|
from scanoss.scanossbase import ScanossBase
|
|
@@ -15,8 +16,6 @@ from scanoss.utils.simhash import WordFeatureSet, fingerprint, simhash, vectoriz
|
|
|
15
16
|
|
|
16
17
|
MINIMUM_FILE_COUNT = 8
|
|
17
18
|
MINIMUM_CONCATENATED_NAME_LENGTH = 32
|
|
18
|
-
MAXIMUM_FILE_NAME_LENGTH = 32
|
|
19
|
-
|
|
20
19
|
|
|
21
20
|
class DirectoryNode:
|
|
22
21
|
"""
|
|
@@ -72,6 +71,12 @@ class FolderHasher:
|
|
|
72
71
|
|
|
73
72
|
It builds a directory tree (DirectoryNode) and computes the associated
|
|
74
73
|
hash data for the folder.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
scan_dir (str): The directory to be hashed.
|
|
77
|
+
config (FolderHasherConfig): Configuration parameters for the folder hasher.
|
|
78
|
+
scanoss_settings (Optional[ScanossSettings]): Optional settings for Scanoss.
|
|
79
|
+
depth (int): How many levels to hash from the root directory (default: 1).
|
|
75
80
|
"""
|
|
76
81
|
|
|
77
82
|
def __init__(
|
|
@@ -79,6 +84,7 @@ class FolderHasher:
|
|
|
79
84
|
scan_dir: str,
|
|
80
85
|
config: FolderHasherConfig,
|
|
81
86
|
scanoss_settings: Optional[ScanossSettings] = None,
|
|
87
|
+
depth: int = DEFAULT_HFH_DEPTH,
|
|
82
88
|
):
|
|
83
89
|
self.base = ScanossBase(
|
|
84
90
|
debug=config.debug,
|
|
@@ -101,6 +107,7 @@ class FolderHasher:
|
|
|
101
107
|
|
|
102
108
|
self.scan_dir = scan_dir
|
|
103
109
|
self.tree = None
|
|
110
|
+
self.depth = depth
|
|
104
111
|
|
|
105
112
|
def hash_directory(self, path: str) -> dict:
|
|
106
113
|
"""
|
|
@@ -123,7 +130,10 @@ class FolderHasher:
|
|
|
123
130
|
|
|
124
131
|
return tree
|
|
125
132
|
|
|
126
|
-
def _build_root_node(
|
|
133
|
+
def _build_root_node(
|
|
134
|
+
self,
|
|
135
|
+
path: str,
|
|
136
|
+
) -> DirectoryNode:
|
|
127
137
|
"""
|
|
128
138
|
Build a directory tree from the given path with file information.
|
|
129
139
|
|
|
@@ -140,7 +150,7 @@ class FolderHasher:
|
|
|
140
150
|
root_node = DirectoryNode(str(root))
|
|
141
151
|
|
|
142
152
|
all_files = [
|
|
143
|
-
f for f in root.rglob('*') if f.is_file()
|
|
153
|
+
f for f in root.rglob('*') if f.is_file()
|
|
144
154
|
]
|
|
145
155
|
filtered_files = self.file_filters.get_filtered_files_from_files(all_files, str(root))
|
|
146
156
|
|
|
@@ -180,7 +190,7 @@ class FolderHasher:
|
|
|
180
190
|
bar.finish()
|
|
181
191
|
return root_node
|
|
182
192
|
|
|
183
|
-
def _hash_calc_from_node(self, node: DirectoryNode) -> dict:
|
|
193
|
+
def _hash_calc_from_node(self, node: DirectoryNode, current_depth: int = 1) -> dict:
|
|
184
194
|
"""
|
|
185
195
|
Recursively compute folder hash data for a directory node.
|
|
186
196
|
|
|
@@ -189,12 +199,13 @@ class FolderHasher:
|
|
|
189
199
|
|
|
190
200
|
Args:
|
|
191
201
|
node (DirectoryNode): The directory node to compute the hash for.
|
|
202
|
+
current_depth (int): The current depth level (1-based, root is depth 1).
|
|
192
203
|
|
|
193
204
|
Returns:
|
|
194
205
|
dict: The computed hash data for the node.
|
|
195
206
|
"""
|
|
196
207
|
hash_data = self._hash_calc(node)
|
|
197
|
-
|
|
208
|
+
|
|
198
209
|
# Safely calculate relative path
|
|
199
210
|
try:
|
|
200
211
|
node_path = Path(node.path).resolve()
|
|
@@ -204,13 +215,18 @@ class FolderHasher:
|
|
|
204
215
|
# If relative_to fails, use the node path as is or a fallback
|
|
205
216
|
rel_path = Path(node.path).name if node.path else Path('.')
|
|
206
217
|
|
|
218
|
+
# Only process children if we haven't reached the depth limit
|
|
219
|
+
children = []
|
|
220
|
+
if current_depth < self.depth:
|
|
221
|
+
children = [self._hash_calc_from_node(child, current_depth + 1) for child in node.children.values()]
|
|
222
|
+
|
|
207
223
|
return {
|
|
208
224
|
'path_id': str(rel_path),
|
|
209
225
|
'sim_hash_names': f'{hash_data["name_hash"]:02x}' if hash_data['name_hash'] is not None else None,
|
|
210
226
|
'sim_hash_content': f'{hash_data["content_hash"]:02x}' if hash_data['content_hash'] is not None else None,
|
|
211
227
|
'sim_hash_dir_names': f'{hash_data["dir_hash"]:02x}' if hash_data['dir_hash'] is not None else None,
|
|
212
228
|
'lang_extensions': hash_data['lang_extensions'],
|
|
213
|
-
'children':
|
|
229
|
+
'children': children,
|
|
214
230
|
}
|
|
215
231
|
|
|
216
232
|
def _hash_calc(self, node: DirectoryNode) -> dict:
|
|
@@ -237,8 +253,6 @@ class FolderHasher:
|
|
|
237
253
|
|
|
238
254
|
for file in node.files:
|
|
239
255
|
key_str = file.key_str
|
|
240
|
-
if key_str in processed_hashes:
|
|
241
|
-
continue
|
|
242
256
|
|
|
243
257
|
file_name = os.path.basename(file.path)
|
|
244
258
|
|
scanoss/scanners/scanner_hfh.py
CHANGED
|
@@ -29,7 +29,12 @@ from typing import Dict, Optional
|
|
|
29
29
|
|
|
30
30
|
from progress.spinner import Spinner
|
|
31
31
|
|
|
32
|
-
from scanoss.constants import
|
|
32
|
+
from scanoss.constants import (
|
|
33
|
+
DEFAULT_HFH_DEPTH,
|
|
34
|
+
DEFAULT_HFH_MIN_ACCEPTED_SCORE,
|
|
35
|
+
DEFAULT_HFH_RANK_THRESHOLD,
|
|
36
|
+
DEFAULT_HFH_RECURSIVE_THRESHOLD,
|
|
37
|
+
)
|
|
33
38
|
from scanoss.cyclonedx import CycloneDx
|
|
34
39
|
from scanoss.file_filters import FileFilters
|
|
35
40
|
from scanoss.scanners.folder_hasher import FolderHasher
|
|
@@ -48,13 +53,16 @@ class ScannerHFH:
|
|
|
48
53
|
and calculates simhash values based on file names and content to detect folder-level similarities.
|
|
49
54
|
"""
|
|
50
55
|
|
|
51
|
-
def __init__(
|
|
56
|
+
def __init__( # noqa: PLR0913
|
|
52
57
|
self,
|
|
53
58
|
scan_dir: str,
|
|
54
59
|
config: ScannerConfig,
|
|
55
60
|
client: Optional[ScanossGrpc] = None,
|
|
56
61
|
scanoss_settings: Optional[ScanossSettings] = None,
|
|
57
62
|
rank_threshold: int = DEFAULT_HFH_RANK_THRESHOLD,
|
|
63
|
+
depth: int = DEFAULT_HFH_DEPTH,
|
|
64
|
+
recursive_threshold: float = DEFAULT_HFH_RECURSIVE_THRESHOLD,
|
|
65
|
+
min_accepted_score: float = DEFAULT_HFH_MIN_ACCEPTED_SCORE,
|
|
58
66
|
):
|
|
59
67
|
"""
|
|
60
68
|
Initialize the ScannerHFH.
|
|
@@ -65,6 +73,9 @@ class ScannerHFH:
|
|
|
65
73
|
client (ScanossGrpc): gRPC client for communicating with the scanning service.
|
|
66
74
|
scanoss_settings (Optional[ScanossSettings]): Optional settings for Scanoss.
|
|
67
75
|
rank_threshold (int): Get results with rank below this threshold (default: 5).
|
|
76
|
+
depth (int): How many levels to scan (default: 1).
|
|
77
|
+
recursive_threshold (float): Minimum score threshold to consider a match (default: 0.25).
|
|
78
|
+
min_accepted_score (float): Only show results with a score at or above this threshold (default: 0.15).
|
|
68
79
|
"""
|
|
69
80
|
self.base = ScanossBase(
|
|
70
81
|
debug=config.debug,
|
|
@@ -87,12 +98,15 @@ class ScannerHFH:
|
|
|
87
98
|
scan_dir=scan_dir,
|
|
88
99
|
config=config,
|
|
89
100
|
scanoss_settings=scanoss_settings,
|
|
101
|
+
depth=depth,
|
|
90
102
|
)
|
|
91
103
|
|
|
92
104
|
self.scan_dir = scan_dir
|
|
93
105
|
self.client = client
|
|
94
106
|
self.scan_results = None
|
|
95
107
|
self.rank_threshold = rank_threshold
|
|
108
|
+
self.recursive_threshold = recursive_threshold
|
|
109
|
+
self.min_accepted_score = min_accepted_score
|
|
96
110
|
|
|
97
111
|
def scan(self) -> Optional[Dict]:
|
|
98
112
|
"""
|
|
@@ -102,8 +116,10 @@ class ScannerHFH:
|
|
|
102
116
|
Optional[Dict]: The folder hash response from the gRPC client, or None if an error occurs.
|
|
103
117
|
"""
|
|
104
118
|
hfh_request = {
|
|
105
|
-
'root': self.folder_hasher.hash_directory(self.scan_dir),
|
|
119
|
+
'root': self.folder_hasher.hash_directory(path=self.scan_dir),
|
|
106
120
|
'rank_threshold': self.rank_threshold,
|
|
121
|
+
'recursive_threshold': self.recursive_threshold,
|
|
122
|
+
'min_accepted_score': self.min_accepted_score,
|
|
107
123
|
}
|
|
108
124
|
|
|
109
125
|
spinner = Spinner('Scanning folder...')
|
|
@@ -193,7 +209,7 @@ class ScannerHFHPresenter(AbstractPresenter):
|
|
|
193
209
|
}
|
|
194
210
|
]
|
|
195
211
|
}
|
|
196
|
-
|
|
212
|
+
|
|
197
213
|
get_vulnerabilities_json_request = {
|
|
198
214
|
'purls': [{'purl': purl, 'requirement': best_match_version['version']}],
|
|
199
215
|
}
|
|
@@ -210,10 +226,10 @@ class ScannerHFHPresenter(AbstractPresenter):
|
|
|
210
226
|
error_msg = 'ERROR: Failed to produce CycloneDX output'
|
|
211
227
|
self.base.print_stderr(error_msg)
|
|
212
228
|
return None
|
|
213
|
-
|
|
229
|
+
|
|
214
230
|
if vulnerabilities:
|
|
215
231
|
cdx_output = cdx.append_vulnerabilities(cdx_output, vulnerabilities, purl)
|
|
216
|
-
|
|
232
|
+
|
|
217
233
|
return json.dumps(cdx_output, indent=2)
|
|
218
234
|
except Exception as e:
|
|
219
235
|
self.base.print_stderr(f'ERROR: Failed to get license information: {e}')
|
|
@@ -6,14 +6,14 @@ protoc_gen_swagger/options/annotations_pb2_grpc.py,sha256=KZOW9Ciio-f9iL42FuLFnS
|
|
|
6
6
|
protoc_gen_swagger/options/openapiv2_pb2.py,sha256=w0xDs63uyrWGgzRaQZXfJpfI7Jpyvh-i9ay_uzOR-aM,16475
|
|
7
7
|
protoc_gen_swagger/options/openapiv2_pb2.pyi,sha256=hYOV6uQ2yqhP89042_V3GuAsvoBBiXf5CGuYmnFnfv4,54665
|
|
8
8
|
protoc_gen_swagger/options/openapiv2_pb2_grpc.py,sha256=sje9Nh3yE7CHCUWZwtjTgwsKB4GvyGz5vOrGTnRXJfc,917
|
|
9
|
-
scanoss/__init__.py,sha256=
|
|
10
|
-
scanoss/cli.py,sha256=
|
|
9
|
+
scanoss/__init__.py,sha256=VPGwjPwrzb5tg6azCaiI2btijlHrkSzMpmmUqHkuKSM,1146
|
|
10
|
+
scanoss/cli.py,sha256=zAmypc7MeviI70o71aUm_s5FXAPpWEAKsPRzWJQ-Y14,94979
|
|
11
11
|
scanoss/components.py,sha256=NFyt_w3aoMotr_ZaFU-ng00_89sruc0kgY7ERnJXkmM,15891
|
|
12
|
-
scanoss/constants.py,sha256=
|
|
12
|
+
scanoss/constants.py,sha256=GHLTaLNVxXdTXRj7ngRK4u4S653pHzM8qFy4JFLa0wQ,450
|
|
13
13
|
scanoss/cryptography.py,sha256=lOoD_dW16ARQxYiYyb5R8S7gx0FqWIsnGkKfsB0nGaU,10627
|
|
14
14
|
scanoss/csvoutput.py,sha256=3wdXPeIqZG84bCtXFh8fMZO3XodekeSx6RZXoOhZMFc,10551
|
|
15
15
|
scanoss/cyclonedx.py,sha256=y5fI2E-95vv2iZeCCsXtzSdJJUK_piHC1THsbfbXEpA,18151
|
|
16
|
-
scanoss/file_filters.py,sha256=
|
|
16
|
+
scanoss/file_filters.py,sha256=QcLqunaBKQIafjNZ9_Snh9quBX5_-fsTusVmxwjC1q8,18511
|
|
17
17
|
scanoss/filecount.py,sha256=RZjKQ6M5P_RQg0_PMD2tsRe5Z8f98ke0sxYVjPDN8iQ,6538
|
|
18
18
|
scanoss/results.py,sha256=47ZXXuU2sDjYa5vhtbWTmikit9jHhA0rsYKwkvZFI5w,9252
|
|
19
19
|
scanoss/scancodedeps.py,sha256=JbpoGW1POtPMmowzfwa4oh8sSBeeQCqaW9onvc4UFYM,11517
|
|
@@ -32,7 +32,7 @@ scanoss/api/__init__.py,sha256=hx-P78xbDsh6WQIigewkJ7Y7y1fqc_eYnyHC5IZTKmo,1122
|
|
|
32
32
|
scanoss/api/common/__init__.py,sha256=hx-P78xbDsh6WQIigewkJ7Y7y1fqc_eYnyHC5IZTKmo,1122
|
|
33
33
|
scanoss/api/common/v2/__init__.py,sha256=hx-P78xbDsh6WQIigewkJ7Y7y1fqc_eYnyHC5IZTKmo,1122
|
|
34
34
|
scanoss/api/common/v2/scanoss_common_pb2.py,sha256=uF1xIFu9o_srr8fZWkIOtdInbDk-duesJKyFKPznTRU,4646
|
|
35
|
-
scanoss/api/common/v2/scanoss_common_pb2_grpc.py,sha256=
|
|
35
|
+
scanoss/api/common/v2/scanoss_common_pb2_grpc.py,sha256=YMOEV6H5rFsx05X1ZfTh7rbOl0ThP6_F5QIal2hJkhI,1031
|
|
36
36
|
scanoss/api/components/__init__.py,sha256=hx-P78xbDsh6WQIigewkJ7Y7y1fqc_eYnyHC5IZTKmo,1122
|
|
37
37
|
scanoss/api/components/v2/__init__.py,sha256=hx-P78xbDsh6WQIigewkJ7Y7y1fqc_eYnyHC5IZTKmo,1122
|
|
38
38
|
scanoss/api/components/v2/scanoss_components_pb2.py,sha256=godS4LyRzJCpUkGgOK2KTdmNs8RM-7CvAL5iHTiouNI,12775
|
|
@@ -63,7 +63,7 @@ scanoss/api/vulnerabilities/__init__.py,sha256=IFrDk_DTJgKSZmmU-nuLXuq_s8sQZlrSC
|
|
|
63
63
|
scanoss/api/vulnerabilities/v2/__init__.py,sha256=IFrDk_DTJgKSZmmU-nuLXuq_s8sQZlrSCHhIDMJT4r0,1122
|
|
64
64
|
scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py,sha256=pmm0MSiXkdf8e4rCIIDRcsNRixR2vGvD1Xak4l-wdwI,16550
|
|
65
65
|
scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py,sha256=BNxT5kUKQ-mgtOt5QYBM1Qrg5LNDqSpWKpfEZquIlsM,19127
|
|
66
|
-
scanoss/data/build_date.txt,sha256=
|
|
66
|
+
scanoss/data/build_date.txt,sha256=gbMKYEMYGe3MOUyqPdAkwa0f9KlOg7rVeAQGJKdyPfs,40
|
|
67
67
|
scanoss/data/scanoss-settings-schema.json,sha256=ClkRYAkjAN0Sk704G8BE_Ok006oQ6YnIGmX84CF8h9w,8798
|
|
68
68
|
scanoss/data/spdx-exceptions.json,sha256=s7UTYxC7jqQXr11YBlIWYCNwN6lRDFTR33Y8rpN_dA4,17953
|
|
69
69
|
scanoss/data/spdx-licenses.json,sha256=A6Z0q82gaTLtnopBfzeIVZjJFxkdRW1g2TuumQc-lII,228794
|
|
@@ -80,18 +80,18 @@ scanoss/inspection/raw/undeclared_component.py,sha256=uN-oVqQF8vWArTc2yDVoxudV0b
|
|
|
80
80
|
scanoss/inspection/utils/license_utils.py,sha256=Zb6QLmVJb86lKCwZyBsmwakyAtY1SXa54kUyyKmWMqA,5093
|
|
81
81
|
scanoss/scanners/__init__.py,sha256=D4C0lWLuNp8k_BjQZEc07WZcUgAvriVwQWOk063b0ZU,1122
|
|
82
82
|
scanoss/scanners/container_scanner.py,sha256=fOrb64owrstX7LnTuxiIan059YgLeKXeBS6g2QaCyq0,16346
|
|
83
|
-
scanoss/scanners/folder_hasher.py,sha256
|
|
83
|
+
scanoss/scanners/folder_hasher.py,sha256=tOlo8YXanC3sQ77oHvHcsWiu8BW2pCfTyWC07AmzHIQ,12845
|
|
84
84
|
scanoss/scanners/scanner_config.py,sha256=egG7cw3S2akU-D9M1aLE5jLrfz_c8e7_DIotMnnpM84,2601
|
|
85
|
-
scanoss/scanners/scanner_hfh.py,sha256=
|
|
85
|
+
scanoss/scanners/scanner_hfh.py,sha256=M2PB4wDTi4LD1DwuAVfWiqQkjOImSpNok7vgo5H_Spg,9190
|
|
86
86
|
scanoss/services/dependency_track_service.py,sha256=JIpqev4I-x_ZajMxD5W2Y3OAUvEJ_4nstzAPV90vfP8,5070
|
|
87
87
|
scanoss/utils/__init__.py,sha256=0hjb5ktavp7utJzFhGMPImPaZiHWgilM2HwvTp5lXJE,1122
|
|
88
88
|
scanoss/utils/abstract_presenter.py,sha256=teiDTxBj5jBMCk2T8i4l1BJPf_u4zBLWrtCTFHSSECM,3148
|
|
89
89
|
scanoss/utils/crc64.py,sha256=TMrwQimSdE6imhFOUL7oAG6Kxu-8qMpGWMuMg8QpSVs,3169
|
|
90
90
|
scanoss/utils/file.py,sha256=62cA9a17TU9ZvfA3FY5HY4-QOajJeSrc8S6xLA_f-3M,2980
|
|
91
91
|
scanoss/utils/simhash.py,sha256=6iu8DOcecPAY36SZjCOzrrLMT9oIE7-gI6QuYwUQ7B0,5793
|
|
92
|
-
scanoss-1.
|
|
93
|
-
scanoss-1.
|
|
94
|
-
scanoss-1.
|
|
95
|
-
scanoss-1.
|
|
96
|
-
scanoss-1.
|
|
97
|
-
scanoss-1.
|
|
92
|
+
scanoss-1.36.0.dist-info/licenses/LICENSE,sha256=LLUaXoiyOroIbr5ubAyrxBOwSRLTm35ETO2FmLpy8QQ,1074
|
|
93
|
+
scanoss-1.36.0.dist-info/METADATA,sha256=sT51PlSvkzaVi5o4RMD-9XF2oKJuokyX58nNZsZFJJ4,6181
|
|
94
|
+
scanoss-1.36.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
95
|
+
scanoss-1.36.0.dist-info/entry_points.txt,sha256=Uy28xnaDL5KQ7V77sZD5VLDXPNxYYzSr5tsqtiXVzAs,48
|
|
96
|
+
scanoss-1.36.0.dist-info/top_level.txt,sha256=V11PrQ6Pnrc-nDF9xnisnJ8e6-i7HqSIKVNqduRWcL8,27
|
|
97
|
+
scanoss-1.36.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|