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
  • GroovyGroovy
  • 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
Groovy

Groovy static code analysis

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

  • All rules 21
  • Bug5
  • Code Smell16
Filtered: 3 rules found
convention
    Impact
      Clean code attribute
        1. Semicolons should be omitted in Groovy

           Code Smell
        2. Control structures should use braces

           Code Smell
        3. Star imports should be replaced with explicit imports

           Code Smell

        Semicolons should be omitted in Groovy

        consistency - conventional
        maintainability
        Code Smell
        • convention

        This rule raises an issue when a semicolon is found at the end of a statement in Groovy code.

        Why is this an issue?

        How can I fix it?

        More Info

        Groovy is designed to be more concise and readable than Java. One of its key features is that semicolons are optional at the end of statements.

        Using semicolons in Groovy code goes against the language’s conventions and style guidelines. The official Groovy style guide explicitly recommends omitting semicolons to make code more idiomatic and cleaner.

        When developers come from Java or other C-style languages, they often carry over the habit of using semicolons everywhere. However, in Groovy, this creates unnecessary visual noise and makes the code less idiomatic.

        Removing semicolons helps achieve:

        • More readable and cleaner code
        • Better adherence to Groovy conventions
        • Consistency with idiomatic Groovy style
        • Reduced visual clutter

        What is the potential impact?

        The impact is primarily on code maintainability and readability. While semicolons don’t cause functional issues, they make the code less idiomatic and can indicate that the developer is not following Groovy best practices.

        Code with unnecessary semicolons may:

        • Appear less professional to Groovy developers
        • Create inconsistency in codebases where some files follow Groovy conventions and others don’t
        • Make the code harder to read due to visual noise
          Available In:
        • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories

        © 2026 SonarSource Sàrl. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use