SlideShare a Scribd company logo
Johan Janssen (Info Support) @johanjanssen42
 Basic features
 Analyzing data
 Code review
 Hunting bad design and
architecture
 Testing
 Other languages
 Leftovers
 Using SonarQube on
existing projects
 Tips / summary
 Questions
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
 Microsoft Applications: "about 10 - 20 defects
per 1000 lines of code during in-house testing,
and 0.5 defect per 1000 lines of code in
released product (Dave Moore 1992).“
 NASA's Spirit rover became unresponsive on
January 21, 2004, a few weeks after landing on
Mars. (Wikipedia)
 In January 2009, Google's search engine
erroneously notified users that every web site
world wide was potentially malicious, including
its own. (Wikipedia)
Beyond the basics of SonarQube: improve your Java(Script) code even further
 I’m told to use it.
 We need to achieve certain results (SIG…)
 I want to improve my coding standards
 Platform to manage code quality
 Open source, possible to pay for support and
some plugins
 Since 2006; now they have 200 customers and
SonarQube is used in 15.000 organizations
 Active community: support, plugins, books
2013:
 5 releases of SonarQube platform
 130 releases of ecosystem products
 75,000 downloads of SonarQube
 13,000+ messages on mailing lists
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Profile
Rules
Projects
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Projects
Quality Gates
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
“We all need people who will give us feedback.
That's how we improve.”
- Bill Gates
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
mvn clean install
mvn sonar:sonar
mvn clean org.jacoco:jacoco-maven-
plugin:prepare-agent install
-Dmaven.test.failure.ignore=true
mvn sonar:sonar
 Configure the POM (see next slide)
 Activate profile to get coverage per test
information
mvn org.jacoco:jacoco-maven-
plugin:prepare-agent clean
install -Pcoverage-per-test
 Analyze the project
mvn sonar:sonar
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
 ! Unit testing
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
 Add integration test coverage widget to
SonarQube
 Download Jacoco agent
 Configuration for Tomcat’s catalina.bat:
set JACOCO=-
javaagent:$path$libjacocoagent.jar,
destfile=$resultpath$jacoco.exec,
append=false,includes=com.dockerpi.*
set JAVA_OPTS=%JAVA_OPTS% %JACOCO%
 Start Tomcat
 Execute tests (manual, integration,
performance…)
 Stop Tomcat and execute SonarQube analysis
mvn clean install sonar:sonar
-Dsonar.dynamicAnalysis=reuseReports
-Dsonar.jacoco.itReportPath=
$resultpath$jacoco.exec
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
 Enable ‘Survived mutant’ rule in SonarQube
Quality Profile
 Configure Pitest for instance with Maven (see
next slides)
 Execute tests and send results to SonarQube
mvn org.pitest:pitest-
maven:mutationCoverage
mvn sonar:sonar
-Dsonar.pitest.mode=reuseReport
 Maven configuration inside the build/plugins
section
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>LATEST</version>
<configuration>
<inScopeClasses>
<param>com.example*</param>
</inScopeClasses>
<targetClasses>
<param>com.example*</param>
</targetClasses>
<outputFormats>
<outputFormat>XML</outputFormat>
</outputFormats>
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
mvn sonar:sonar -Dsonar.branch=4.4
 Ignore files
 Ignore issues
 Ignore duplications
 Ignore code coverage
 Example:
