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
Ruby

Ruby static code analysis

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

  • All rules 75
  • Bug17
  • Security Hotspot2
  • Code Smell56
Filtered: 1 rule found
sql
    Impact
      Clean code attribute
        1. Column names should not use SQL reserved words

           Bug

        Column names should not use SQL reserved words

        intentionality - clear
        reliability
        maintainability
        Bug
        • sql
        • database
        • portability

        This rule raises an issue when database column names use SQL reserved words like "release", "order", "group", or "select".

        Why is this an issue?

        How can I fix it?

        More Info

        SQL reserved words are special keywords that have specific meanings in SQL syntax. When you use them as column names, database engines can become confused about whether you’re referring to the column or trying to use the SQL command.

        This confusion leads to several problems:

        • Syntax errors: Queries may fail to parse correctly, causing runtime errors
        • Escaping requirements: You need to wrap column names in backticks or quotes, making queries harder to read
        • Database portability issues: Different databases have different reserved word lists, so code may work on one database but fail on another
        • Developer confusion: Other team members may struggle to understand why certain queries need special escaping

        The issue is particularly common with words like "order" (used for sorting), "group" (used for grouping), "release" (sounds like a good column name but conflicts with transaction commands), and "select" (the most basic SQL command).

        What is the potential impact?

        Using SQL reserved words as column names can cause application crashes when queries fail to parse. This creates reliability issues and can lead to unexpected downtime. The problem may not surface immediately during development but can appear later when more complex queries are written, making it harder to debug and fix.

          Available In:
        • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories

        © 2008-2025 SonarSource SA. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use