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

        Star imports should be replaced with explicit imports

        intentionality - clear
        maintainability
        Code Smell
        • convention

        This rule raises an issue when a star import (import package.*) is used to import all classes from a package.

        Why is this an issue?

        How can I fix it?

        More Info

        Star imports bring all public classes from a package into the local namespace, which creates several problems:

        Namespace pollution: Star imports clutter the local namespace with many classes that may not be used, making it harder to understand which classes are actually needed.

        Unclear dependencies: When reading code, it becomes difficult to determine which specific classes come from which packages, reducing code readability and making maintenance more challenging.

        Potential naming conflicts: If multiple packages contain classes with the same name, star imports can lead to ambiguous references and compilation errors.

        IDE performance: Some development environments may experience slower performance when processing large numbers of imported classes.

        Explicit imports make code dependencies clear and help maintain a clean, understandable codebase.

          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