views:

603

answers:

3

Are there any tools for performing static analysis of Scala code, similar to FindBugs and PMD for Java or Splint for C/C++? I know that FindBugs works on the bytecode produced by compiling Java, so I'm curious as to how it would work on Scala.

Google searches (as of 27 October 2009) reveal very little.

Google searches (as of 01 February 2010) reveal this question.

A: 

I don't know much about Scala but if is Java compatible Klocwork's Solo product might work. You can find it here Klocwork Solo

why is this the accepted answer? I can't find any evidence that Klocwork 'solves' the problems you'ed have running Findbugs...?
p3t0r
+2  A: 

FindBugs analyzes JVM byte codes, regardless of the tool that generated them. I've tried using FindBugs to check .class files generated by Scala. Unfortunately, FindBugs produced many warnings, even for trivial Scala programs.

cpeterso
+2  A: 

Findbugs and other tools that are bytecode based will work, in the sense that they will find faults in your code. Unfortunately, the bytecode based approaches have been tuned against the output of the javac compilers, meaning they are likely to produce very high false positive rates, and miss basic issues, because Scala will be producing different idioms than the javac compiler.

Michael Donohue