Top 5 IntelliJ Plugins to Boost Code Quality & Catch Bugs Early

This article reviews five IntelliJ IDEA plugins—Alibaba Java Coding Guidelines, CheckStyle, PMD, FindBugs, and SonarLint—detailing their installation, usage, and strengths for enforcing coding standards, detecting bugs, and improving code quality in Java projects.

Java Architect Handbook
Java Architect Handbook
Java Architect Handbook
Top 5 IntelliJ Plugins to Boost Code Quality & Catch Bugs Early

Why Code Quality Tools Matter

As systems grow, complexity and hidden risks increase. Code reviews help but are labor‑intensive and error‑prone. Automated static‑analysis plugins reduce review workload and improve code quality continuously.

1. Alibaba Java Coding Guidelines

Overview

Enforces the Alibaba Java coding standards. Scans code and reports violations at three severity levels: Blocker > Critical > Major. Most issues can be auto‑fixed. Provides real‑time inspection while typing.

Rule Categories

OOP conventions

Concurrency handling

Control statements

Naming conventions

Constant definitions

Comment standards

Installation

File > Settings > Plugins > Marketplace

→ search "Alibaba Java Coding Guidelines" → install → restart IDE.

Usage

Run scan: Tools > 阿里编码规约 > 编码规约扫描 or right‑click project/file → "编码规约扫描".

Toggle real‑time detection (recommended for powerful machines).

Switch language (Chinese/English).

Results & Toolbar

Results grouped by severity. Toolbar actions: Rerun Inspection, Close, Expand All, Collapse All, Go Pre/Next Problem, Help, Group by Severity, Group by Directory, Filter resolved items, Autoscroll to Source, Export (XML/HTML), Edit Settings.

Scan via Tools menu
Scan via Tools menu
Right‑click scan
Right‑click scan
Scan results with Blocker, Critical, Major
Scan results with Blocker, Critical, Major
Selected issue detail
Selected issue detail
Scope selection for same‑type issues
Scope selection for same‑type issues
All same‑type issues in project
All same‑type issues in project
Preview non‑compliant code
Preview non‑compliant code
Toolbar overview
Toolbar overview

2. CheckStyle

Overview

Focuses on code formatting and style: naming, Javadoc, whitespace, method length, duplicate code, unused imports. Purely syntactic; almost no bug detection.

Bundles two strict default configs (Sun Checks) that flag even well‑known open‑source projects. Custom config files are usually required.

Installation

File > Settings > Plugins > Marketplace

→ search "CheckStyle" → install → restart.

Results

CheckStyle results showing indentation and style issues
CheckStyle results showing indentation and style issues

Mostly indentation and formatting warnings; can be deprioritized.

3. PMD

Overview

Targets secure coding rules with data‑flow and path analysis. Stronger than CheckStyle. Supports custom rules. Built‑in rules cover:

Potential bugs : empty try/catch/finally/switch blocks.

Dead code : unused variables, parameters, private methods.

Suboptimal code : String/StringBuffer misuse.

Complex expressions : unnecessary if, for replaceable by while.

Duplicate code : copy‑paste duplicates.

Object creation in loops : avoid instantiating inside loops.

Resource closing : ensure Connection, ResultSet, Statement are closed.

Installation

File > Settings > Plugins > Marketplace

→ search "PMDPlugin" → install → restart.

Running

Tools > Run PMD

scans whole project.

Right‑click file/editor → "Run PMD" scans selected scope.

Run PMD menu with Pre Defined and Custom Rules
Run PMD menu with Pre Defined and Custom Rules

Choose Pre Defined (built‑in rule sets) or Custom Rules (imported rule files).

Results

PMD result panel with toolbar and issue list
PMD result panel with toolbar and issue list

Click an issue to jump to source.

Configuration

File > Settings > Other Settings > PMD

→ RuleSets tab to manage custom rule files. Options tab includes Skip TestSource to ignore generated test code.

PMD RuleSets settings
PMD RuleSets settings
Options tab with Skip TestSource highlighted
Options tab with Skip TestSource highlighted
Skip TestSource filtering example
Skip TestSource filtering example

4. FindBugs

Overview

Specializes in bug detection: runtime errors (null pointers, unclosed resources, incorrect string comparison == vs equals()). Provides quick‑fix suggestions.

Installation

File > Settings > Plugins > Marketplace

→ search "FindBugs" → install → restart.

Usage

Right‑click file, package, module, or project → "FindBugs" → analyze.

FindBugs context menu
FindBugs context menu

Results

FindBugs result panel
FindBugs result panel

Click an item to locate the exact code.

Code location for selected bug
Code location for selected bug

Bug Categories

Bad practice – coding anti‑patterns.

Dodgy code – confusing/erroneous constructs.

Internationalization – i18n issues.

Performance – inefficiencies.

Experimental – new detectors.

Malicious code vulnerability – security flaws.

Multithreaded correctness – concurrency bugs.

Correctness – general logic errors.

Bad practice category
Bad practice category
Dodgy code category
Dodgy code category
Internationalization category
Internationalization category
Performance category
Performance category
Experimental category
Experimental category
Malicious code vulnerability category
Malicious code vulnerability category
Multithreaded correctness category
Multithreaded correctness category
Correctness category
Correctness category

5. SonarLint

Overview

Operates at a higher level than FindBugs. Checks not only static bugs but also code quality, package/class dependencies, coupling, complexity, duplication – overall project health. Two modes: local plugin (self‑review) and SonarQube server (team review).

Installation

File > Settings > Plugins > Marketplace

→ search "SonarLint" → install → restart.

Local Analysis

Right‑click project/file → SonarLint → analyze. Results show issues with suggested fixes.

SonarLint context menu
SonarLint context menu
SonarLint report with suggestions
SonarLint report with suggestions

Server‑Bound Configuration

Configure Sonar server : Add connection → Configuration Name, server URL, Login/Password.

Bind project : Choose server connection → Search in list → select project.

Analyze : Same right‑click flow; optionally enable Perform Sonarlint analysis on commit.

Sonar server configuration dialog
Sonar server configuration dialog
Enter server credentials
Enter server credentials
Search and bind project
Search and bind project
Commit‑time SonarLint analysis checkbox
Commit‑time SonarLint analysis checkbox

Summary & Recommendations

Coding standards : Use Alibaba Java Coding Guidelines alone.

Bug hunting : Combine PMD, FindBugs, SonarLint for complementary coverage: PMD – strong custom‑rule engine, ideal for project‑specific bug patterns. FindBugs – excellent general bug detector; findings useful for onboarding/training. SonarLint – richer rule set, broader scenario coverage than FindBugs.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Code QualityIntelliJ IDEAstatic analysisPMDCheckStyleFindBugsSonarLintAlibaba Java Coding Guidelines
Java Architect Handbook
Written by

Java Architect Handbook

Focused on Java interview questions and practical article sharing, covering algorithms, databases, Spring Boot, microservices, high concurrency, JVM, Docker containers, and ELK-related knowledge. Looking forward to progressing together with you.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.