Skip to content

Add improved commit classification, per-module breakdown, and DDEV support#1

Open
podarok wants to merge 3 commits intodbuytaert:mainfrom
podarok:main
Open

Add improved commit classification, per-module breakdown, and DDEV support#1
podarok wants to merge 3 commits intodbuytaert:mainfrom
podarok:main

Conversation

@podarok
Copy link

@podarok podarok commented Jan 8, 2026

Summary

This PR enhances the Drupal Core Metrics dashboard with improved commit classification, per-module breakdown, and local development support.

Changes

1. Enhanced Commit Classification

📊 Before vs After
Before After
Simple prefix matching (fix:, feat:) Full Conventional Commits spec + Drupal.org patterns
Many commits classified as "Unknown" Intelligent keyword fallback reduces unknowns

New classification approach (3-tier):

  1. Conventional Commits - feat:, fix:, chore:, etc. with optional scope
  2. Drupal.org Issue parsing - Extracts description from Issue #XXX by authors: Add something and recursively classifies
  3. Keyword fallback - Detects add, fix, refactor, etc. in message text
# Example: "Issue #3556987 by user: Add a recursive sort-by"
# → Extracts "Add a recursive sort-by" → Matches "add " → Returns "Feature"

2. Per-Module Breakdown

New section showing metrics for each core/modules/* directory:

Column Description
Module Module name
LOC Lines of code
CCN (avg) Cyclomatic complexity (red >10, yellow >6)
MI (avg) Maintainability index (red <65, yellow <85)
Anti-patterns Total anti-pattern count

3. Debug Mode

DEBUG=1 python3 scripts/analyze.py

Outputs detailed logging for troubleshooting analysis issues.

4. DDEV Configuration

Added .ddev/config.yaml for easy local development:

ddev start && ddev composer install
ddev exec "cd /var/www/html && python3 scripts/analyze.py"
ddev launch

5. Updated Documentation

  • README now includes DDEV setup as recommended option
  • Dashboard explanations updated to describe classification methodology
  • Per-module section explains threshold colors

Files Changed

.ddev/config.yaml   # New: DDEV configuration
README.md           # Updated: DDEV setup guide
index.html          # Updated: Per-module table + explanations
scripts/analyze.py  # Updated: Classification + per-module + debug

Testing

  • Ran full analysis with DEBUG=1
  • Verified per-module breakdown appears in dashboard
  • Tested commit classification with Drupal.org issue format
  • Confirmed DDEV setup works from scratch

- Conventional Commits + Drupal.org Issue # parsing + keyword fallback
- Per-module stats for core/modules/* with CCN/MI thresholds
- DDEV configuration for local development
- Updated explanations in dashboard UI
- Debug mode via DEBUG=1 environment variable
@podarok
Copy link
Author

podarok commented Jan 8, 2026

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant