@@ -2237,21 +2237,25 @@ func findRule(ruleIds map[interface{}]bool, result *wrappers.ScanResult) *wrappe
22372237}
22382238
22392239func findRuleID (result * wrappers.ScanResult ) (ruleID , ruleName , shortMessage string ) {
2240+ caser := cases .Title (language .English )
2241+
22402242 if result .ScanResultData .QueryID == nil && result .ScanResultData .RuleID == nil {
22412243 return fmt .Sprintf ("%s (%s)" , result .ID , result .Type ),
2242- strings . Title (strings .ToLower (strings .ReplaceAll (result .ID , "-" , "" ))),
2244+ caser . String (strings .ToLower (strings .ReplaceAll (result .ID , "-" , "" ))),
22432245 fmt .Sprintf ("%s (%s)" , result .ScanResultData .PackageIdentifier , result .ID )
22442246 }
22452247
22462248 if result .ScanResultData .RuleID != nil {
2247- return fmt .Sprintf ("%s (%s)" , * result .ScanResultData .RuleID , result .Type ),
2248- result .ScanResultData .RuleName ,
2249- result .ScanResultData .RuleName
2249+ ruleName = strings .ReplaceAll (result .ScanResultData .RuleName , "_" , " " )
2250+ return fmt .Sprintf ("%s - %s (%s)" , ruleName , * result .ScanResultData .RuleID , result .Type ),
2251+ ruleName ,
2252+ ruleName
22502253 }
22512254
2252- return fmt .Sprintf ("%v (%s)" , result .ScanResultData .QueryID , result .Type ),
2253- strings .ReplaceAll (result .ScanResultData .QueryName , "_" , " " ),
2254- strings .ReplaceAll (result .ScanResultData .QueryName , "_" , " " )
2255+ ruleName = strings .ReplaceAll (result .ScanResultData .QueryName , "_" , " " )
2256+ return fmt .Sprintf ("%v - %s (%s)" , ruleName , result .ScanResultData .QueryID , result .Type ),
2257+ ruleName ,
2258+ ruleName
22552259}
22562260
22572261func findFullDescription (result * wrappers.ScanResult ) wrappers.SarifDescription {
0 commit comments