-
Notifications
You must be signed in to change notification settings - Fork 176
Refactor Java Code Quality Analyzer #9654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-java-sdk/readme.md
Outdated
Show resolved
Hide resolved
PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-java-sdk/readme.md
Outdated
Show resolved
Hide resolved
PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-java-sdk/readme.md
Outdated
Show resolved
Hide resolved
...java/com/microsoft/azure/toolkit/intellij/java/sdk/analyzer/AbstractLibraryVersionCheck.java
Outdated
Show resolved
Hide resolved
...java/com/microsoft/azure/toolkit/intellij/java/sdk/analyzer/IncompatibleDependencyCheck.java
Outdated
Show resolved
Hide resolved
...n-java-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/MavenUtils.java
Outdated
Show resolved
Hide resolved
...-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/RuleConfigLoader.java
Outdated
Show resolved
Hide resolved
...-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/RuleConfigLoader.java
Outdated
Show resolved
Hide resolved
...-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/RuleConfigLoader.java
Outdated
Show resolved
Hide resolved
...-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/RuleConfigLoader.java
Outdated
Show resolved
Hide resolved
...in/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/RuleConfigLoaderInitializer.java
Outdated
Show resolved
Hide resolved
...-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/RuleConfigLoader.java
Outdated
Show resolved
Hide resolved
...-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/RuleConfigLoader.java
Outdated
Show resolved
Hide resolved
...-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/RuleConfigLoader.java
Outdated
Show resolved
Hide resolved
...-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/utils/RuleConfigLoader.java
Outdated
Show resolved
Hide resolved
...-java-sdk/src/main/java/com/microsoft/azure/toolkit/intellij/java/sdk/models/RuleConfig.java
Outdated
Show resolved
Hide resolved
@@ -31,7 +32,7 @@ public class DynamicClientCreationCheck extends LocalInspectionTool { | |||
@NotNull | |||
@Override | |||
public JavaElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) { | |||
return new DynamicClientCreationVisitor(holder, RuleConfigLoader.getInstance()); | |||
return new DynamicClientCreationVisitor(holder, RuleConfigLoader.getInstance().getRuleConfigs()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure, do you know if this could run prior to ProjectActivity
? If that's the case, there might be a NPE, given that INSTANCE
might not have initialized yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did do a runIde for testing this strategy. It does seem to be working as expected.
Also, from the documentation here, <postStartupActivity/>
is executed after project initialization but before the first UI interaction. So, it should be safe relying on the project being fully initialized can safely execute logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this implement/fix? Explain your changes.
This PR includes changes for Azure Toolkit for IntelliJ's Code Quality Analyzer to integrate rule sets for flagging and making better Azure SDK usage.
Integrated Rule Sets:
Storage:
Identity & Security:
DefaultAzureCredential
instead.Asynchronous Programming:
SyncPoller
instead ofPollerFlux#getSyncPoller()
for simplicity.Messaging (AMQP & Service Bus):
ServiceBusProcessorClient
overServiceBusReceiverAsyncClient
.EventProcessorClient
for checkpoint management.General Best Practices:
getChatCompletions
overgetCompletions
.Does this close any currently open issues?
Closes open Pull Request #8584
Any relevant logs, screenshots, error output, etc.?
DisableAutoComplete check for ServiceBus

Prefer EventProcessorClient instead of EventHubConsumerAsyncClient
Any other comments?
…
Has this been tested?