MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / from_package

Method from_package

src/summarycode/todo.py:293–311  ·  view source on GitHub ↗
(cls, package_data, detection_log, file_path)

Source from the content-addressed store, hash-verified

291
292 @classmethod
293 def from_package(cls, package_data, detection_log, file_path):
294 purl = package_data["purl"]
295 if not purl:
296 purl = get_unknown_purl(package_data["type"])
297 identifier = get_package_identifier(package_data, file_path)
298 detection_id = f"{purl}-{identifier}"
299 file_region = FileRegion(
300 path=file_path,
301 start_line=None,
302 end_line=None,
303 )
304 review_comments = get_review_comments(detection_log)
305 return cls(
306 detection_type='package',
307 detection_id=detection_id,
308 detection=package_data,
309 review_comments=review_comments,
310 file_regions=[file_region],
311 )
312
313 @classmethod
314 def from_license(cls, detection, detection_log, file_regions):

Calls 4

FileRegionClass · 0.90
get_unknown_purlFunction · 0.85
get_package_identifierFunction · 0.85
get_review_commentsFunction · 0.85

Tested by 2