Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
2023-static-analysis.pdf
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Jeanne Boyarsky
July 20, 2023
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
2023-static-analysis.pdf
Jeanne Boyarsky
July 20, 2023
More Decks by Jeanne Boyarsky
See All by Jeanne Boyarsky
Time Management for Work, Learning, Fun (2026 edition)
boyarsky
0
40
Preparing for the Java 25 Certification or Learning New Features
boyarsky
0
35
JavaOne Java 25
boyarsky
0
120
JUnit 6 + exploring the testing ecosystem
boyarsky
0
130
Timeline of a (NYC) FRC Session/Regional
boyarsky
0
93
2025 Toastmasters Path Reference
boyarsky
0
300
2025 Toastmasters Path Changes Update Overview and Reference
boyarsky
0
150
Mentor_Conference_Presentation.pdf
boyarsky
0
69
2025-java-does-what-now.pdf
boyarsky
0
150
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Claude Code のすすめ
schroneko
67
230k
Writing Fast Ruby
sferik
630
63k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
The browser strikes back
jonoalderson
0
1.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
Color Theory Basics | Prateek | Gurzu
gurzu
1
490
Agile that works and the tools we love
rasmusluckow
331
22k
Transcript
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 1 Improving your Code with Static Analysis Tools
Jeanne Boyarsky Thursday, July 20th 2023 UberConf speakerdeck.com/boyarsky https://github.com/boyarsky/2023-uberconf- static-analysis
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky Pause for a Commercial 2 Java certs: 8/11/17
Book giveaway at end!
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 3 Intro
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 4 Identify errors in code without running it
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 6 Static Analysis SAST (Static Application Security Testing)
Coding standards, functionality, etc Security modeling, etc Security static analysis
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 7
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 8 Checkstyle
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 10 Sample Rules
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 11 Sample Report
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 12 Sample Report
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 13 Artifact URL Docs https://checkstyle.sourceforge.io/ GitHub https://github.com/checkstyle/checkstyle/ releases/
Ant Task https://checkstyle.sourceforge.io/ anttask.html Maven Plugin https://maven.apache.org/plugins/maven- checkstyle-plugin Gradle Plugin https://docs.gradle.org/current/userguide/ checkstyle_plugin.html URLs
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 15 Config
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 16 Output
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 17 Suppressions Can also use xml based excludes
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 18 Custom Rule Demo
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 19 SpotBugs
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 21 FindBugs?
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 22 Sample Rules
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 23 Sample Report
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 24 Artifact URL Main page https://spotbugs.github.io/ Docs https://spotbugs.github.io/
Rules https://spotbugs.readthedocs.io/en/latest/ bugDescriptions.html Ant task https://spotbugs.readthedocs.io/en/ stable/ant.html Maven Plugin https://spotbugs.github.io/spotbugs- maven-plugin/ Gradle Plugin https://plugins.gradle.org/plugin/ com.github.spotbugs URLs
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 25 •Older tool •Support slow - deprecated gradle
code for three versions •Rules can be finnicky •Report kludgy •Docs varying degrees of dated Caveats
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 26 Config
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 27 Output
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 28 Suppressions
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();
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 31 PMD
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
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 33 What does PMD stand for? •Nothing •Retrofitted
Programming Mistake Detector
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 34 Sample Rules
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 35 Sample Report
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 36 Artifact URL Main page https://pmd.github.io/ Docs https://docs.pmd-code.org/latest/
Rules https://pmd.github.io/pmd/ pmd_rules_java.html Ant task https://pmd.github.io/pmd/ pmd_userdocs_tools_ant.html Maven Plugin https://maven.apache.org/plugins/maven- pmd-plugin/ Gradle Plugin https://docs.gradle.org/current/userguide/ pmd_plugin.html URLs
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 37 Config
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 38 Output
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 39 Suppressions
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 40 Custom Rule Demo
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 41 Custom Rule Demo
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 42 Sonar
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 43 Created 2006 Java versions Up to Java
17 Focus Various Company SonarSource Languages Many
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 44 Types •Sonar Lint - IDE •Open source
web app/ scanner •Commercial web app/ scanner •SaaS - https://sonarcloud.io
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 45 Sample Rules
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 46 Sample Report
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 47 Artifact URL Main page https://www.sonarsource.com/products/ sonarqube Docs
https://docs.sonarqube.org/latest/ Rules https://rules.sonarsource.com/java/ Ant task https://docs.sonarqube.org/9.7/analyzing- source-code/scanners/sonarscanner-for- ant/ Maven Plugin https://docs.sonarqube.org/9.7/analyzing- source-code/scanners/sonarscanner-for- maven/ Gradle Plugin https://docs.sonarqube.org/9.7/analyzing- source-code/scanners/sonarscanner-for- gradle/ URLs
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 48 Config
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 49 Suppressions
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky 50 Custom Rule Demo
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky + IDE Support 51
twitter.com/jeanneboyarsky mastodon.social/@jeanneboyarsky Book Giveaway 52