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

Method from_license

src/summarycode/todo.py:314–332  ·  view source on GitHub ↗
(cls, detection, detection_log, file_regions)

Source from the content-addressed store, hash-verified

312
313 @classmethod
314 def from_license(cls, detection, detection_log, file_regions):
315 review_comments = get_review_comments(detection_log)
316 detection_object = detection.get_license_detection_object()
317 license_diagnostics = False
318 if detection_object.detection_log != None:
319 license_diagnostics = True
320 license_text_diagnostics = True
321 detection_mapping = detection_object.to_dict(
322 include_text=True,
323 license_diagnostics=license_diagnostics,
324 license_text_diagnostics=license_text_diagnostics,
325 )
326 return cls(
327 detection_type='license',
328 detection_id=detection.identifier,
329 detection=detection_mapping,
330 review_comments=review_comments,
331 file_regions=file_regions,
332 )
333
334
335 def to_dict(self):

Callers 1

Calls 3

get_review_commentsFunction · 0.85
to_dictMethod · 0.45

Tested by

no test coverage detected