Free live webinar • November 21, 2026 • 9:30 AM CST   Register free →
2017–2027Celebrating Our 10th Year

Transform Your Career.
Engineer Your Future.

Build the skills to become an AI-Enabled DevSecOps & Cloud Engineer with 15 weeks of live training, hands-on labs and personal mentorship.

Coach AK in his DevOps learning studio
Coach AK | Ananth KannanSenior DevOps & SRE Architect • Founder, CoachDevOps
3,500+Students Trained
25+ YearsIT Experience
15 WeeksLive Training
70+Hands-on Labs

Master In-Demand Technologies

AWSAzureDockerKubernetesTerraformJenkinsGitHub ActionsAnsibleGitLab

AI-Enabled DevSecOps & Cloud Engineering Bootcamp

Next weekend batch: December 5, 2026
Saturday 9:30–11:30 AM CST • Sunday 10:30 AM–12:30 PM CST

Live classes, practical projects, personal mentorship and career preparation.

View Program Details →

Real Students. Real Success.

Career milestones shared by our students.

✓ Placement in an AI role
“The concepts you taught have improved my technical understanding and confidence.”
ManimaranJuly 2026 Bootcamp
✓ DevSecOps Engineer offer
“I want to sincerely thank you for your mentorship, training, and support.”
Femi AshayeCoachDevOps Alumni
✓ DevOps Engineer offer
“I got an offer for Devops engineer Last week and happy to inform you. I really appreciate you.”
EbenezerCoachDevOps Alumni
View All Success Stories →

Individual student experiences; employment is not guaranteed.

Ready to Take the Next Step?

Explore the program or get answers to your questions before enrolling.

Saturday, February 11, 2023

How to fix bugs found during SonarQube code analysis | How to resolve defects found in Java Web App during Sonar Scan

Let's say you have configured a build job in Jenkins to implement CI and you are performing code scan using SonarQube. Code scan results shown some defects(bugs) in your Java Code.

If you look at Jenkins console output, you can see analysis was successful.


If you look at SonarQube project dashboard, you are seeing defects like shown below. How do fix those defects? Let's see the steps to fix those defects.



Pre-requisites:
  • Sonarqube is setup and running
  • Jenkins is up and running
  • Java WebApp setup in GitHub
  • build job configured in Jenkins to perform code scan
Now login to SonarQube
Click on Project name MyWebApp


Click on Overall code, click on 3 Bugs
Now this shows what is the issue with code. it needs <!DOCTYPE> declaration before <html> tag


Click on Why this an issue to learn more about the issue and how you can fix it.
Now code to GitHub where Java WebApp is configured, edit the index.jsp under MyWebApp/src/main/webapp

Fix for bug # 1

add <!DOCTYPE html> above <html> tag

Fix for bug # 2

add <html lang="en">

Fix for bug # 3
    <head>
          <title>My WebApp</title>
          <meta content="text/html; charset=utf-8" />
    </head>  


Now commit the code changes.

run the build in Jenkins by clicking on Build now.
Login to SonarQube, now you will see no bugs.


This is how you can fix defects found by SonarQube.

No comments:

Post a Comment