We use SonarQube server 9.5 (build56709):
This is about the Cobol rule “[Strings should only be moved to variables large enough to hold them without truncation].
The piece of code is:
MOVE N’X902’
TO RSPN-CD IN L40-P13915
The move done is a move as a national values, The N indicates the national move and ‘X902’ is the value of the move. The message that we see is: Increase the size of “RSPN-CD” (PIC N(04)) or do not “MOVE” N’X902’ (of size 5) to it.
As you can see, the length of X902 is 4 characters and fits in the result field RSPN-CD. RSPN-CD is declared as: RSPN-CD PIC N(04).
Could you update this rule so it can handle the national fields on z/OS?
Thanks in advance.
Henk van der Wijk