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

        Open SQL "SELECT" statements should have an "ORDER BY" clause

        intentionality - clear
        reliability
        Bug
        • unpredictable
        • sql

        Why is this an issue?

        An Open SQL SELECT statement without an explicit ORDER BY clause will retrieve rows in an unpredictable order. On pool/cluster tables, the current implementation of Open SQL SELECT returns the result set in the primary key order, but that’s not the case for transparent tables. That’s why it’s safer to always use an ORDER BY clause.

        Noncompliant code example

        OPEN CURSOR C FOR SELECT * FROM SBOOK WHERE CARRID = 'LH '. "NonCompliant
        SELECT * FROM FLIGHTS WHERE FLIGHT_NUMBER = 'LH '."NonCompliant
        

        Compliant solution

        OPEN CURSOR C FOR SELECT * FROM SBOOK WHERE CARRID = 'LH '
          ORDER BY PRIMARY KEY.
        SELECT * FROM FLIGHTS WHERE FLIGHT_NUMBER = 'LH ' ORDER BY PRIMARY KEY.
        
          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