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
 
Tags
    Impact
      Clean code attribute
        1. GString expressions should not be used as map keys

           Bug
        2. "@TimedInterrupt" should not be used on static methods

           Bug
        3. Null checks should use correct logical operators

           Bug
        4. Classes with a "clone()" method should implement "Cloneable"

           Bug
        5. "wait()" calls should be inside "while" loops

           Bug

        "@TimedInterrupt" should not be used on static methods

        intentionality - logical
        reliability
        Bug

          This is an issue when the @TimedInterrupt annotation is applied to a static method.

          Why is this an issue?

          How can I fix it?

          More Info

          The @TimedInterrupt annotation is designed to automatically add timeout checks to methods by inserting interruption checks at strategic points in the code. However, this transformation is currently not compatible with static methods due to implementation limitations in how the transformation processes method contexts.

          When @TimedInterrupt is applied to a static method, it can lead to unexpected behavior or compilation issues because the transformation logic assumes instance method semantics. The annotation works by injecting timeout verification code that may not function correctly in a static context, potentially causing the timeout mechanism to fail silently or throw unexpected exceptions.

          This incompatibility can result in unreliable timeout behavior, making it difficult to control long-running static operations as intended.

          What is the potential impact?

          Using @TimedInterrupt on static methods can lead to:

          • Unreliable timeout behavior where the intended time limits are not enforced
          • Potential compilation errors or runtime exceptions
          • Silent failures where the timeout mechanism doesn’t work as expected
          • Difficulty in controlling long-running static operations
          • Unpredictable application behavior when timeouts should have been triggered
            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