Code
- 'ProcessCanceledException' handled incorrectly
Reports ProcessCanceledExceptions handled in an incorrect way.
- 'UastHintedVisitorAdapter' hints problems
Reports missing or redundant hints in UastHintedVisitorAdapter creation.
- A service can be converted to a light one
Reports classes that can be marked as light services using the @com.intellij.openapi.components.Service annotation instead of being registered as services in plugin.xml A service that is not intended for overriding is not required to be registered in the plugin.xml file.
- Accessible context is missing
Reports Swing components that do not provide accessibility context.
- ActionUpdateThread is missing
Reports actions, action groups and other ActionUpdateThreadAware classes that implicitly state the deprecated and costly ActionUpdateThread.OLD_EDT mode.
- Application service assigned to a static final field or immutable property
Reports assignments of application services to static final fields / immutable properties.
- Calling method should be annotated with @RequiresBlockingContext
Highlights calls of method annotated with @RequiresBlockingMethod inside non-annotated method.
- Cancellation check in loops
Reports loops, forEach-like methods, and ContainerUtil.process() with missing cancellation checks.
- Companion object in extensions
Reports incorrect companion objects' usage in extensions.
- Component type mismatch
Reports incorrect registration of plugin components (Actions and Components).
- Component/Action not registered
Reports plugin components and actions that are not registered in a plugin.xml descriptor.
- Eager creation of action presentation
Reports any actions that are registered in the plugin.xml file and instantiate the com.intellij.openapi.actionSystem.Presentation object in their constructors.
- Extension class should be final and non-public
Reports extension classes that are non-final or public.
- Extension registered as service/component
Reports extension implementation being additionally registered as a service/component.
- Field blocks intention preview
Reports fields in LocalQuickFix and IntentionAction implementations that prevent intention preview action from functioning properly.
- File.equals() usage
Reports usages of java.io.File.equals()/hashCode()/compareTo() methods.
- Forbidden in suspend context method usage
Reports inappropriate usages of methods in Kotlin coroutines, which uses threading context (annotated with @RequiresBlockingContext).
- Incorrect parentDisposable parameter
Reports using Application or Project as a parent Disposable in plugin code.
- Incorrect service retrieving
Reports the following problems when retrieving services: Attempts to retrieve an unregistered service.
- Invalid icon path in @Presentation
Reports invalid and deprecated value for icon attribute in com.intellij.ide.presentation.Presentation annotation.
- Kotlin object registered as extension
Reports Kotlin objects that are registered as plugin extensions.
- Light service must be final
Reports classes annotated with the @com.intellij.openapi.components.Service annotation that are not final.
- Listener implementation implements 'Disposable'
Reports listener implementations that implement com.intellij.openapi.Disposable.
- Map key may leak
Reports using Language or FileType as a map key in plugin code.
- Migrate to getOptionPane()
Reports createOptionsPanel() methods in inspection implementation, which can be automatically converted to getOptionsPane().
- Mismatch between light service level and its constructor
Reports mismatches between light service levels and its constructors.
- Non-default constructor in serializable class
Reports non-default constructor in serializable classes.
- Non-default constructors for service and extension class
Reports extension/service class having a non-default (empty) constructor.
- Non-platform TokenSet declared in ParserDefinition
Reports TokenSet field declarations referencing non-platform element types in ParserDefinition classes.
- QuickFix's getFamilyName() implementation must not depend on a specific context
Reports QuickFix.getFamilyName() using contextual information.
- Read or Write Action run during service initialization
Reports read and write actions run from the scope of service initialization: service constructors and initialization blocks (including static) service companion object's initialization blocks (Kotlin) service methods used in initialization blocks and fields initialization PersistentStateComponent initialization lifecycle methods: loadState noStateLoaded initializeComponent Running a read or write action during service initialization may cause deadlocks.
- Simplifiable service retrieving
Reports service getting calls that can be replaced with a calls to an existing static getInstance() or getInstance(Project) methods.
- Stateful extension
Reports extensions and quick-fixes holding potentially leaking state.
- Static initialization in extension point implementations
Reports static initialization in extension point implementations.
- Threading and concurrency problems
Reports threading and concurrency issues in code using information from com.intellij.util.concurrency.annotations annotations.
- UElement as PsiElement usage
Reports usage of UAST UElement as PsiElement.
- Undesirable class usage
Reports usages of undesirable classes (mostly Swing components).
- Unresolved plugin configuration reference
Reports unresolved references to plugin configuration elements.
- Unsafe VFS recursion
Reports usage of VirtualFile.getChildren() inside recursive methods.
- Unsafe return statements visitor
Reports unsafe use of JavaRecursiveElementVisitor.visitReturnStatement().
- Unspecified action place
Reports passing unspecified place parameter for ActionManager.createActionToolbar() and ActionManager.createActionPopupMenu().
- Usage of IntelliJ API not available in older IDEs
Reports usages of IntelliJ Platform API introduced in a version newer than the one specified in <idea-version> @since-build in plugin.xml.
- Use 'PluginId#equals(Object)'
Reports comparing PluginId instances using ==.
- Use 'PsiType#equals(Object)' with primitive types
Reports comparing PsiPrimitiveType instances using ==.
- Use 'VirtualFile#equals(Object)'
Reports comparing VirtualFile instances using ==.
- Use 'com.intellij.util.io.ProcessKt.awaitExit()'
Reports usages of Process.waitFor() and Process.onExit() in coroutine context.
- Use DPI-aware borders
Reports usages of javax.swing.border.EmptyBorder and JBUI.Borders.emptyXyz() that can be simplified.
- Use DPI-aware insets
Reports usages of java.awt.Insets and JBUI.insetsXyz() that can be simplified.
- Use Darcula aware JBColor
Reports usages of java.awt.Color.
- Using PsiElement string representation to generate new expression is incorrect
Reports direct usage of PsiElement and PsiType in strings.
- Using new Color(a,a,a)
Reports usages of java.awt.Color to create gray colors.