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. Standard tables should be searched using "BINARY SEARCH"

           Code Smell
        2. "SY-SUBRC" should be checked after an "AUTHORITY-CHECK" statement

           Vulnerability
        3. Authorization checks should not rely on hardcoded user properties

           Vulnerability
        4. Using weak hashing algorithms is security-sensitive

           Security Hotspot
        5. Using shell interpreter when executing OS commands is security-sensitive

           Security Hotspot
        6. "WHEN OTHERS" clauses should be last

           Code Smell
        7. All branches in a conditional structure should not have exactly the same implementation

           Bug
        8. Cognitive Complexity of functions should not be too high

           Code Smell
        9. "LIKE" clauses should not be used without wildcards

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

           Bug
        11. Jump statements should not be redundant

           Code Smell
        12. Using "CALL TRANSACTION" statements without an authority check is security-sensitive

           Security Hotspot
        13. "JOIN" should be used instead of nested "SELECT" statements

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

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

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

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

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

           Bug
        19. Hard-coded credentials are security-sensitive

           Security Hotspot
        20. Two branches in a conditional structure should not have exactly the same implementation

           Code Smell
        21. Related "if/else if" statements should not have the same condition

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

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

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

           Code Smell
        25. Unnecessary chain syntax should not be used

           Code Smell
        26. Asterisks should be used for headers and to comment out code

           Code Smell
        27. "CX_ROOT" should not be caught

           Code Smell
        28. "CATCH" clauses should not be empty

           Vulnerability
        29. An internal table should be sorted before duplicates are deleted

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

           Bug
        31. Mass operations should be used with internal tables instead of loops

           Code Smell
        32. "SORTED" or "HASHED" internal tables should be accessed with a key

           Code Smell
        33. Keywords should not be used as variable names

           Code Smell
        34. Operational statements should not be chained

           Bug
        35. Variables should not be self-assigned

           Bug
        36. "FORM... ENDFORM" and "PERFORM" should not be used

           Code Smell
        37. "NOT IN" should not be used

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

           Code Smell
        39. Macros should be documented

           Code Smell
        40. Functions should be documented

           Code Smell
        41. Forms should be documented

           Code Smell
        42. Classes should be documented

           Code Smell
        43. "DATA" variable names should comply with a naming convention

           Code Smell
        44. Report names should comply with a naming convention

           Code Smell
        45. Macro names should comply with a naming convention

           Code Smell
        46. Function names should comply with a naming convention

           Code Smell
        47. Cyclomatic Complexity of functions should not be too high

           Code Smell
        48. "REFRESH itab FROM TABLE" should not be used

           Code Smell
        49. "%_HINTS" should not be used

           Code Smell
        50. "SY-SUBRC" should be tested after each statement setting it.

           Code Smell
        51. Form names should comply with a naming convention

           Code Smell
        52. Internal source code processing statements should not be used

           Code Smell
        53. System C functions should not be used

           Code Smell
        54. Native SQL should not be statically embedded

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

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

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

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

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

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

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

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

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

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

           Security Hotspot
        65. "REFRESH itab" should not be used

           Code Smell
        66. "SYSTEM-CALL" statement should not be used

           Code Smell
        67. "BREAK-POINT" statement should not be used in production

           Vulnerability
        68. "DATA BEGIN OF OCCURS" should not be used

           Code Smell
        69. Unused local variables should be removed

           Code Smell
        70. Loops should not contain more than a single "CONTINUE", "EXIT", "CHECK" statement

           Code Smell
        71. Control flow statements "IF", "CASE", "DO", "LOOP", "SELECT", "WHILE" and "PROVIDE" should not be nested too deeply

           Code Smell
        72. Cyclomatic Complexity of methods should not be too high

           Code Smell
        73. Using hardcoded IP addresses is security-sensitive

           Security Hotspot
        74. Cyclomatic Complexity of classes should not be too high

           Code Smell
        75. "CASE" statements should have "WHEN OTHERS" clauses

           Code Smell
        76. "CASE statements should have at least 3 "WHEN" clauses

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

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

           Code Smell
        79. Subroutine parameters should be passed by reference rather than by value

           Code Smell
        80. Statements should be on separate lines

           Code Smell
        81. String literals should not be duplicated

           Code Smell
        82. Interface names should comply with a naming convention

           Code Smell
        83. "DELETE FROM dbtab" statements should have a "WHERE" clause

           Bug
        84. SQL EXISTS subqueries should not be used

           Code Smell
        85. Redundant pairs of parentheses should be removed

           Code Smell
        86. Magic numbers should not be used

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

           Code Smell
        88. Expressions should not be too complex

           Code Smell
        89. Mergeable "if" statements should be combined

           Code Smell
        90. Tabulation characters should not be used

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

           Code Smell
        92. Lines should not be too long

           Code Smell
        93. Class names should comply with a naming convention

           Code Smell
        94. Method names should comply with a naming convention

           Code Smell

        "DELETE FROM dbtab" statements should have a "WHERE" clause

        intentionality - clear
        reliability
        Bug
        • sql

        Why is this an issue?

        DELETE FROM dbtab without a WHERE condition deletes all the entries of the table. Check whether dataset to be deleted can be limited by a suitable WHERE condition.

        Noncompliant code example

        DELETE FROM COUNTRIES.
        

        Compliant solution

        DELETE FROM COUNTRIES WHERE CODE = country_code.
        
          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