Comprehensive guide to quality assurance, testing, linting, and security scanning services integrated into OBS Polyemesis.
- Overview
- Integrated Services
- Code Quality
- Security Scanning
- Testing Infrastructure
- CI/CD Pipeline
- Badge Status
- Service Configuration
- Additional Recommended Services
- Best Practices
OBS Polyemesis employs a multi-layered approach to quality assurance and security:
- 8 Static Analysis Tools for code quality
- 5 Security Scanners for vulnerability detection
- 3 Test Suites with 100% pass rate
- Automated CI/CD on every push and pull request
- Weekly Security Scans for dependency vulnerabilities
| Service | Purpose | Status | Workflow |
|---|---|---|---|
| clang-format | Code formatting verification | ✅ Active | .github/workflows/lint.yaml |
| clang-tidy | Static analysis for C/C++ | ✅ Active | .github/workflows/lint.yaml |
| cppcheck | Additional static analysis | ✅ Active | .github/workflows/lint.yaml |
| gersemi | CMake formatting | ✅ Active | .github/workflows/lint.yaml |
| shellcheck | Shell script analysis | ✅ Active | .github/workflows/lint.yaml |
| yamllint | YAML file validation | ✅ Active | .github/workflows/lint.yaml |
| markdownlint | Markdown documentation | ✅ Active | .github/workflows/lint.yaml |
| codespell | Spell checking | ✅ Active | .github/workflows/lint.yaml |
| Snyk | Dependency vulnerability scanning | ✅ Active | .github/workflows/security.yaml |
| CodeQL | Semantic code analysis | ✅ Active | .github/workflows/security.yaml |
| Trivy | Container & filesystem scanning | ✅ Active | .github/workflows/security.yaml |
| OSV Scanner | Open source vulnerability DB | ✅ Active | .github/workflows/security.yaml |
| Dependency Review | PR dependency impact | ✅ Active | .github/workflows/security.yaml |
| SonarCloud | Code quality & coverage | ✅ Active | .github/workflows/sonarcloud.yaml |
| CTest | Unit & integration testing | ✅ Active | .github/workflows/build-project.yaml |
| AddressSanitizer | Memory leak detection | ⚙️ Optional | Build with -DENABLE_ASAN=ON |
| gcovr | Code coverage reporting | ⚙️ Optional | Build with -DENABLE_COVERAGE=ON |
Purpose: Deep static analysis for C/C++ code
Configuration: .clang-tidy
Checks:
- Bug-prone patterns
- CERT secure coding standards
- C++ Core Guidelines
- Performance optimizations
- Modernization suggestions
- Readability improvements
Run Locally:
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
find src -name '*.c' -o -name '*.cpp' | xargs clang-tidy -p buildPurpose: Additional static analysis Run Locally:
cppcheck --enable=all --suppress=missingIncludeSystem -I src src/Purpose: Continuous code quality inspection Metrics Tracked:
- Code smells
- Technical debt
- Security hotspots
- Code coverage
- Duplications
- Complexity
Dashboard: https://sonarcloud.io/project/overview?id=rainmanjam_obs-polyemesis
Purpose: Enforce consistent C/C++ code style
Configuration: .clang-format
Style: Based on LLVM with customizations
Auto-fix:
find src tests -name '*.c' -o -name '*.cpp' -o -name '*.h' | \
xargs clang-format -iPurpose: CMake code formatting Run Locally:
find . -name 'CMakeLists.txt' -o -name '*.cmake' | xargs gersemi --in-placePurpose: Markdown documentation linting
Configuration: .markdownlint.json
Run Locally:
npx markdownlint '**/*.md'Purpose: Spell checking across all files Run Locally:
codespell --skip=".git,*.png,*.jpg,build"Purpose: Dependency and code vulnerability scanning Coverage:
- Known CVEs in dependencies
- License compliance
- Code security issues
Setup:
- Sign up at https://snyk.io
- Add
SNYK_TOKENto repository secrets - Automated scans run weekly + on every push
Purpose: Semantic code security analysis Queries:
security-extended: Enhanced security checkssecurity-and-quality: Combined analysis
Languages: C/C++
Results: GitHub Security tab > Code scanning alerts
Purpose: Comprehensive vulnerability scanner Scans:
- Filesystem vulnerabilities
- Configuration issues
- Secrets detection
Severity Levels: CRITICAL, HIGH
Purpose: Google's Open Source Vulnerability database Coverage: All major ecosystems
Purpose: PR-based dependency change analysis Triggers: Pull requests only Fail Threshold: Moderate severity
Framework: Custom C test framework Coverage:
- API client operations (5 tests)
- Configuration management (3 tests)
- Multistreaming logic (5 tests)
Run Locally:
cmake -B build -DENABLE_TESTING=ON
cmake --build build --config Release
cd build && ctest --output-on-failureMetrics:
- API client lifecycle performance
- Multistream configuration overhead
- Orientation detection speed (250,000+ ops/sec)
- Network latency
Run Locally:
./build/tests/Release/obs-polyemesis-benchmarksFramework: Qt Test Status: Template stubs (for future implementation)
Run Locally:
./build/tests/Release/obs-polyemesis-ui-testsTool: gcovr Format: SonarQube XML Enable:
cmake -B build -DENABLE_COVERAGE=ON
cmake --build build
ctest --output-on-failure
gcovr --sonarqube coverage.xml -r .Tool: AddressSanitizer (ASan) Purpose: Detect memory leaks, buffer overflows, use-after-free Enable:
cmake -B build -DENABLE_ASAN=ON
cmake --build build
./build/tests/Release/obs-polyemesis-tests| Workflow | Trigger | Frequency |
|---|---|---|
| Build & Test | Push, PR | Every commit |
| Lint | Push, PR to main/develop | Every commit |
| Security | Push, PR, Schedule | Push + Weekly (Mondays) |
| SonarCloud | Push, PR to main/develop | Every commit |
| Release | Tag push (v*.*.*) |
Manual |
All workflows must pass before merging to main:
- ✅ Build succeeds on all platforms (macOS, Windows, Linux)
- ✅ All tests pass (13/13)
- ✅ Code formatting matches standards
- ✅ No high/critical security vulnerabilities
- ✅ Static analysis passes without errors
- ✅ CMake/YAML/Markdown/Shell linting passes
Add these badges to your README.md:
[](https://github.com/rainmanjam/obs-polyemesis/actions/workflows/build-project.yaml)
[](https://github.com/rainmanjam/obs-polyemesis/actions/workflows/lint.yaml)
[](https://github.com/rainmanjam/obs-polyemesis/actions/workflows/security.yaml)
[](https://sonarcloud.io/summary/new_code?id=rainmanjam_obs-polyemesis)
[](https://sonarcloud.io/summary/new_code?id=rainmanjam_obs-polyemesis)
[](https://sonarcloud.io/summary/new_code?id=rainmanjam_obs-polyemesis)
[](https://sonarcloud.io/summary/new_code?id=rainmanjam_obs-polyemesis)Add these to your GitHub repository settings (Settings → Secrets and variables → Actions):
| Secret | Purpose | Where to Get |
|---|---|---|
SNYK_TOKEN |
Snyk authentication | https://snyk.io/account |
SONAR_TOKEN |
SonarCloud authentication | https://sonarcloud.io/account/security |
- Go to https://sonarcloud.io
- Sign in with GitHub
- Import repository:
rainmanjam/obs-polyemesis - Generate token: Account → Security → Generate Tokens
- Add token to GitHub secrets as
SONAR_TOKEN - Configure project:
- Organization:
rainmanjam - Project Key:
rainmanjam_obs-polyemesis
- Organization:
- Go to https://snyk.io
- Sign in with GitHub
- Authorize Snyk to access repositories
- Generate API token: Account Settings → API Token
- Add token to GitHub secrets as
SNYK_TOKEN
- Purpose: Code coverage tracking and visualization
- Integration: Free for open source
- Setup: https://about.codecov.io/
- Benefits:
- Coverage trends over time
- PR coverage comments
- Coverage diff visualization
- Purpose: Continuous security analysis
- Integration: GitHub Advanced Security
- Benefits: Deep code analysis, automated security fixes
- Purpose: Static analysis specifically for open source
- Integration: Free for open source projects
- Setup: https://scan.coverity.com/
- Benefits: Industry-leading static analysis
- Purpose: Automated dependency updates
- Integration: GitHub App
- Setup: https://github.com/apps/renovate
- Benefits:
- Automated PR creation for updates
- Smart scheduling
- Grouped updates
- Purpose: Automated code review
- Integration: Free for open source
- Setup: https://deepsource.io/
- Benefits:
- 900+ code quality checks
- Security analysis
- Automated fixes
- Purpose: License compliance scanning
- Use Case: Enterprise adoption, license auditing
- Purpose: Open source security & license compliance
- Use Case: Enterprise-grade security
- Purpose: Application security testing
- Use Case: Enterprise security requirements
- Purpose: SAST (Static Application Security Testing)
- Use Case: Comprehensive security audits
- Purpose: Secrets detection
- Integration: GitHub App
- Setup: https://www.gitguardian.com/
- Benefits: Prevent credential leaks
- Purpose: Code quality metrics
- Focus: Maintainability assessment
- Purpose: Engineering intelligence platform
- Metrics: Maintainability, test coverage, velocity
Before Committing:
# Format code
./scripts/check-format.sh
# Run tests
cmake -B build -DENABLE_TESTING=ON
cmake --build build
cd build && ctest --output-on-failure
# Run static analysis
find src -name '*.c' -o -name '*.cpp' | xargs clang-tidy -p build
# Check for common issues
cppcheck --enable=all -I src src/- All CI/CD checks pass
- Code is properly formatted
- Tests added for new features
- Documentation updated
- No new security vulnerabilities
- SonarCloud quality gate passes
- Code coverage maintained or improved
- Regular Dependency Updates: Weekly automated scans
- Immediate CVE Response: Act on HIGH/CRITICAL within 7 days
- Code Review: All PRs require review
- Signed Commits: Recommended for maintainers
- Secret Scanning: Never commit credentials
- Weekly: Review security scan results
- Monthly: Analyze code coverage trends
- Quarterly: Review and update quality standards
- Yearly: Evaluate new QA/security tools
- Test Coverage: Tracked by SonarCloud
- Static Analysis: 0 errors, minimal warnings
- Security Vulnerabilities: 0 HIGH/CRITICAL
- Code Smells: Minimal (tracked by SonarCloud)
- Technical Debt: < 1% (SonarCloud metric)
- Code Coverage: > 80%
- Duplication: < 3%
- Complexity: Average < 10 per function
- Security Rating: A
- Maintainability Rating: A
Local tests fail with code signing errors (macOS):
- Expected behavior on macOS with Homebrew libraries
- Tests will pass in CI/CD
- Use
codesign --remove-signatureon test binaries if needed
SonarCloud build fails:
- Ensure
SONAR_TOKENis set in repository secrets - Check organization and project key match
- Verify build-wrapper output directory exists
Snyk scan fails:
- Verify
SNYK_TOKENis valid - Check token has correct permissions
- Ensure Snyk supports C/C++ analysis
- GitHub Actions Docs: https://docs.github.com/actions
- SonarCloud Docs: https://docs.sonarcloud.io/
- Snyk Docs: https://docs.snyk.io/
- clang-tidy Checks: https://clang.llvm.org/extra/clang-tidy/checks/list.html
- CodeQL Queries: https://github.com/github/codeql
When adding new QA/security services:
- Document configuration in this file
- Update CI/CD workflows
- Add status badges to README.md
- Test locally before committing
- Update troubleshooting section if needed
Last Updated: 2025-11-08 Maintained By: OBS Polyemesis Team