@aiserviceprovider/sonar
v1.0.2
Published
An Angular sonar setup module extension for AI-ServiceProvider backend project.
Maintainers
Readme
🤖 AI AppBuilder Extension – SonarQube Scan Module

📌 Overview
The AI AppBuilder SonarQube Scan Module is an extension designed to integrate automated code quality analysis into Angular applications generated by the AI AppBuilder platform.
This extension leverages SonarQube to perform static code analysis, identify code smells, security vulnerabilities, bugs, and enforce coding standards for Angular applications built using AI AppBuilder.
It ensures that every generated Angular project maintains enterprise-grade code quality, security compliance, and maintainability.
🎯 Purpose
The primary goal of this module is to:
Automatically scan Angular applications generated by AI AppBuilder
Enforce code quality standards
Detect:
- 🐛 Bugs
- 🔐 Security vulnerabilities
- 🧹 Code smells
- 📏 Duplications
- 📊 Technical debt
Provide detailed quality reports
Support CI/CD quality gate enforcement
🏗 Architecture Overview
AI AppBuilder
│
▼
Generated Angular App
│
▼
SonarQube Scan Module (Extension)
│
▼
SonarQube Server
│
▼
Quality Reports & Quality Gate Status🔍 How It Works
AI AppBuilder generates an Angular application.
The SonarQube Scan Module:
- Configures Sonar scanner properties
- Sets project key & metadata
- Executes SonarQube scan
Scan results are published to SonarQube server.
Quality Gate status is returned.
Build process can be:
- ✅ Passed (if quality gate succeeds)
- ❌ Failed (if quality gate fails)
⚙️ Features
- 🔄 Automatic scanning after Angular project generation
- 📦 Zero manual Sonar setup required
- 🧠 AI-aware configuration support
- 📊 Detailed code metrics
- 🔐 Security hotspot detection
- 🏷 Configurable project keys
- 🚦 Quality gate validation
- 🔌 CI/CD ready
🛠 Installation
npm install @aiserviceprovider/sonar🚀 Usage
1️⃣ Configure SonarQube Server
Ensure a running SonarQube instance:
- SonarQube Server URL
- Authentication Token
- Project Key
Example environment variables:
SONAR_HOST_URL=http://localhost:9000
SONAR_TOKEN=your_generated_token
SONAR_PROJECT_KEY=ai-app-angular-app📊 Quality Metrics Collected
The module collects and reports:
- Code Coverage
- Maintainability Rating
- Reliability Rating
- Security Rating
- Lines of Code
- Duplications
- Technical Debt Ratio
All metrics are published to SonarQube dashboard.
🔐 Security
This module helps enforce:
- OWASP vulnerability detection
- Hardcoded secret detection
- Dependency risk visibility
- Angular best practice compliance
🧩 Configuration Options
| Option | Description | Required | | ---------- | ------------------------------- | -------- | | projectKey | Unique Sonar project identifier | ✅ | | sourcePath | Angular source folder | ✅ | | hostUrl | SonarQube server URL | ✅ | | token | Authentication token | ✅ | | exclusions | Files to exclude | ❌ |
📌 Requirements
- Node.js >= 16
- Angular project generated by AI AppBuilder
- Running SonarQube Server
- Sonar Scanner CLI
🧠 Why This Module?
Angular applications generated by AI can grow rapidly. Automated static analysis ensures:
- Scalable architecture
- Secure coding practices
- Maintainable codebase
- Enterprise readiness
This extension embeds quality control directly into the application generation lifecycle.
