False positive with RPG - S1601

SonarQube Server 2025.6
RPG
Unused subroutines should be removed - S1601
False positive on *INZSR subroutine. This subroutine is implicitly executed at program initialization, but is never explicitly called. It should not show as a warning for the S1601 rule as it is used, it’s just not as obvious as other subroutines. False positive occurs in both free format and fixed format RPG.

**free

snd-msg 'Second';

*inlr = *on;

begsr *inzsr;
  snd-msg 'First';
endsr;
     C                   SND-MSG   'SECOND'
     C                   SETON                                        LR
     C     *INZSR        BEGSR
     C                   SND-MSG   'FIRST'
     C                   ENDSR

Hey @1337_Nerd , and welcome to the Community!

Thank you very much for this report. You are correct, the rule S1601 should not trigger for the *INZSR subroutine.

I’ll implement a fix that should be available in the next release of SQS.

Thank you again and have a great weekend. :slight_smile:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.