@@ -645,70 +645,6 @@ func stringToApplicabilityStatus(status string) *jasutils.ApplicabilityStatus {
645645 }
646646}
647647
648- // formatComponentWithApplicability formats a component with its applicability status
649- // Format: "component-id (Status)"
650- func formatComponentWithApplicability (component formats.ComponentRow , status string ) string {
651- componentId := results .GetDependencyId (component .Name , component .Version )
652- if status == "" {
653- return componentId
654- }
655- // Format status as (Status)
656- return fmt .Sprintf ("%s (%s)" , componentId , status )
657- }
658-
659- // buildComponentApplicabilityMap builds a mapping of component keys (name:version) to their applicability statuses
660- // from the impact paths and CVEs
661- func buildComponentApplicabilityMap (impactPaths [][]formats.ComponentRow , cves []formats.CveRow ) map [string ]string {
662- componentStatusMap := make (map [string ]string )
663-
664- // Collect all component statuses from CVEs
665- // For each CVE, check if it has applicability status
666- for _ , cve := range cves {
667- if cve .Applicability != nil && cve .Applicability .Status != "" {
668- // Map all components in impact paths to this CVE's applicability status
669- for _ , path := range impactPaths {
670- for _ , component := range path {
671- componentKey := fmt .Sprintf ("%s:%s" , component .Name , component .Version )
672- // Use the first status we find for each component
673- // If multiple CVEs have different statuses, we'll use GetFinalApplicabilityStatus
674- if _ , exists := componentStatusMap [componentKey ]; ! exists {
675- componentStatusMap [componentKey ] = cve .Applicability .Status
676- }
677- }
678- }
679- }
680- }
681-
682- // For components with multiple statuses, use GetFinalApplicabilityStatus
683- // Group components by their statuses
684- componentStatuses := make (map [string ][]jasutils.ApplicabilityStatus )
685- for componentKey , status := range componentStatusMap {
686- statusEnum := stringToApplicabilityStatus (status )
687- if statusEnum != nil {
688- componentStatuses [componentKey ] = append (componentStatuses [componentKey ], * statusEnum )
689- }
690- }
691-
692- // Use GetFinalApplicabilityStatus for components with multiple statuses
693- finalMap := make (map [string ]string )
694- for componentKey , statuses := range componentStatuses {
695- if len (statuses ) > 0 {
696- finalMap [componentKey ] = results .GetFinalApplicabilityStatus (statuses ).String ()
697- }
698- }
699-
700- return finalMap
701- }
702-
703- // getComponentApplicabilityStatus gets the applicability status for a component from the provided map
704- func getComponentApplicabilityStatus (component formats.ComponentRow , componentStatusMap map [string ]string ) string {
705- componentKey := fmt .Sprintf ("%s:%s" , component .Name , component .Version )
706- if status , exists := componentStatusMap [componentKey ]; exists {
707- return status
708- }
709- return ""
710- }
711-
712648// getDependencyPathCellData extracts and formats direct and transitive dependencies from ImpactPaths as collapsible sections
713649func getDependencyPathCellData (impactPaths [][]formats.ComponentRow , writer OutputWriter ) CellData {
714650 if len (impactPaths ) == 0 {
0 commit comments