mvn sonar:sonar -Dsonar.exclusions=
src/main/webapp/lib/*.js
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
 Identity hotspots
 Use action plans
 Maybe use a less strict quality profile
 Add tasks/stories in the sprint to improve quality
 Monitor quality of new code
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
Beyond the basics of SonarQube: improve your Java(Script) code even further
 Create stories/tasks to improve the quality
 Perform manual code reviews
 Agree on a standard for items SonarQube
cannot check
 Fix items or mark them as false positive
 Use separate logins
 Settings/reviews are project specific
 Options to use SonarQube
o Central server (commit AND nightly)
o IDE plugin
o Local in your development environment
 Check code quality before ‘To verify’ step
o First merge your code so it is up to date
 Verifier should also verify the quality
Beyond the basics of SonarQube: improve your Java(Script) code even further
“Once we accept our limits, we go beyond them.”
- Albert Einstein
 Ask me!
 Sonarqube.org
 Nemo example dashboard
 SonarQube books
johan.janssen@infosupport.com
@johanjanssen42
Ad

More Related Content

What's hot (20)

Tracking and improving software quality with SonarQube
Tracking and improving software quality with SonarQubeTracking and improving software quality with SonarQube
Tracking and improving software quality with SonarQube
Patroklos Papapetrou (Pat)
 
Sonar qube to impove code quality
Sonar qube   to impove code qualitySonar qube   to impove code quality
Sonar qube to impove code quality
Mani Sarkar
 
Managing code quality with SonarQube - Radu Vunvulea
Managing code quality with SonarQube - Radu VunvuleaManaging code quality with SonarQube - Radu Vunvulea
Managing code quality with SonarQube - Radu Vunvulea
ITSpark Community
 
Static code analysis
Static code analysisStatic code analysis
Static code analysis
Prancer Io
 
SonarQube
SonarQubeSonarQube
SonarQube
Gnanaseelan Jeb
 
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaTech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Nexus FrontierTech
 
Sonar
SonarSonar
Sonar
prabakaranbrick
 
Java Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQubeJava Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQube
Angelin R
 
Pay off your technical debt with SonarQube
Pay off your technical debt with SonarQubePay off your technical debt with SonarQube
Pay off your technical debt with SonarQube
Rik van den Berg
 
Sonarqube + Docker
Sonarqube + DockerSonarqube + Docker
Sonarqube + Docker
Estefanía Fernández Muñoz
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
Anju ML
 
SonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionSonarQube: Continuous Code Inspection
SonarQube: Continuous Code Inspection
Michael Jesse
 
Sonar
SonarSonar
Sonar
Peerapat Asoktummarungsri
 
Sonar Review
Sonar ReviewSonar Review
Sonar Review
Kate Semizhon
 
Track code quality with SonarQube
Track code quality with SonarQubeTrack code quality with SonarQube
Track code quality with SonarQube
Dmytro Patserkovskyi
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQube
Emre Dündar
 
Track code quality with SonarQube - short version
Track code quality with SonarQube - short versionTrack code quality with SonarQube - short version
Track code quality with SonarQube - short version
Dmytro Patserkovskyi
 
ITAKE Unconference - Holding down your technical debt with Sonarqube
ITAKE Unconference - Holding down your technical debt with SonarqubeITAKE Unconference - Holding down your technical debt with Sonarqube
ITAKE Unconference - Holding down your technical debt with Sonarqube
Patroklos Papapetrou (Pat)
 
Sonarqube
SonarqubeSonarqube
Sonarqube
Kalkey
 
SonarQube와 함께하는 소프트웨어 품질 세미나 - 지속적인 코드 인스펙션 SonarQube 활용 방안
SonarQube와 함께하는 소프트웨어 품질 세미나 - 지속적인 코드 인스펙션 SonarQube 활용 방안SonarQube와 함께하는 소프트웨어 품질 세미나 - 지속적인 코드 인스펙션 SonarQube 활용 방안
SonarQube와 함께하는 소프트웨어 품질 세미나 - 지속적인 코드 인스펙션 SonarQube 활용 방안
CURVC Corp
 
Tracking and improving software quality with SonarQube
Tracking and improving software quality with SonarQubeTracking and improving software quality with SonarQube
Tracking and improving software quality with SonarQube
Patroklos Papapetrou (Pat)
 
Sonar qube to impove code quality
Sonar qube   to impove code qualitySonar qube   to impove code quality
Sonar qube to impove code quality
Mani Sarkar
 
Managing code quality with SonarQube - Radu Vunvulea
Managing code quality with SonarQube - Radu VunvuleaManaging code quality with SonarQube - Radu Vunvulea
Managing code quality with SonarQube - Radu Vunvulea
ITSpark Community
 
Static code analysis
Static code analysisStatic code analysis
Static code analysis
Prancer Io
 
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaTech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Nexus FrontierTech
 
Java Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQubeJava Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQube
Angelin R
 
Pay off your technical debt with SonarQube
Pay off your technical debt with SonarQubePay off your technical debt with SonarQube
Pay off your technical debt with SonarQube
Rik van den Berg
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
Anju ML
 
SonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionSonarQube: Continuous Code Inspection
SonarQube: Continuous Code Inspection
Michael Jesse
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQube
Emre Dündar
 
Track code quality with SonarQube - short version
Track code quality with SonarQube - short versionTrack code quality with SonarQube - short version
Track code quality with SonarQube - short version
Dmytro Patserkovskyi
 
ITAKE Unconference - Holding down your technical debt with Sonarqube
ITAKE Unconference - Holding down your technical debt with SonarqubeITAKE Unconference - Holding down your technical debt with Sonarqube
ITAKE Unconference - Holding down your technical debt with Sonarqube
Patroklos Papapetrou (Pat)
 
Sonarqube
SonarqubeSonarqube
Sonarqube
Kalkey
 
SonarQube와 함께하는 소프트웨어 품질 세미나 - 지속적인 코드 인스펙션 SonarQube 활용 방안
SonarQube와 함께하는 소프트웨어 품질 세미나 - 지속적인 코드 인스펙션 SonarQube 활용 방안SonarQube와 함께하는 소프트웨어 품질 세미나 - 지속적인 코드 인스펙션 SonarQube 활용 방안
SonarQube와 함께하는 소프트웨어 품질 세미나 - 지속적인 코드 인스펙션 SonarQube 활용 방안
CURVC Corp
 

Viewers also liked (8)

SonarQube Overview
SonarQube OverviewSonarQube Overview
SonarQube Overview
Ahmed M. Gomaa
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
Orest Ivasiv
 
Java. Полиморфизм.
Java. Полиморфизм.Java. Полиморфизм.
Java. Полиморфизм.
Unguryan Vitaliy
 
Java. Конструкторы класса и инициализация
Java. Конструкторы класса и инициализация Java. Конструкторы класса и инициализация
Java. Конструкторы класса и инициализация
Unguryan Vitaliy
 
Java. Инкапсуляция.
Java. Инкапсуляция.Java. Инкапсуляция.
Java. Инкапсуляция.
Unguryan Vitaliy
 
Java. Наследование.
Java. Наследование.Java. Наследование.
Java. Наследование.
Unguryan Vitaliy
 
Just-in-time compiler (March, 2017)
Just-in-time compiler (March, 2017)Just-in-time compiler (March, 2017)
Just-in-time compiler (March, 2017)
Rachel M. Carmena
 
SONAR
SONAR SONAR
SONAR
kamal6902
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
Orest Ivasiv
 
Java. Полиморфизм.
Java. Полиморфизм.Java. Полиморфизм.
Java. Полиморфизм.
Unguryan Vitaliy
 
Java. Конструкторы класса и инициализация
Java. Конструкторы класса и инициализация Java. Конструкторы класса и инициализация
Java. Конструкторы класса и инициализация
Unguryan Vitaliy
 
Java. Инкапсуляция.
Java. Инкапсуляция.Java. Инкапсуляция.
Java. Инкапсуляция.
Unguryan Vitaliy
 
Java. Наследование.
Java. Наследование.Java. Наследование.
Java. Наследование.
Unguryan Vitaliy
 
Just-in-time compiler (March, 2017)
Just-in-time compiler (March, 2017)Just-in-time compiler (March, 2017)
Just-in-time compiler (March, 2017)
Rachel M. Carmena
 
Ad

Similar to Beyond the basics of SonarQube: improve your Java(Script) code even further (20)

JavaCro'15 - Beyond the basics of SonarQube improve your Java(Script) code ev...
JavaCro'15 - Beyond the basics of SonarQube improve your Java(Script) code ev...JavaCro'15 - Beyond the basics of SonarQube improve your Java(Script) code ev...
JavaCro'15 - Beyond the basics of SonarQube improve your Java(Script) code ev...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
The Usual Suspects - Red Hat Developer Day 2012-11-01
The Usual Suspects - Red Hat Developer Day 2012-11-01The Usual Suspects - Red Hat Developer Day 2012-11-01
The Usual Suspects - Red Hat Developer Day 2012-11-01
Jorge Hidalgo
 
Maven.pptx
Maven.pptxMaven.pptx
Maven.pptx
piyushkumar613397
 
Object Oriented Programming-JAVA
Object Oriented Programming-JAVAObject Oriented Programming-JAVA
Object Oriented Programming-JAVA
Home
 
Migrating Beyond Java 8
Migrating Beyond Java 8Migrating Beyond Java 8
Migrating Beyond Java 8
DaliaAboSheasha
 
Bye flex. Hey js.
Bye flex. Hey js.Bye flex. Hey js.
Bye flex. Hey js.
Daniil Moskovtsov
 
[JOI] TOTVS Developers Joinville - Java #1
[JOI] TOTVS Developers Joinville - Java #1[JOI] TOTVS Developers Joinville - Java #1
[JOI] TOTVS Developers Joinville - Java #1
Rubens Dos Santos Filho
 
Core Java
Core JavaCore Java
Core Java
Prakash Dimmita
 
Keynote VST2020 (Workshop on Validation, Analysis and Evolution of Software ...
Keynote VST2020 (Workshop on  Validation, Analysis and Evolution of Software ...Keynote VST2020 (Workshop on  Validation, Analysis and Evolution of Software ...
Keynote VST2020 (Workshop on Validation, Analysis and Evolution of Software ...
University of Antwerp
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
Matthew McCullough
 
Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentation
Mark Proctor
 
Java Programming Fundamentals: Complete Guide for Beginners
Java Programming Fundamentals: Complete Guide for BeginnersJava Programming Fundamentals: Complete Guide for Beginners
Java Programming Fundamentals: Complete Guide for Beginners
Taranath Jaishy
 
Java Attacks & Defenses - End of Year 2010 Presentation
Java Attacks & Defenses - End of Year 2010 PresentationJava Attacks & Defenses - End of Year 2010 Presentation
Java Attacks & Defenses - End of Year 2010 Presentation
James Hamilton
 
java:characteristics, classpath, compliation
java:characteristics, classpath, compliationjava:characteristics, classpath, compliation
java:characteristics, classpath, compliation
Shivam Singhal
 
ConSol_IBM_webcast_quarkus_the_blue_hedgehog_of_java_web_frameworks
ConSol_IBM_webcast_quarkus_the_blue_hedgehog_of_java_web_frameworksConSol_IBM_webcast_quarkus_the_blue_hedgehog_of_java_web_frameworks
ConSol_IBM_webcast_quarkus_the_blue_hedgehog_of_java_web_frameworks
ConSol Consulting & Solutions Software GmbH
 
Java Insecurity: How to Deal with the Constant Vulnerabilities
Java Insecurity: How to Deal with the Constant VulnerabilitiesJava Insecurity: How to Deal with the Constant Vulnerabilities
Java Insecurity: How to Deal with the Constant Vulnerabilities
Lumension
 
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
Daniel Bryant
 
Automated Abstraction of Flow of Control in a System of Distributed Software...
Automated Abstraction of Flow of Control in a System of Distributed  Software...Automated Abstraction of Flow of Control in a System of Distributed  Software...
Automated Abstraction of Flow of Control in a System of Distributed Software...
nimak
 
Ranjith kumar Nagisetty(AndiordApp and PostSiliconTest Engineer)_Resume
Ranjith kumar Nagisetty(AndiordApp and PostSiliconTest Engineer)_ResumeRanjith kumar Nagisetty(AndiordApp and PostSiliconTest Engineer)_Resume
Ranjith kumar Nagisetty(AndiordApp and PostSiliconTest Engineer)_Resume
ranjith nagisetty
 
Java code coverage with JCov. Implementation details and use cases.
Java code coverage with JCov. Implementation details and use cases.Java code coverage with JCov. Implementation details and use cases.
Java code coverage with JCov. Implementation details and use cases.
Alexandre (Shura) Iline
 
The Usual Suspects - Red Hat Developer Day 2012-11-01
The Usual Suspects - Red Hat Developer Day 2012-11-01The Usual Suspects - Red Hat Developer Day 2012-11-01
The Usual Suspects - Red Hat Developer Day 2012-11-01
Jorge Hidalgo
 
Object Oriented Programming-JAVA
Object Oriented Programming-JAVAObject Oriented Programming-JAVA
Object Oriented Programming-JAVA
Home
 
[JOI] TOTVS Developers Joinville - Java #1
[JOI] TOTVS Developers Joinville - Java #1[JOI] TOTVS Developers Joinville - Java #1
[JOI] TOTVS Developers Joinville - Java #1
Rubens Dos Santos Filho
 
Keynote VST2020 (Workshop on Validation, Analysis and Evolution of Software ...
Keynote VST2020 (Workshop on  Validation, Analysis and Evolution of Software ...Keynote VST2020 (Workshop on  Validation, Analysis and Evolution of Software ...
Keynote VST2020 (Workshop on Validation, Analysis and Evolution of Software ...
University of Antwerp
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
Matthew McCullough
 
Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentation
Mark Proctor
 
Java Programming Fundamentals: Complete Guide for Beginners
Java Programming Fundamentals: Complete Guide for BeginnersJava Programming Fundamentals: Complete Guide for Beginners
Java Programming Fundamentals: Complete Guide for Beginners
Taranath Jaishy
 
Java Attacks & Defenses - End of Year 2010 Presentation
Java Attacks & Defenses - End of Year 2010 PresentationJava Attacks & Defenses - End of Year 2010 Presentation
Java Attacks & Defenses - End of Year 2010 Presentation
James Hamilton
 
java:characteristics, classpath, compliation
java:characteristics, classpath, compliationjava:characteristics, classpath, compliation
java:characteristics, classpath, compliation
Shivam Singhal
 
Java Insecurity: How to Deal with the Constant Vulnerabilities
Java Insecurity: How to Deal with the Constant VulnerabilitiesJava Insecurity: How to Deal with the Constant Vulnerabilities
Java Insecurity: How to Deal with the Constant Vulnerabilities
Lumension
 
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
Daniel Bryant
 
Automated Abstraction of Flow of Control in a System of Distributed Software...
Automated Abstraction of Flow of Control in a System of Distributed  Software...Automated Abstraction of Flow of Control in a System of Distributed  Software...
Automated Abstraction of Flow of Control in a System of Distributed Software...
nimak
 
Ranjith kumar Nagisetty(AndiordApp and PostSiliconTest Engineer)_Resume
Ranjith kumar Nagisetty(AndiordApp and PostSiliconTest Engineer)_ResumeRanjith kumar Nagisetty(AndiordApp and PostSiliconTest Engineer)_Resume
Ranjith kumar Nagisetty(AndiordApp and PostSiliconTest Engineer)_Resume
ranjith nagisetty
 
Java code coverage with JCov. Implementation details and use cases.
Java code coverage with JCov. Implementation details and use cases.Java code coverage with JCov. Implementation details and use cases.
Java code coverage with JCov. Implementation details and use cases.
Alexandre (Shura) Iline
 
Ad

More from Johan Janssen (18)

How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17
Johan Janssen
 
Upgrade to java 16 or 17
Upgrade to java 16 or 17Upgrade to java 16 or 17
Upgrade to java 16 or 17
Johan Janssen
 
Continuous delivery in 50 minutes
Continuous delivery in 50 minutesContinuous delivery in 50 minutes
Continuous delivery in 50 minutes
Johan Janssen
 
Create a Continuous Delivery Pipeline in 45 minutes
Create a Continuous Delivery Pipeline in 45 minutesCreate a Continuous Delivery Pipeline in 45 minutes
Create a Continuous Delivery Pipeline in 45 minutes
Johan Janssen
 
DevNexus: Create a Continuous Delivery pipeline in 50 minutes
DevNexus: Create a Continuous Delivery pipeline in 50 minutesDevNexus: Create a Continuous Delivery pipeline in 50 minutes
DevNexus: Create a Continuous Delivery pipeline in 50 minutes
Johan Janssen
 
Rest no more - Using actors for the internet of (Lego) trains & Raspberry Pi's
Rest no more - Using actors for the internet of (Lego) trains & Raspberry Pi'sRest no more - Using actors for the internet of (Lego) trains & Raspberry Pi's
Rest no more - Using actors for the internet of (Lego) trains & Raspberry Pi's
Johan Janssen
 
How we started our first java conference JVMCON
How we started our first java conference JVMCONHow we started our first java conference JVMCON
How we started our first java conference JVMCON
Johan Janssen
 
Use voice recognition with Alexa to control your home [JavaOne]
Use voice recognition with Alexa to control your home [JavaOne]Use voice recognition with Alexa to control your home [JavaOne]
Use voice recognition with Alexa to control your home [JavaOne]
Johan Janssen
 
Docker for Java developers at JavaLand
Docker for Java developers at JavaLandDocker for Java developers at JavaLand
Docker for Java developers at JavaLand
Johan Janssen
 
Welcome alexa, your personal assistant
Welcome alexa, your personal assistantWelcome alexa, your personal assistant
Welcome alexa, your personal assistant
Johan Janssen
 
A tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutesA tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutes
Johan Janssen
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
Johan Janssen
 
EuregJUG: Using actors for the internet of (lego) trains
EuregJUG: Using actors for the internet of (lego) trainsEuregJUG: Using actors for the internet of (lego) trains
EuregJUG: Using actors for the internet of (lego) trains
Johan Janssen
 
JavaOne: Welcome alexa, your personal assistant [con1700]
JavaOne: Welcome alexa, your personal assistant [con1700]JavaOne: Welcome alexa, your personal assistant [con1700]
JavaOne: Welcome alexa, your personal assistant [con1700]
Johan Janssen
 
JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]
JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]
JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]
Johan Janssen
 
JavaOne: Using NetBeans RCP to control your Lego [con1702]
JavaOne: Using NetBeans RCP to control your Lego [con1702]JavaOne: Using NetBeans RCP to control your Lego [con1702]
JavaOne: Using NetBeans RCP to control your Lego [con1702]
Johan Janssen
 
JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]
JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]
JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]
Johan Janssen
 
Hide your development environment and application in a container
Hide your development environment and application in a containerHide your development environment and application in a container
Hide your development environment and application in a container
Johan Janssen
 
How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17
Johan Janssen
 
Upgrade to java 16 or 17
Upgrade to java 16 or 17Upgrade to java 16 or 17
Upgrade to java 16 or 17
Johan Janssen
 
Continuous delivery in 50 minutes
Continuous delivery in 50 minutesContinuous delivery in 50 minutes
Continuous delivery in 50 minutes
Johan Janssen
 
Create a Continuous Delivery Pipeline in 45 minutes
Create a Continuous Delivery Pipeline in 45 minutesCreate a Continuous Delivery Pipeline in 45 minutes
Create a Continuous Delivery Pipeline in 45 minutes
Johan Janssen
 
DevNexus: Create a Continuous Delivery pipeline in 50 minutes
DevNexus: Create a Continuous Delivery pipeline in 50 minutesDevNexus: Create a Continuous Delivery pipeline in 50 minutes
DevNexus: Create a Continuous Delivery pipeline in 50 minutes
Johan Janssen
 
Rest no more - Using actors for the internet of (Lego) trains & Raspberry Pi's
Rest no more - Using actors for the internet of (Lego) trains & Raspberry Pi'sRest no more - Using actors for the internet of (Lego) trains & Raspberry Pi's
Rest no more - Using actors for the internet of (Lego) trains & Raspberry Pi's
Johan Janssen
 
How we started our first java conference JVMCON
How we started our first java conference JVMCONHow we started our first java conference JVMCON
How we started our first java conference JVMCON
Johan Janssen
 
Use voice recognition with Alexa to control your home [JavaOne]
Use voice recognition with Alexa to control your home [JavaOne]Use voice recognition with Alexa to control your home [JavaOne]
Use voice recognition with Alexa to control your home [JavaOne]
Johan Janssen
 
Docker for Java developers at JavaLand
Docker for Java developers at JavaLandDocker for Java developers at JavaLand
Docker for Java developers at JavaLand
Johan Janssen
 
Welcome alexa, your personal assistant
Welcome alexa, your personal assistantWelcome alexa, your personal assistant
Welcome alexa, your personal assistant
Johan Janssen
 
A tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutesA tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutes
Johan Janssen
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
Johan Janssen
 
EuregJUG: Using actors for the internet of (lego) trains
EuregJUG: Using actors for the internet of (lego) trainsEuregJUG: Using actors for the internet of (lego) trains
EuregJUG: Using actors for the internet of (lego) trains
Johan Janssen
 
JavaOne: Welcome alexa, your personal assistant [con1700]
JavaOne: Welcome alexa, your personal assistant [con1700]JavaOne: Welcome alexa, your personal assistant [con1700]
JavaOne: Welcome alexa, your personal assistant [con1700]
Johan Janssen
 
JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]
JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]
JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]
Johan Janssen
 
JavaOne: Using NetBeans RCP to control your Lego [con1702]
JavaOne: Using NetBeans RCP to control your Lego [con1702]JavaOne: Using NetBeans RCP to control your Lego [con1702]
JavaOne: Using NetBeans RCP to control your Lego [con1702]
Johan Janssen
 
JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]
JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]
JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]
Johan Janssen
 
Hide your development environment and application in a container
Hide your development environment and application in a containerHide your development environment and application in a container
Hide your development environment and application in a container
Johan Janssen
 

Recently uploaded (19)

DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 

Beyond the basics of SonarQube: improve your Java(Script) code even further

  • 1. Johan Janssen (Info Support) @johanjanssen42
  • 2.  Basic features  Analyzing data  Code review  Hunting bad design and architecture  Testing  Other languages  Leftovers  Using SonarQube on existing projects  Tips / summary  Questions
  • 6.  Microsoft Applications: "about 10 - 20 defects per 1000 lines of code during in-house testing, and 0.5 defect per 1000 lines of code in released product (Dave Moore 1992).“
  • 7.  NASA's Spirit rover became unresponsive on January 21, 2004, a few weeks after landing on Mars. (Wikipedia)  In January 2009, Google's search engine erroneously notified users that every web site world wide was potentially malicious, including its own. (Wikipedia)
  • 9.  I’m told to use it.  We need to achieve certain results (SIG…)  I want to improve my coding standards
  • 10.  Platform to manage code quality  Open source, possible to pay for support and some plugins  Since 2006; now they have 200 customers and SonarQube is used in 15.000 organizations  Active community: support, plugins, books
  • 11. 2013:  5 releases of SonarQube platform  130 releases of ecosystem products  75,000 downloads of SonarQube  13,000+ messages on mailing lists
  • 41. “We all need people who will give us feedback. That's how we improve.” - Bill Gates
  • 47. mvn clean install mvn sonar:sonar mvn clean org.jacoco:jacoco-maven- plugin:prepare-agent install -Dmaven.test.failure.ignore=true mvn sonar:sonar
  • 48.  Configure the POM (see next slide)  Activate profile to get coverage per test information mvn org.jacoco:jacoco-maven- plugin:prepare-agent clean install -Pcoverage-per-test  Analyze the project mvn sonar:sonar
  • 52.  ! Unit testing
  • 56.  Add integration test coverage widget to SonarQube  Download Jacoco agent  Configuration for Tomcat’s catalina.bat: set JACOCO=- javaagent:$path$libjacocoagent.jar, destfile=$resultpath$jacoco.exec, append=false,includes=com.dockerpi.* set JAVA_OPTS=%JAVA_OPTS% %JACOCO%
  • 57.  Start Tomcat  Execute tests (manual, integration, performance…)  Stop Tomcat and execute SonarQube analysis mvn clean install sonar:sonar -Dsonar.dynamicAnalysis=reuseReports -Dsonar.jacoco.itReportPath= $resultpath$jacoco.exec
  • 62.  Enable ‘Survived mutant’ rule in SonarQube Quality Profile  Configure Pitest for instance with Maven (see next slides)
  • 63.  Execute tests and send results to SonarQube mvn org.pitest:pitest- maven:mutationCoverage mvn sonar:sonar -Dsonar.pitest.mode=reuseReport
  • 64.  Maven configuration inside the build/plugins section <plugin> <groupId>org.pitest</groupId> <artifactId>pitest-maven</artifactId> <version>LATEST</version> <configuration> <inScopeClasses> <param>com.example*</param> </inScopeClasses> <targetClasses> <param>com.example*</param> </targetClasses> <outputFormats> <outputFormat>XML</outputFormat> </outputFormats>
  • 74.  Ignore files  Ignore issues  Ignore duplications  Ignore code coverage  Example: mvn sonar:sonar -Dsonar.exclusions= src/main/webapp/lib/*.js
  • 86.  Identity hotspots  Use action plans  Maybe use a less strict quality profile  Add tasks/stories in the sprint to improve quality  Monitor quality of new code
  • 91.  Create stories/tasks to improve the quality  Perform manual code reviews  Agree on a standard for items SonarQube cannot check  Fix items or mark them as false positive  Use separate logins  Settings/reviews are project specific
  • 92.  Options to use SonarQube o Central server (commit AND nightly) o IDE plugin o Local in your development environment  Check code quality before ‘To verify’ step o First merge your code so it is up to date  Verifier should also verify the quality
  • 94. “Once we accept our limits, we go beyond them.” - Albert Einstein
  • 95.  Ask me!  Sonarqube.org  Nemo example dashboard  SonarQube books [email protected] @johanjanssen42

Editor's Notes

  • #10: Source: http://www.unix-ag.uni-kl.de/~guenther/images/failure-small.jpg
  • #38: Source: http://eugenedvorkin.com/wp-content/gallery/cache/220__320x240_code_reviews.jpg
  • #85: Package tangle index and duplications from Jenkins
  • #86: Package tangle index and duplications from Jenkins