Skip to content

feat: Adding Code atlas support #1

feat: Adding Code atlas support

feat: Adding Code atlas support #1

Workflow file for this run

name: Code Atlas Analysis
on:
push:
branches: [main, develop]
pull_request:
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for git metadata
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install code-atlas
run: npm install -g @bernardwiesner/code-atlas
- name: Scan codebase
run: code-atlas scan --include-git --no-include-tests
- name: Check complexity threshold
run: |
MAX_COMPLEXITY=10
ACTUAL=$(code-atlas stats --format json | jq -r '.averageComplexity // 0')
echo "Average complexity: $ACTUAL (threshold: $MAX_COMPLEXITY)"
if (( $(echo "$ACTUAL > $MAX_COMPLEXITY" | bc -l) )); then
echo "❌ Code complexity exceeds threshold!"
exit 1
fi
- name: Generate dependency graphs
run: |
code-atlas graph --format mermaid --output dependency-graph.md
- name: Generate HTML report
run: code-atlas report --output code-atlas-report.html
- name: Display statistics
run: code-atlas stats
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: code-atlas-reports
path: |
code-atlas-report.html
dependency-graph.md
registry.json