Coder Social home page Coder Social logo

Comments (3)

josephearl avatar josephearl commented on June 11, 2024

FindBugs is not designed to analyse Scala code, I'd suggest you use something like https://github.com/scalastyle/scalastyle on your Scala code, and only run FindBugs on your Java code.

from sbt-findbugs.

RichardBradley avatar RichardBradley commented on June 11, 2024

I'd suggest you use something like scalastyle on your Scala code, and only run FindBugs on your Java code.

Scalastyle is a regex based rule engine; it's not really comparable to FindBugs. It's closer to a source code formatter.
A closer equivalent is scapegoat.

There is some discussion on scapegoat-scala/scapegoat#38 about Findbugs v.s. Scapegoat.
I believe that there may be some useful knowledge about the Java standard libraries in Findbugs which may be applicable to Scala programs, but many of the rules are inapplicable, you are right.

If the general conclusion is that Findbugs is completely inapplicable to Scala, then findbugs4sbt should run only on Java sources -- currently it does try to run Findbugs on bytecode from Scala sources.

from sbt-findbugs.

josephearl avatar josephearl commented on June 11, 2024

I wouldn't say scalastyle is regex - it parses the Scala AST and applies rules to that. But it doesn't really do any static analysis, you're right.

This StackOverflow post also has some alternates: http://stackoverflow.com/questions/22617713/whats-the-current-state-of-static-analysis-tools-for-scala

If the general conclusion is that Findbugs is completely inapplicable to Scala, then findbugs4sbt should run only on Java sources -- currently it does try to run Findbugs on bytecode from Scala sources.

Personally I think it is and would vote to change it, although I can't speak for the project maintainers

FindBugs works "out of the box" for Java, and the rules it has detect issues with commonly written Java code.

This isn't the case for Scala, and I would argue the changes to support it are out of the scope of this project. Scala support should be added to the main FindBugs tool (or an extension of it) so that things like running it directly from the command line work, not in an SBT plugin.

from sbt-findbugs.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.