jSparrow plug-in developed for Java refactoring
jSparrow is an IDE extension that helps you detect and fix quality problems as you write code. jSparrow flags errors, similar to a spell checker, indicating that they can be fixed with jSparrow before committing code.
The jSparrow IDE extension adds 118 rules and 3 interactive rules: Standard output methods to Logger, Remove Unused Code, and Rename Fields to Java Conventions. 94 of the rules have markers.
On Install Includes
- The 20 free rules (see below)
- All markers i.e. quick-fixes
jSparrow was designed to refactor Java code with a rule-based approach. A jSparrow rule is a definition of many small composed refactoring steps performed by the plug-in; one rule, when selected, can by itself refactor a very specific area within your system-wide code.
In simple, jSparrow analyzes your Java project to find quality issues and suggests automated refactorings to improve the sources.
For any questions or feedback please feel free to send us a message: https://jsparrow.io/contact-form/
Discover more at: https://jsparrow.io/
The 20 Free Rules
We want to help developers optimize the way they can fix Java code and refactor Java code. To get started, we offer 20 free forever rules which are available after installation.
Rules included to get started:
What is refactoring?
Refactoring is a process of system-wide code restructuring and reordering without affecting the system's external forms of action and behavior. In simpler terms, refactoring is improving software's code without affecting the software's user interfaces and experiences.
- Create working copies of selected Java files
- Analyse refactoring possibilities
- Apply the refactoring
- Compare working copies with original sources
- Persist wanted refactoring to original sources
Please visit our jSparrow page to see the refactoring process of jSparrow in more detail.
94 of the rules have markers; The jSparrow markers work like the quick fixes found in Sonarlint and JDTSpelling.
Builds upon Checkstyle Plugin's Motto
Checkstyle is a well-beloved inspecting tool that helps you adhere to coding standards. One of jSparrow's objectives is to build upon this motto and help developers adhere to coding standards through automated refactoring. One of our most worked-on tags is the "Coding Conventions" tag, currently including 38 refactorings. Like Checkstyle, you'll get notified about potential refactoring possibilities through markers which are available right after installation. Three rule examples: Hide Default Constructor In Utility Classes, Collapse If Statements, and Remove Null-Checks before Instance of.
Alternative to PMD with Selection Wizard
PMD is a joy to use to remove unused Java code. Built on this idea and from feedback from our users, jSparrow now includes an interactive wizard to remove unused code, whether they are fields, methods, or classes, jSparrow can remove them including their test cases, if wanted, in the whole workspace or selected projects.
Refactor JUnit Test Cases
JUnit is an open-source unit testing framework for Java. The goal of unit testing or unit test cases is to test individual units of software and validate expected performance. Since 2022 junit.org has released the next generation of JUnit: Junit 5. To help Java developers with the migration from JUnit 3 and JUnit 4 to JUnit 5, this plug-in includes ten JUnit refactoring rules:
The plug-in documentation shows Java and JUnit test case examples that get refactored.
JUnit is a tag that we use for the JUnit refactor rules. Tags describe properties of jSparrow rules with the intent of grouping similar rules together and making them easier to find and search for. Below are all our current tags:
Minimum Java Versions
All jSparrow rules have a Minimum Java Version, which means that a rule with (for example) a Minimum Java version of 1.1 can be used on Java version 1.1 and all Java versions after 1.1.
Rules with tag: https://jsparrow.github.io/tags/#java-version-tags
Version tags quick-links: Java 1.1, Java 1.2, Java 1.3, Java 1.4, Java 5, Java 6, Java 7, Java 8, Java 9, Java 10, Java 11, Java 14, Java 15, and Java 16
Coding conventions for Java
Coding conventions for Java consist of a set of recommended code styles and best practices. Rules with the Coding Conventionstag will alter source code parts to follow guides, such as the Google Java Style Guide.
Rules with tag: https://jsparrow.github.io/tags/#coding-conventions
I/O operations provided by java.io or java.nio
The I/O operations tag marks rules that deal with I/O operations provided by java.io or java.nio.
Rules with tag: https://jsparrow.github.io/tags/#io-operations
Lambda expressions are anonymous and unnamed functions that enable you to treat functionality as a method argument or code as data. Lambda expressions are an integral part of the java.util.stream API. Whenever a rule has this tag, it means that either a lambda expression is introduced or manipulated.
Rules with tag: https://jsparrow.github.io/tags/#lambda
Logging frameworks ease and standardize the process of logging for the Java platform. In particular, they provide flexibility by avoiding explicit output to the console. The location where logs are written becomes independent of the code and can be customized at runtime. Rules marked with this tag either introduce logging or improve aspects of the same.
Rules with tag: https://jsparrow.github.io/tags/#logging
A loop is an instruction that repeats until a specified condition is reached. Examples would be for, while, or forEach loops. Respectively, rules with the Loop tag will interact with such loops.
Rules with tag: https://jsparrow.github.io/tags/#Loop
Old Java Language Constructs
jSparrow rules having the Old Language Constructs tag replace old constructs with more up-to-date alternatives.
Rules with tag: https://jsparrow.github.io/tags/#old-language-constructs
Performance improving rules
The Performance tag indicates that a code fragment is replaced by a more performant one.
Rules with tag: https://jsparrow.github.io/tags/#performance
Rules marked with the Readability tag improve the ease with which a human reader can comprehend the purpose, control flow, and operation of source code. It affects aspects of quality, including portability, usability, and most importantly maintainability.
Rules with tag: https://jsparrow.github.io/tags/#readability
Security issues refer to vulnerabilities that can be exploited by an attacker to perform unauthorized actions within a computer program. Rules marked with this tag replace vulnerable code fragments with secure alternatives.
Rules with tag: https://jsparrow.github.io/tags/#security
String manipulation is the process of creating, parsing, or changing String variables or literals. Typical operations on strings include a concatenation of values or the creation of a String output based on the input of another type. jSparrow rules having this tag will therefore be related to such String operations.
Rules with tag: https://jsparrow.github.io/tags/#string-manipulation
jSparrow rules having this tag encourage using best practices in the test code.
Rules with tag: https://jsparrow.github.io/tags/#testing
jSparrow rules having this tag encourage best practices on using the AssertJ library for writing fluent assertions in unit tests.
Rules with tag: https://jsparrow.github.io/tags/#assertj
jSparrow rules having this tag encourage best practices on using the Spring library for writing web applications.
Rules with tag: https://jsparrow.github.io/tags/#Spring
Rules with the Free tag are free to use.
Rules with tag: https://jsparrow.github.io/tags/#free
Latest version release
jSparrow Eclipse IDE plug-in latest version: 4.18.0
jSparrow Maven plug-in latest version: 3.20.0
Our release policy
We will release at least one new rule in March, June, September, and December.
Bugfixes will be released each Thursday.
Hotfix Releases can be deployed at any time when urgent.
Next jSparrow Release
New Rule - jSparrow Eclipse IDE plug-in 2023-09-25