Introduction To Sonarqube: Chris Vogel Cjvogel1972 Cjvogel1972
Introduction To Sonarqube: Chris Vogel Cjvogel1972 Cjvogel1972
Introduction To Sonarqube: Chris Vogel Cjvogel1972 Cjvogel1972
Chris Vogel
cjvogel1972 cjvogel1972
About Me
• Background:
• Application Architecture
• Mentoring
• Frameworks
• Developer tools
• Infrastructure
Agenda
• What is SonarQube
• Architecture
• Installation
• Rules/Quality Profiles/Issues
• Quality Gates
• Run Scans
• SonarLint
SonarQube
• Understands 15 languages
• Company SonarSource
• Licensed products
• Developer Edition
• Enterprise Edition
SonarQube Architecture
Architecture - SonarQube Server
2.Developers push their code into their favorite SCM : git, SVN,
TFVC, ...
• Requires Java 8
• Oracle
• PostgreSQL
• SQL Server
Installation - The EASY way
• Docker image
docker run -d --name sonarqube -p 9000:9000 sonarqube
• Severities
1. BLOCKER
Bug with a high probability to impact the behavior of the application in production: memory leak, unclosed JDBC connection, .... The
code MUST be immediately fixed.
2. CRITICAL
Either a bug with a low probability to impact the behavior of the application in production or an issue which represents a security flaw:
empty catch block, SQL injection, ... The code MUST be immediately reviewed.
3. MAJOR
Quality flaw which can highly impact the developer productivity: uncovered piece of code, duplicated blocks, unused parameters, ...
4. MINOR
Quality flaw which can slightly impact the developer productivity: lines should not be too long, "switch" statements should have at least 3
cases, ...
5. INFO
Neither a bug nor a quality flaw, just a finding.
Issues
• Statuses
• Resolved - set manually to indicate that the next analysis should Close the issue
• Resolutions - Closed
• Fixed - set automatically when a subsequent analysis shows that the issue has been
corrected or the file is no longer available (removed from the project, excluded or renamed)
• Removed - set automatically when the related rule is no longer available. The rule may not
be available either because it has been removed from the Quality Profile or because the
underlying plugin has been uninstalled.
• Resolutions - Resolved
• On all languages, "blame" data will automatically be imported from supported SCM
providers. Git and SVN are supported automatically. Other providers require
additional plugins.
• On all languages, a static analysis of source code is performed (Java files, COBOL
programs, etc.)
• A static analysis of compiled code can be performed for certain languages (.class
files in Java, .dll files in C#, etc.)
• IDE extension
• IDEs supported
• Eclipse
• IntelliJ IDEA
• Visual Studio
• VS Code