How imran9m/python-sonarqube-example works
Project Type Analysis
This is a quality assurance and testing infrastructure project that demonstrates the integration of various code quality tools with SonarQube for a simple Python calculator application.
Main Components
A. Development Environment:
• Python Source Code (calculator.py)
• Python Test Files (test_calculator.py)
• Virtual Environment (.penvsonar)
B. Quality Analysis Tools:
• Pylint (Static Code Analysis)
• Bandit (Security Analysis)
• Coverage.py (Code Coverage)
• Pytest (Testing Framework)
C. Infrastructure:
• Docker Network (sonar-network)
• SonarQube Container
• Sonar Scanner Container
Source Code Layer (Green Rectangle)
• Calculator.py and test_calculator.py
• Requirements files
• Virtual environment
Quality Analysis Layer (Blue Rectangle)
• Pylint → pylint-report.txt
• Bandit → bandit-report.json
• Coverage/Pytest → coverage.xml, pytest-report.xml
Infrastructure Layer (Orange Rectangle)
• Docker Network
• SonarQube Container (Port 9000)
• Sonar Scanner Container
Relationships:
Source Code → Quality Tools → Reports → Sonar Scanner → SonarQube
Additional Elements
• File types (source, test, report)
• Container components
• Network connections
• Tool purposes
Important Details
• Docker network name: sonar-network
• SonarQube port: 9000
• Volume mounting points
• Environment variables