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
VB.NET

VB.NET static code analysis

Unique rules to find Bugs, Vulnerabilities, Security Hotspots, and Code Smells in your VB.NET code

  • All rules 238
  • Vulnerability34
  • Bug44
  • Security Hotspot16
  • Code Smell144

  • Quick Fix 11
 
Tags
    Impact
      Clean code attribute
        1. Locks should be released within the same method

           Bug
        2. A write lock should not be released when a read lock has been acquired and vice versa

           Bug
        3. Backslash should be avoided in route templates

           Bug
        4. Regular expressions should be syntactically valid

           Bug
        5. Non-async "Task/Task<T>" methods should not return null

           Bug
        6. Calls to delegate's method "BeginInvoke" should be paired with calls to "EndInvoke"

           Bug
        7. "PartCreationPolicyAttribute" should be used with "ExportAttribute"

           Bug
        8. "Shared" parts should not be created with "new"

           Bug
        9. Property procedures should access the expected fields

           Bug
        10. "ConstructorArgument" parameters should exist in constructors

           Bug
        11. Windows Forms entry points should be marked with STAThread

           Bug
        12. Classes should implement their "ExportAttribute" interfaces

           Bug
        13. Empty collections should not be accessed or iterated

           Bug
        14. Map values should not be replaced unconditionally

           Bug
        15. Collection sizes and array length comparisons should make sense

           Bug
        16. Calculations should not overflow

           Bug
        17. Serialization event handlers should be implemented correctly

           Bug
        18. Deserialization methods should be provided for "OptionalField" members

           Bug
        19. All branches in a conditional structure should not have exactly the same implementation

           Bug
        20. Types should be defined in named namespaces

           Bug
        21. "Thread.Resume" and "Thread.Suspend" should not be used

           Bug
        22. "SafeHandle.DangerousGetHandle" should not be called

           Bug
        23. Empty nullable value should not be accessed

           Bug
        24. Methods with "Pure" attribute should return a value

           Bug
        25. One-way "OperationContract" methods should have "void" return type

           Bug
        26. Optional parameters should be passed to "base" calls

           Bug
        27. Type inheritance should not be recursive

           Bug
        28. Classes should not have only "private" constructors

           Bug
        29. Right operands of shift operators should be integers

           Bug
        30. Date and time should not be used as a type for primary keys

           Bug
        31. 'Not' boolean operator should not be repeated

           Bug
        32. Non-existent operators like "=+" should not be used

           Bug
        33. Conditionally executed code should be reachable

           Bug
        34. Shared resources should not be used for locking

           Bug
        35. Flags enumerations should explicitly initialize all their members

           Bug
        36. Null pointers should not be dereferenced

           Bug
        37. "ToString()" method should not return Nothing

           Bug
        38. Locks should be released on all paths

           Bug
        39. Related "If/ElseIf" statements should not have the same condition

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

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

           Bug
        42. Variables should not be self-assigned

           Bug
        43. Method parameters and caught exceptions should not be reassigned

           Bug
        44. Finalize method should not throw exceptions

           Bug

        Calls to delegate's method "BeginInvoke" should be paired with calls to "EndInvoke"

        intentionality - complete
        reliability
        Bug

          Why is this an issue?

          How can I fix it?

          More Info

          When calling the BeginInvoke method of a delegate, resources are allocated that are only freed up when EndInvoke is called. Failing to pair BeginInvoke with EndInvoke can lead to resource leaks and incomplete asynchronous calls.

          This rule raises an issue in the following scenarios:

          • The BeginInvoke method is called without any callback, and it is not paired with a call to EndInvoke in the same block.
          • A callback with a single parameter of type IAsyncResult does not contain a call to EndInvoke in the same block.
            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 Community BuildAnalyze code in your
            on-premise CI
            Available Since
            9.1
          • SonarQube ServerAnalyze code in your
            on-premise CI
            Developer Edition
            Available Since
            9.1

          © 2026 SonarSource Sàrl. All rights reserved.

          Privacy Policy | Cookie Policy | Terms of Use