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
Filtered: 23 rules found
sql
    Impact
      Clean code attribute
        1. "LIKE" clauses should not be used without wildcards

           Code Smell
        2. "WHERE" clause conditions should not be contradictory

           Bug
        3. "JOIN" should be used instead of nested "SELECT" statements

           Code Smell
        4. "SELECT INTO TABLE" should be used

           Code Smell
        5. Open SQL "SELECT" statements should have an "ORDER BY" clause

           Bug
        6. "EXIT" and "CHECK" statements should not be used in "SELECT" loops

           Code Smell
        7. Duplications in driver tables should deleted before the tables are used

           Code Smell
        8. Empty driver tables should not be used in a "SELECT/FOR ALL ENTRIES" clause

           Bug
        9. SQL "LIKE" clauses should not start with wildcard characters

           Code Smell
        10. A SQL "SELECT" statement should not involve too many tables

           Code Smell
        11. Native SQL should not be statically embedded

           Code Smell
        12. SQL "BYPASSING BUFFER" clause should not be used

           Bug
        13. SQL aggregate functions should not be used to prevent bypassing the SAP buffer

           Code Smell
        14. To "SELECT", "INSERT" or "DELETE" several lines in databases, internal tables should be used in place of loop control structure

           Code Smell
        15. SQL "DISTINCT" operator should not be used to prevent bypassing the SAP buffering

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

           Code Smell
        17. The "LIKE" operator should be used very carefully in SQL "WHERE" condition

           Code Smell
        18. SQL "UPDATE dbtab SET ..." statements should have a "WHERE" clause

           Bug
        19. Subqueries and "JOIN" clauses should not be used

           Code Smell
        20. Having dynamic clauses for SQL "SELECT" statements is security-sensitive

           Security Hotspot
        21. Having SQL "SELECT" statements without "WHERE" conditions is security-sensitive

           Security Hotspot
        22. "DELETE FROM dbtab" statements should have a "WHERE" clause

           Bug
        23. SQL EXISTS subqueries should not be used

           Code Smell

        Subqueries and "JOIN" clauses should not be used

        intentionality - efficient
        maintainability
        Code Smell
        • performance
        • sql

        Why is this an issue?

        JOIN bypasses the SAP table buffer. Buffered tables should be accessed with the simplest SELECT statements possible so as not to risk bypassing the buffer.

        If one of the tables in a JOIN is buffered, it would be an advantage to first import the required entries using a SELECT into an internal table itab, and then for example, using the statement SELECT ... FOR ALL ENTRIES IN itab to access further tables.

        Noncompliant code example

        For JOIN clauses:

        SELECT s~carrid s~carrname p~connid
               INTO CORRESPONDING FIELDS OF TABLE itab
               FROM scarr AS s
               LEFT OUTER JOIN spfli AS p ON s~carrid   =  p~carrid
                    AND p~cityfrom = p_cityfr.
        

        For subqueries

        SELECT  carrname
          INTO  TABLE name_tab
          FROM  scarr
          WHERE EXISTS ( select  *
                           FROM  spfli
                           WHERE carrid   =  scarr~carrid AND
                                 cityfrom = 'NEW YORK'        ).
        
          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