@@ -455,7 +455,7 @@ def create_local_scan_result(
455455 documents_to_scan : List [Document ],
456456 command_scan_type : str ,
457457 scan_type : str ,
458- severity_threshold : str ,
458+ severity_threshold : Optional [ str ] ,
459459) -> LocalScanResult :
460460 document_detections = get_document_detections (scan_result , documents_to_scan )
461461 relevant_document_detections_list = exclude_irrelevant_document_detections (
@@ -627,7 +627,10 @@ def get_document_detections(
627627
628628
629629def exclude_irrelevant_document_detections (
630- document_detections_list : List [DocumentDetections ], scan_type : str , command_scan_type : str , severity_threshold : str
630+ document_detections_list : List [DocumentDetections ],
631+ scan_type : str ,
632+ command_scan_type : str ,
633+ severity_threshold : Optional [str ],
631634) -> List [DocumentDetections ]:
632635 relevant_document_detections_list = []
633636 for document_detections in document_detections_list :
@@ -709,17 +712,18 @@ def try_get_git_remote_url(path: str) -> Optional[str]:
709712
710713
711714def exclude_irrelevant_detections (
712- detections : List [Detection ], scan_type : str , command_scan_type : str , severity_threshold : str
715+ detections : List [Detection ], scan_type : str , command_scan_type : str , severity_threshold : Optional [ str ]
713716) -> List [Detection ]:
714717 relevant_detections = _exclude_detections_by_exclusions_configuration (detections , scan_type )
715718 relevant_detections = _exclude_detections_by_scan_type (relevant_detections , scan_type , command_scan_type )
716- return _exclude_detections_by_severity (relevant_detections , severity_threshold )
717719
720+ if severity_threshold :
721+ return _exclude_detections_by_severity (relevant_detections , severity_threshold )
722+
723+ return relevant_detections
718724
719- def _exclude_detections_by_severity (detections : List [Detection ], severity_threshold : str ) -> List [Detection ]:
720- if severity_threshold is None :
721- return detections
722725
726+ def _exclude_detections_by_severity (detections : List [Detection ], severity_threshold : str ) -> List [Detection ]:
723727 relevant_detections = []
724728 for detection in detections :
725729 severity = detection .detection_details .get ('advisory_severity' )
0 commit comments