(cls, detection, detection_log, file_regions)
| 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): |
no test coverage detected