plsql:S1172 - No issues in pkb files

Hi,

I’ve noticed that for rule plsql:S1172 no issues are shown for functions/procedures in pkb files.

Snippet:

create or replace package body Test is
    
    procedure testProcedure(unusedParam in varchar2) is
    begin
        null;
    end testProcedure;
    
end Test;
/

In this case I would expect that an issue is shown for parameter ‘unusedParam’.

Language: PL/SQL
SQ version: 10.0.0.68432

Thanks!

Karl

Hey there!

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

10.0 → 10.6

You may find these resources helpful:

If your issue persists after upgrade, please come back to us.

Hi,

The behaviour can also be reproduced in the current version (10.6).

Thanks!

Karl

Hello @Karl,

Thank you for reporting this issue!

I could not raise the issue with your snippet, even in a .sql file.
However, I was able to raise plsql:S1172 in both a .sql and .pkb files with the following snippet:

CREATE PROCEDURE say_hello(name VARCHAR2) AS
BEGIN
  DBMS_OUTPUT.PUT_LINE('Hello World');
END;
/

We don’t expect the procedure declaration to be in a package body.
Then, the issue is not about .pkb files not being analyzed.
It is a false negative.

I have created a ticket to fix it:

https://sonarsource.atlassian.net/browse/SONARPLSQL-850

Have a nice day!