With Sonar version : Developer Edition Version 8.9.1 (build 44547)
We detected that rule suggesting to use case instead of decode that was improved following my previous request (see SONARPLSQL-726) does not have the same behavior in SELECT section than in GROUP BY section of a query.
In SELECT section last version of the rule (after SONARPLSQL-726) is working well and considers acceptable the usage of a “simple” decode.
But the same decode in the GROUP BY section of the same query is hit by the rule.
I guess this is something missing in the implementation of the SONARPLSQL-726.
Code to reproduce:
SELECT count(emp.first_name) as number_of_emp, DECODE(active_flag, 'Y', 'Active', 'Inactive') as status FROM employee GROUP BY DECODE(active_flag, 'Y', 'Active', 'Inactive');