This plugin calculates code complexity metric right in the editor and shows the complexity in the hint next to the method/class. It's based on the Cognitive Complexity metric proposed by G. Ann Campbell in Cognitive Complexity - A new way of measuring understandability.
Works with Java, Kotlin, and Python.
-
Using IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "code-complexity-plugin" > Install Plugin
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
I chose 8 points as a medium complexity method and use it as 100%. This means that all the methods above 100% are good candidates for splitting/improving.
The formula is: percentage = points / 8 * 100
- Update version in
gradle.propertied
- Update version and description in
CHANGELOG.md
- Run
./gradlew publishPlugin
- Push to repo with the proper tag
Plugin based on the IntelliJ Platform Plugin Template.