SonarSource Rules
  • Products

    In-IDE

    Code Quality and Security in your IDE with SonarQube Ide

    IDE extension that lets you fix coding issues before they exist!

    Discover SonarQube for IDE

    SaaS

    Code Quality and Security in the cloud with SonarQube Cloud

    Setup is effortless and analysis is automatic for most languages

    Discover SonarQube Cloud

    Self-Hosted

    Code Quality and Security Self-Hosted with SonarQube Server

    Fast, accurate analysis; enterprise scalability

    Discover SonarQube Server
  • SecretsSecrets
  • ABAPABAP
  • AnsibleAnsible
  • ApexApex
  • AzureResourceManagerAzureResourceManager
  • CC
  • C#C#
  • C++C++
  • CloudFormationCloudFormation
  • COBOLCOBOL
  • CSSCSS
  • DartDart
  • DockerDocker
  • FlexFlex
  • GitHub ActionsGitHub Actions
  • GoGo
  • HTMLHTML
  • JavaJava
  • JavaScriptJavaScript
  • JSONJSON
  • JCLJCL
  • KotlinKotlin
  • KubernetesKubernetes
  • Objective CObjective C
  • PHPPHP
  • PL/IPL/I
  • PL/SQLPL/SQL
  • PythonPython
  • RPGRPG
  • RubyRuby
  • RustRust
  • ScalaScala
  • ShellShell
  • SwiftSwift
  • TerraformTerraform
  • TextText
  • TypeScriptTypeScript
  • T-SQLT-SQL
  • VB.NETVB.NET
  • VB6VB6
  • XMLXML
  • YAMLYAML
RPG

RPG static code analysis

Unique rules to find Bugs, Security Hotspots, and Code Smells in your RPG code

  • All rules 58
  • Vulnerability1
  • Bug7
  • Security Hotspot1
  • Code Smell49
 
Tags
    Impact
      Clean code attribute
        1. "GOTO" statements should not be used

           Code Smell
        2. Delivering code in production with debug features activated is security-sensitive

           Security Hotspot
        3. Multiple occurrence data structures should not be used

           Code Smell
        4. Compile-time arrays should not be used

           Code Smell
        5. Optional operation codes should be omitted

           Code Smell
        6. "QUALIFIED" data structures should be used

           Code Smell
        7. Prototypes should be used

           Code Smell
        8. Comment lines should not be too long

           Code Smell
        9. "/COPY" statements should include specification letters

           Code Smell
        10. Standard language features should be in upper case

           Code Smell
        11. Subprocedures should be used instead of subroutines

           Code Smell
        12. Subprocedures should not reference global variables

           Code Smell
        13. "/EJECT" should be used after "F", "D" and "C" specification sections

           Code Smell
        14. "CONST" should be used for parameters that are not modified

           Code Smell
        15. Variables used in only one subprocedure should not be global

           Code Smell
        16. The "*srcstmt" header option should be used

           Code Smell
        17. Record formats should be cleared before each use

           Bug
        18. Two branches in a conditional structure should not have exactly the same implementation

           Code Smell
        19. Related "IF/ELSEIF" statements and "WHEN" clauses in a "SELECT" should not have the same condition

           Bug
        20. Unused subprocedures should be removed

           Code Smell
        21. Identical expressions should not be used on both sides of a binary operator

           Bug
        22. "IF" blocks should not have too many lines of code

           Code Smell
        23. "DO" blocks should not have too many lines of code

           Code Smell
        24. Variables should not be self-assigned

           Bug
        25. Non-input files should be accessed with the no lock option

           Bug
        26. The data area structure for "IN" should be defined in D spec lines.

           Code Smell
        27. "/COPY" should be avoided

           Code Smell
        28. SQL statements should not join too many tables

           Code Smell
        29. All opened "USROPN" files should be explicitly closed

           Bug
        30. The correct "ENDxx" statement should be used

           Code Smell
        31. Debugging statements "DEBUG(*YES)" and "DUMP" should not be used

           Vulnerability
        32. Line count data should be retrieved from the file information data structure

           Bug
        33. Track uses of disallowed operation codes

           Code Smell
        34. Indicators should be used on "CHAIN" statements

           Code Smell
        35. The first parameter of a "CHAIN/READx" statement should be a "KLIST"

           Code Smell
        36. The parameters of a "CALL" or "CALLB" statement should be defined as a "PLIST"

           Code Smell
        37. "IF" statements should not be conditioned on Indicators

           Code Smell
        38. LIKE keyword should be used to define work fields

           Code Smell
        39. Numeric fields should be defined as odd length packed fields

           Code Smell
        40. "E" should be found in F-spec lines

           Code Smell
        41. Error handling should be defined in F specs

           Code Smell
        42. Standard figurative constants *ON, *OFF and *BLANK should be used in place of '1', '0' and ' '

           Code Smell
        43. Unused subroutines should be removed

           Code Smell
        44. Subroutines should be documented

           Code Smell
        45. Subroutines should not be too complex

           Code Smell
        46. Columns to be read with a "SELECT" statement should be clearly defined

           Code Smell
        47. Track lack of copyright and license headers

           Code Smell
        48. Subroutines should not have too many lines of code

           Code Smell
        49. Control flow statements "IF", "FOR", "DO", ... should not be nested too deeply

           Code Smell
        50. "IF ... ELSEIF" constructs should end with "ELSE" clauses

           Code Smell
        51. Sections of code should not be commented out

           Code Smell
        52. String literals should not be duplicated

           Code Smell
        53. "SELECT WHEN" clauses should not have too many lines of code

           Code Smell
        54. Nested blocks of code should not be left empty

           Code Smell
        55. Unused variables should be removed

           Code Smell
        56. Expressions should not be too complex

           Code Smell
        57. Files should not have too many lines of code

           Code Smell
        58. Subroutine names should comply with a naming convention

           Code Smell

        Comment lines should not be too long

        consistency - formatted
        maintainability
        Code Smell
        • convention

        Why is this an issue?

        Shared coding conventions allow teams to collaborate effectively. This rule ensures that comments end at or before the last line position which is easily viewable at the default screen resolution.

          Available In:
        • SonarQube IdeCatch issues on the fly,
          in your IDE
        • SonarQube ServerAnalyze code in your
          on-premise CI
          Enterprise
          Edition
          Available Since
          9.1

        © 2008-2025 SonarSource SA. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use