{"id":3388,"date":"2025-04-18T10:49:56","date_gmt":"2025-04-18T17:49:56","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sdk\/?p=3388"},"modified":"2025-04-18T10:49:56","modified_gmt":"2025-04-18T17:49:56","slug":"azure-toolkit-for-intellij-introducing-the-enhanced-java-code-quality-analyzer","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sdk\/azure-toolkit-for-intellij-introducing-the-enhanced-java-code-quality-analyzer\/","title":{"rendered":"Azure Toolkit for IntelliJ: Introducing the enhanced Java Code Quality Analyzer!"},"content":{"rendered":"<p>We&#8217;re thrilled to unveil a major update to the Azure Toolkit for IntelliJ\u2014the enhanced Java Code Quality Analyzer! This update introduces powerful rule sets designed to help you write cleaner, safer, and more efficient Java code when working with Azure SDK for Java client libraries.<\/p>\n<h2>\ud83d\ude80 What&#8217;s new?<\/h2>\n<h3>Azure SDK for Java integration<\/h3>\n<p>The latest Azure Toolkit for IntelliJ release integrates the newest Azure SDK for Java, offering categorized rule sets that provide real-time suggestions and best practices tailored for Azure SDK usage. Key enhancements include:<\/p>\n<ul>\n<li><strong>Simplified authentication flows<\/strong>: Integrated support to guide developers toward more secure and robust authentication mechanisms, such as <code>DefaultAzureCredential<\/code> and <code>ManagedIdentityCredential<\/code>, when working with the Azure Identity library (<code>com.azure:azure-identity<\/code>).<\/li>\n<li><strong>Improved performance and reliability<\/strong>: Suggestions for using performant APIs, such as <code>SyncPoller<\/code> or use of <code>EventProcessorClient<\/code>, enabling you to optimize internal library calls, reduce latency, and minimize memory footprint.<\/li>\n<li><strong>Modern API patterns and best practices<\/strong>: Recommendations for adopting the latest API conventions, using performant APIs, avoiding complex reactive chaining, and ensuring efficient asynchronous programming.<\/li>\n<\/ul>\n<p>These features are available starting with Azure Toolkit for IntelliJ version <strong>3.95.0<\/strong>.<\/p>\n<h3>\ud83d\udce6 Storage improvements<\/h3>\n<p><strong>Prevent memory issues<\/strong>: Flags improper usage of Storage Upload APIs that don&#8217;t specify a length parameter, helping you avoid potential memory leaks and performance bottlenecks. It recommends explicitly specifying the length parameter or using <code>BlockBlobClient<\/code> for large uploads.<\/p>\n<h3>\ud83d\udd10 Identity &amp; security enhancements<\/h3>\n<h4>Secure authentication<\/h4>\n<ul>\n<li><strong>Avoid hardcoded API keys<\/strong>: Detects hardcoded API keys and suggests using <code>DefaultAzureCredential<\/code> for secure, managed authentication to Microsoft Entra ID.<img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-content\/uploads\/sites\/58\/2025\/04\/04-15-hardcoded-api-keys-check.png\" alt=\"hardcoded-api-keys-check\" \/><\/li>\n<li><strong>Connection string alternatives<\/strong>: Identifies connection string usage and recommends transitioning to Microsoft Entra ID credentials for enhanced security.<\/li>\n<\/ul>\n<h3>\u26a1 Asynchronous programming best practices<\/h3>\n<ul>\n<li><strong>Simplified polling<\/strong>: Recommends <code>SyncPoller<\/code> for synchronous polling operations, which simplifies code readability and reduces complexity compared to <code>PollerFlux#getSyncPoller()<\/code>.<\/li>\n<li><strong>Avoid blocking calls<\/strong>: Flags improper usage of blocking calls made on asynchronous methods, promoting nonblocking programming principles for better scalability and improving responsiveness.<img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-content\/uploads\/sites\/58\/2025\/04\/04-15-block-over-async-check.png\" alt=\"block-over-async-check\" \/><\/li>\n<li><strong>Reactive streams optimization<\/strong>: Highlights opportunities to optimize reactive streams by chaining operators like <code>block<\/code> and <code>subscribe<\/code> to improve performance and reduce memory overhead.<\/li>\n<li><strong>Timeout management<\/strong>: Identifies asynchronous calls lacking timeout configurations and recommends using APIs like <code>timeout(Duration)<\/code> to avoid indefinite waits, enhance reliability, and improve application responsiveness.<\/li>\n<\/ul>\n<h3>\ud83d\udcec Messaging (AMQP &amp; Service Bus) recommendations<\/h3>\n<ul>\n<li><strong>Service Bus client recommendation<\/strong>: Suggests replacing <code>ServiceBusReceiverAsyncClient<\/code> with <code>ServiceBusProcessorClient<\/code> for better concurrency management, built-in retry mechanisms, and simplified message processing.<\/li>\n<li><strong>Event Hub client recommendation<\/strong>: Detects the usage of <code>EventHubConsumerAsyncClient<\/code> and suggests using <code>EventProcessorClient<\/code> for streamlined event processing, automatic load balancing, and improved reliability.<img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-content\/uploads\/sites\/58\/2025\/04\/04-15-eventhub-consumer-client-check.png\" alt=\"eventhub-consumer-client-check\" \/><\/li>\n<li><strong>Avoid message loss<\/strong>: Flags scenarios where autocomplete is enabled by default in Service Bus clients, recommends disabling it (<code>disableAutoComplete()<\/code>). Ensuring messages are explicitly acknowledged only after successful processing, preventing accidental completion, and potential data loss.<\/li>\n<li><strong>Efficient checkpoint management<\/strong>: Encourages using <code>EventProcessorClient<\/code> for streamlined checkpoint management and suggests replacing suboptimal <code>updateCheckpointAsync<\/code> usage with synchronous alternatives.<\/li>\n<\/ul>\n<h3>\ud83c\udf1f General best practices<\/h3>\n<ul>\n<li><strong>Batch operations<\/strong>: Promotes batching operations instead of single operations within loops for improved performance.<\/li>\n<li><strong>Optimized Azure OpenAI usage<\/strong>: Recommends using <code>getChatCompletions<\/code> instead of <code>getCompletions<\/code> to achieve better performance and accuracy when working with Azure OpenAI services.<\/li>\n<li><strong>Dynamic client creation check<\/strong>: Identifies cases where client objects are dynamically created using methods like <code>buildClient<\/code> or <code>buildAsyncClient<\/code>. It recommends creating a single instance and reusing it to enhance performance and optimize resource management.\nThese enhancements empower developers to write robust, scalable, and maintainable asynchronous code while using Azure SDK libraries effectively.<\/li>\n<\/ul>\n<h2>\ud83c\udfaf Why it matters<\/h2>\n<ul>\n<li><strong>Real-time feedback<\/strong>: Instantly identify and fix potential issues as you code.<\/li>\n<li><strong>Improved code quality<\/strong>: Write cleaner, safer, and more maintainable Java code.<\/li>\n<li><strong>Optimized Azure SDK usage<\/strong>: Use best practices tailored specifically for Azure services.<\/li>\n<\/ul>\n<h2>\ud83d\udea6 Get started<\/h2>\n<p>Ready to enhance your Java development experience?<\/p>\n<ol>\n<li>Update your Azure Toolkit for IntelliJ to the latest version.<\/li>\n<li>Open your Java project in IntelliJ IDEA.<\/li>\n<li>Start coding and receive real-time suggestions!<\/li>\n<\/ol>\n<h2>\ud83d\udcda Learn more<\/h2>\n<ul>\n<li><a href=\"https:\/\/learn.microsoft.com\/azure\/developer\/java\/toolkit-for-intellij\/\">Azure Toolkit for IntelliJ Documentation<\/a><\/li>\n<li><a href=\"https:\/\/aka.ms\/azsdk\/java\/bestpractices\">Azure SDK for Java Best Practices<\/a><\/li>\n<\/ul>\n<p>We&#8217;re committed to enhancing your Azure development experience. Try the enhanced Azure Toolkit for Java Code Quality Analyzer today and share your feedback!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Discover the latest updates to the Azure Toolkit for IntelliJ, featuring an enhanced Java Code Quality Analyzer to help you write cleaner, safer, and more efficient Java code with Azure SDK client libraries.<\/p>\n","protected":false},"author":31979,"featured_media":3389,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[942,750,943,838,160],"class_list":["post-3388","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-sdk","tag-azure-toolkit","tag-azure-sdk","tag-code-quality","tag-intellij","tag-java"],"acf":[],"blog_post_summary":"<p>Discover the latest updates to the Azure Toolkit for IntelliJ, featuring an enhanced Java Code Quality Analyzer to help you write cleaner, safer, and more efficient Java code with Azure SDK client libraries.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/users\/31979"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/comments?post=3388"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3388\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media\/3389"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media?parent=3388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/categories?post=3388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/tags?post=3388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}