This plugin focuses on finding subtle bugs, performance pitfalls, and API misuse that standard inspections often miss in Java, Kotlin, and Android projects.
It's developed for myself developers who care about performance, memory usage, correctness,
and want their IDE to actively point out non-obvious problems and better alternatives while they code.
Atomiccan be replaced withvolatile- Allocation should be cached (
Gson(),OkHttpClient()) BigDecimal|BigIntegerinstantiation can be replaced with constant by stokito(BigDecimal|BigInteger).compareTo(ZERO)can be replaced withsignum()by stokito
- Heavyweight property delegation
- Declaration name is Java keyword
- Inline function leaks anonymous declaration which will be inlined to the call-site if called from another module
- Anonymous function won't be inlined; function cannot be inlined if it is a receiver of an extension function
Nullable argument to string concatenationshould be re-implemented in more reliable way- Boxed primitive array allocation (
arrayOf(1, 2, 3))
<include layout="?themeAttribute">requires Marshmallow<drawable android:tint>requires Lollipop<layer-list><item android:gravity>requires Marshmallow@TargetApishould be replaced with@RequiresApi- Use of reflective
ObjectAnimator/PropertyValuesHolder - Use of attributes like
android.R.attr.enabledin context where state attributes expected, likeandroid.R.attr.state_enabled Color.parseColor(<constexpr>)or<constexpr>.toColorInt()should be replaced with an integer literal- Useless resource element
- Drawables: single-item layer-lists, single stateless item selectors, insetless insets, empty shapes
- Vector drawables: empty paths and clip-paths, invisible paths, suboptimal paths, useless clip-paths and groups, attributes with no effect
- Animations and animators: empty and single-element sets
- Layouts: suspicious combination of
(layout_margin|padding)(Left|Top|Right|Bottom|Start|End|Horizontal|Vertical|*)
- Android
TextUtilsmethods should be replaced with Kotlin extensions setOnClickListenerdoesn't work onRecyclerView, onVideoViewbefore API 26- Kotlin Android Extensions are deprecated
- Drawable subclass should override
getConstantState() Activity#onCreate(, PersistableBundle)will highly likely not be called<AnyScrollableView>should have an ID to save its scroll positionContext.obtainStylesAttributes|Context.withStyledAttributesneed a sorted array
- Ranges
[А-Я],[а-я]do not cover any of Cyrillic alphabets, some letters are out of range
- Inlay hints when upcasting to interface, e.g.
putExtra(listas Serializable) - Inlay hints when overriding an interface method, e.g.
@Overridefrom Runnable,
override funRunnable.run() - Inlay hints for vararg array allocation:
String.format("%d",new[]{1});
maxOf(1,*[2, 3, 4]) - ARGB Color swatches in gutter, folding int literals to
#[AA]RRGGBB, color picker, pasting CSS colors as int literals - Backing property folding for Kotlin
- Live templates for SVG and Android Vector Drawable pathData
- Live templates for implementing
PropertyforObjectAnimator
Plugin page on JetBrains marketplace
Alternatively, new versions are announced on and uploaded to my Telegram channel