G-7150
🆓Warning
Try to remove unused parameters.
Reason
You should go through your programs and remove any parameter that is no longer used.
Example
Non-Compliant Example
create or replace package body department_api is function name_by_id( -- NOSONAR G-7460: non-deterministic in_department_id in integer ,in_manager in employees%rowtype ) return departments.department_name%type is co_department_id constant departments.department_id%type := in_department_id; l_department_name departments.department_name%type; begin <<find_department>> begin select department_name into l_department_name from departments where department_id = co_department_id; exception when no_data_found or too_many_rows then l_department_name := null; end find_department; return l_department_name; end name_by_id; end department_api; /
Issues
Line | Column | Message |
---|---|---|
4 | 7 |
★★★★★
Compliant Solution -
create or replace package body department_api is function name_by_id( -- NOSONAR G-7460: non-deterministic in_department_id in integer ) return departments.department_name%type is co_department_id constant departments.department_id%type := in_department_id; l_department_name departments.department_name%type; begin <<find_department>> begin select department_name into l_department_name from departments where department_id = co_department_id; exception when no_data_found or too_many_rows then l_department_name := null; end find_department; return l_department_name; end name_by_id; end department_api; /
References
- same as plsqlopen:UnusedParameter
- same as Trivadis G-7150
- same as plsql:S1172