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
Filtered: 2 rules found
clumsy
    Impact
      Clean code attribute
        1. Optional operation codes should be omitted

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

           Code Smell

        "QUALIFIED" data structures should be used

        intentionality - clear
        maintainability
        Code Smell
        • clumsy

        Why is this an issue?

        QUALIFIED data structures result in cleaner code because you can’t reference the fields without using the qualifying name. They also allow you to have multiple sub-fields with the same name, meaning subfield names don’t have to be convoluted for uniqueness, and can be expressive instead.

        Noncompliant code example

              * Noncompliant
             D Employee        DS
             D  EmpId                         7P 0
             D  EFName                       30A
             D  ELName                       30A
             D  EPhone                       11P 0
        
              * Noncompliant
             D Contractor      DS
             D  CntId                         7P 0
             D  CFName                       30A
             D  CLName                       30A
             D  CPhone                       11P 0
        
              /free
                EmpId = '000220';
              /end-free
        

        Compliant solution

             D Employee        DS                  QUALIFIED
             D  Id                            7P 0
             D  FName                        30A
             D  LName                        30A
             D  Phone                        11P 0
        
             D Contractor      DS                  QUALIFIED
             D  Id                            7P 0
             D  FName                        30A
             D  LName                        30A
             D  Phone                        11P 0
        
              /free
                Employee.Id = '000220';
              /end-free
        
          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