Skip to content

Commit b32700e

Browse files
Remove empty scanoss reference
1 parent f0a04aa commit b32700e

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/fosslight_source/_parsing_scanoss_file.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ def parsing_extraInfo(scanned_result):
1919
scanoss_extra_info = []
2020
for scan_item in scanned_result:
2121
license_w_source = scan_item.scanoss_reference
22-
if license_w_source:
23-
extra_item = [scan_item.file, ','.join(license_w_source['component_declared']),
24-
','.join(license_w_source['file_spdx_tag']),
25-
','.join(license_w_source['file_header']),
26-
','.join(license_w_source['license_file']),
27-
','.join(license_w_source['scancode']),
28-
scan_item.matched_lines, scan_item.fileURL]
29-
else:
30-
extra_item = [scan_item.file, '', '', '', '', '', scan_item.matched_lines, scan_item.fileURL]
31-
scanoss_extra_info.append(extra_item)
22+
if scan_item.matched_lines:
23+
if license_w_source:
24+
extra_item = [scan_item.file, ','.join(license_w_source['component_declared']),
25+
','.join(license_w_source['file_spdx_tag']),
26+
','.join(license_w_source['file_header']),
27+
','.join(license_w_source['license_file']),
28+
','.join(license_w_source['scancode']),
29+
scan_item.matched_lines, scan_item.fileURL]
30+
else:
31+
extra_item = [scan_item.file, '', '', '', '', '', scan_item.matched_lines, scan_item.fileURL]
32+
scanoss_extra_info.append(extra_item)
3233
scanoss_extra_info.insert(0, SCANOSS_INFO_HEADER)
3334
return scanoss_extra_info
3435

src/fosslight_source/_scan_item.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class ScanItem:
2828
oss_name = ""
2929
oss_version = ""
3030
download_location = ""
31-
matched_lines = ""
32-
fileURL = ""
31+
matched_lines = "" # Only for SCANOSS results
32+
fileURL = "" # Only for SCANOSS results
3333
license_reference = ""
3434

3535
def __init__(self, value):

0 commit comments

Comments
 (0)