How to check code cyclomatic complexity in Android Studio? Is there any plugin available for Android Studio to check code complexity?
3 Answers
Go to Files -> Settings -> Plugins in Android Studio Type "Metrics Reloaded" in the search bar and install the plugin Click on Apply Restart the Android Studio
Now open your source file and right click on it. Go to Analyze -> Calculate Metrics In the window, select metrics scope as "current file" and metrics profile as "Complexity Metrics" and Click on "Ok".
Results will be displayed after clicking OK. v(G) is the cyclometric complexity ev(G) is the essential cyclometric complexity iv(G) is the Module Design Complexity Metric

- 259
- 2
- 5
There is plugin available named Metrics Reloaded . Which gives your code complexity in levels.

- 659
- 1
- 4
- 12
-
Can u plz tell me how i include this in android studio. – Born To Win Apr 24 '15 at 13:01
-
1You can download from Jetbrains site, and go to File -> Settings -> search Plugins-> click on Plugins -> Install plugin from disk....-> locate your download file. And now in Analyze section you can see Calculate Metrics options. – vishalk Apr 24 '15 at 13:30
-
:I have done with that things but i am not getting actual result like eclipse metrics plugin.e.g Total CCN count,Max CCN,etc..Do u have any idea abt tht? – Born To Win Jun 10 '15 at 10:23
I know it is an old question, but you can check the cyclomatic complexity code in Android studio with the plugin CodeMR.
CodeMR is a software quality and static code analysis tool for Java, Kotlin and Scala projects.
You can also create different HTML reports for the project and export many object-oriented metrics for packages, classes, and methods.
With Community Edition you can extract up to 50 source files and 60 classes. For analyzing more files, you can download a trial license or buy a license from CodeMR website.

- 121
- 1
- 6