"Findbugs" for kotlin?


#1

Hi,

Is there a static analisys tool for kotlin? It would be just great, especially with maven and IDEA integration.


#2

Yes, it would be nice to have such a tool. To my knowledge, it is not there yet. Note that many of the issues found by FindBugs are impossible in Kotlin. Those that are possible would be nice to find automatically, you are right


#3

what about checkstyle, PMD, sonarqube and all of our other good old friends?! IMHO if kotlin states to be an enterprise replacement for java, it should offer at least one sophisticated option as soon as (or somewhen right after) it goes stable. are there any plans, collaborations with other communities?


#4

There's nothing definite so far, but we are open to proposals.


#5

Remember that IntelliJ itself comes with a rather powerful static analysis engine called the Inspector. I used to play with FindBugs a lot, but eventually settled on just using the Inspector, as it runs in the background and has good editor / intention integration. The number of issues it can find is rather good, so if I was the boss of the Kotlin team (ha ha) I'd prioritise porting of the Inspector over FindBugs. Of course this helps sales of IDEA as well :)

And if that wasn’t enough then after Inspector I’d prioritise a version of the Checker Framework, as its philosophy of pragmatic type system extensions with annotations aligns quite well with Kotlin’s.


#6

I'm a big fan of the IntelliJ Inspections, too. I consider them much better than PMD and Findbugs. Good Kotlin inspections would be another good argument to use this language.


#7

The problem with just using IntelliJ for static analysis is that I can’t use it in my CI server or even from the command line. I agree with christoph.pickl that there needs to be equivalent tools for kotlin if it is to be a serious replacement for Java


#8

IntelliJ can be used in headless mode with build servers, too.


#9

https://www.jetbrains.com/help/idea/2016.1/running-inspections-offline.html
https://confluence.jetbrains.com/display/TCD9/Inspections


#10

I’ve always avoided installing IDEs on servers (even in the .net world, where it’s not so uncommon installing VS on CI server). So a standalone version of the static analysis tool we have in IDEA would be really appreciated…