Skip to the content.

SonarQube & Snyk Integration Guide

🎯 What’s Been Added

The Airo super app now has integrated code quality and security scanning:

SonarQube

Snyk


🚀 Quick Start

1. Create SonarCloud Account (5 minutes)

# Go to https://sonarcloud.io
# Sign up with GitHub
# Create organization
# Create project for 'airo' repository
# Generate token at https://sonarcloud.io/account/security

2. Create Snyk Account (5 minutes)

# Go to https://app.snyk.io
# Sign up with GitHub
# Add 'airo' repository
# Generate API token at https://app.snyk.io/account/api-token

3. Add GitHub Secrets (5 minutes)

# Go to https://github.com/DevelopersCoffee/airo/settings/secrets/actions

# Add SONAR_TOKEN
# Name: SONAR_TOKEN
# Value: [token from SonarCloud]

# Add SNYK_TOKEN
# Name: SNYK_TOKEN
# Value: [token from Snyk]

4. Test Integration (5 minutes)

# Push a commit to main
git push origin main

# Go to Actions tab
# Wait for CI workflow to complete
# Check SonarQube and Snyk results

📊 Viewing Results

SonarQube Dashboard

URL: https://sonarcloud.io/projects

View:

Snyk Dashboard

URL: https://app.snyk.io/org/ucguy4u/

View:


🔧 Configuration Files

sonar-project.properties

Located at repository root. Configures:

.snyk

Located at repository root. Configures:


📋 CI/CD Integration

SonarQube Job

Runs on every push to main/develop:

  1. Checks out code with full history
  2. Sets up Flutter
  3. Gets dependencies
  4. Runs Flutter analyze
  5. Scans with SonarQube
  6. Checks quality gate

Snyk Job

Runs on every push to main/develop:

  1. Checks out code
  2. Sets up Flutter
  3. Gets dependencies
  4. Scans with Snyk
  5. Reports vulnerabilities
  6. Uploads SARIF results

🎯 Workflow

Developer Push
    ↓
GitHub Actions Triggered
    ↓
├─ SonarQube Analysis
│  ├─ Code quality check
│  ├─ Bug detection
│  └─ Quality gate
│
└─ Snyk Security Scan
   ├─ Dependency scan
   ├─ Vulnerability check
   └─ License compliance
    ↓
Results Available
    ↓
├─ SonarCloud Dashboard
└─ Snyk Dashboard

📈 Metrics Tracked

SonarQube Metrics

Metric Description
Bugs Code issues that will cause problems
Code Smells Code quality issues
Coverage Test coverage percentage
Duplications Duplicated code blocks
Technical Debt Time to fix all issues
Security Hotspots Potential security issues

Snyk Metrics

Metric Description
Vulnerabilities Known security issues
Severity Critical/High/Medium/Low
Dependencies Total dependencies
Outdated Outdated packages
Licenses License compliance

🔐 Security Best Practices

Code Quality

  1. Fix Bugs First
    • Address critical bugs
    • Then major bugs
    • Then minor bugs
  2. Reduce Code Smells
    • Improve readability
    • Reduce complexity
    • Remove duplication
  3. Increase Coverage
    • Target 80%+ coverage
    • Test critical paths
    • Add unit tests

Security

  1. Fix Vulnerabilities
    • Critical: Immediately
    • High: Within 1 week
    • Medium: Within 2 weeks
    • Low: Within 1 month
  2. Update Dependencies
    • Regular updates
    • Monitor advisories
    • Use Snyk auto-fix
  3. License Compliance
    • Check licenses
    • Avoid incompatible licenses
    • Document exceptions

🛠️ Troubleshooting

SonarQube

Issue: “SONAR_TOKEN not found”

Issue: “Quality gate failed”

Issue: “No coverage data”

Snyk

Issue: “SNYK_TOKEN not found”

Issue: “Vulnerabilities detected”

Issue: “License issues”


📞 Support

Documentation

Dashboards

Help


✅ Verification Checklist


Status: ✅ Integration Complete Date: November 2, 2025 Next Step: Add secrets and test