twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 4
Identify errors
in code without
running it
Slide 5
Slide 5 text
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 5
Brainstorm: what are some
things static analysis can find?
•Functionality defects
•Anti patterns
•Performance issues
•Security problems
•Coding standard violations
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 9
Created 2001
Java versions 10.X - Java 11-17
9.X - Java 8
Focus Coding standards
Limits One file at a time
Languages Java
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 14
•Older tool
•“Sun” and Google styles
built in
•One file at a time
•Not as powerful as others
Caveats
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 20
Created
FindBugs
SpotBugs
2006
2016
Java versions Any?
(old docs say 9
but works with
17)
Focus Scanning
bytecode
Languages Java
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 29
Custom Rule Demo
Or bytecode directly if need to
Object size = stack.getStackItem(0).getConstant();
Object str = stack.getStackItem(1).getConstant();
Slide 30
Slide 30 text
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 30
Custom Rule Demo
Couldn’t get Gradle
to recognize it.
Docs say to drop in
plugin directory/
Eclipse.
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 32
Created 2002
Java versions Up to Java 20
Focus Coding issues
Add ons Copy paste
detection
Languages Many
Slide 33
Slide 33 text
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 33
What does PMD
stand for?
•Nothing
•Retrofitted
Programming
Mistake
Detector
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 43
Created 2006
Java versions Up to Java 17
Focus Various
Company SonarSource
Languages Many
Slide 44
Slide 44 text
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 44
Types
•Sonar Lint - IDE
•Open source web app/
scanner
•Commercial web app/
scanner
•SaaS - https://sonarcloud.io