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
ABAP

ABAP static code analysis

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

  • All rules 94
  • Vulnerability4
  • Bug14
  • Security Hotspot7
  • Code Smell69
 
Tags
    Impact
      Clean code attribute
        1. All branches in a conditional structure should not have exactly the same implementation

           Bug
        2. "WHERE" clause conditions should not be contradictory

           Bug
        3. Open SQL "SELECT" statements should have an "ORDER BY" clause

           Bug
        4. Empty driver tables should not be used in a "SELECT/FOR ALL ENTRIES" clause

           Bug
        5. Related "if/else if" statements should not have the same condition

           Bug
        6. Identical expressions should not be used on both sides of a binary operator

           Bug
        7. Loops with at most one iteration should be refactored

           Bug
        8. An internal table should be sorted before duplicates are deleted

           Bug
        9. Sort fields should be provided for an internal table sort

           Bug
        10. Operational statements should not be chained

           Bug
        11. Variables should not be self-assigned

           Bug
        12. SQL "BYPASSING BUFFER" clause should not be used

           Bug
        13. SQL "UPDATE dbtab SET ..." statements should have a "WHERE" clause

           Bug
        14. "DELETE FROM dbtab" statements should have a "WHERE" clause

           Bug

        All branches in a conditional structure should not have exactly the same implementation

        intentionality - clear
        reliability
        Bug

          Why is this an issue?

          Having all branches of a CASE or IF chain with the same implementation indicates a problem.

          In the following code:

          IF a >0.  "Noncompliant
              doSomething.
          ELSE IF b> 0.
              doSomething.
          ELSE.
              doSomething.
          ENDIF.
          
          CASE i.  "Noncompliant
            WHEN 1 OR 3.
              doSomething.
            WHEN 2.
              doSomething.
            WHEN OTHERS.
                  doSomething.
          ENDCASE.
          

          Either there is a copy-paste error that needs fixing or an unnecessary CASE or IF chain that needs removing.

          Exceptions

          This rule does not apply to IF chains without final ELSE, nor to CASE without a WHEN OTHERS clause.

          IF a >0.   "no issue, this could have been done on purpose to make the code more readable
              doSomething.
          ELSEIF b> 0.
              doSomething.
          ENDIF.
          
            Available In:
          • SonarQube IdeCatch issues on the fly,
            in your IDE
          • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories
          • SonarQube ServerAnalyze code in your
            on-premise CI
            Developer Edition
            Available Since
            9.1

          © 2008-2025 SonarSource SA. All rights reserved.

          Privacy Policy | Cookie Policy | Terms of Use