Diffscope now includes a comprehensive smart review system inspired by modern code review tools, providing intelligent analysis with actionable insights.
- Confidence Scoring: Each issue includes a confidence percentage (0-100%)
- Fix Effort Estimation: Categorized as Low, Medium, or High effort
- Smart Tagging: Automatic categorization with relevant tags
- Code Suggestions: AI-generated code fixes with diff previews
- Severity Levels: Error, Warning, Info, Suggestion
- Extended Categories:
- Security (🔒)
- Performance (⚡)
- Bug (🐛)
- Style (🎨)
- Documentation (📚)
- Testing (🧪)
- Maintainability (🔧)
- Architecture (🏗️)
- Overall Code Quality Score (0-10 scale)
- Issue Breakdown by severity and category
- Actionable Recommendations based on findings
- File-by-file Analysis with grouped issues
# Enhanced analysis with detailed reporting
diffscope smart-review --diff changes.patch --output report.md
# Analyze from stdin with smart insights
git diff | diffscope smart-review
# Use different models for analysis
diffscope smart-review --model claude-3-5-sonnet-20241022 --diff pr.patch- 📊 Code quality score with emoji indicators
- 📝 Total issues found with breakdown
- 🚨 Critical issues requiring immediate attention
- 📁 Files analyzed count
- Issues grouped by severity (Critical → High → Medium → Low)
- Per-issue metadata: confidence, effort, tags
- Code suggestions with diff previews
- File-grouped organization
The smart review system includes enhanced security analysis:
- SQL Injection Detection with high confidence scoring
- XSS/CSRF Pattern Recognition
- Authentication/Authorization Issues
- Input Validation Problems
- Parameterized Query Suggestions
Advanced performance issue detection:
- N+1 Query Detection
- Inefficient Algorithm Patterns
- Memory Usage Concerns
- Caching Opportunities
# Review current changes with smart analysis
git diff | diffscope smart-review
# Analyze a specific PR with enhanced reporting
gh pr diff 123 | diffscope smart-review --output pr-review.md
# Compare two files with smart insights
diffscope smart-review --old-file src/old.py --new-file src/new.py- Higher Accuracy: Advanced prompting and confidence scoring reduce false positives
- Actionable Insights: Each issue includes specific fix suggestions
- Educational Value: Explanations help developers learn best practices
- Prioritized Workflow: Issues ranked by severity and effort for efficient fixing
- Professional Reporting: Executive summaries suitable for team reviews
This enhanced system provides professional-grade code review capabilities while maintaining the simplicity and flexibility of the original diffscope architecture.
- Regex and LSP-backed symbol indexing with auto-detection when
symbol_index_lsp_commandis omitted. - LSP preflight command:
diffscope lsp-checkvalidates binaries, language IDs, and unmapped extensions. - Ready-to-copy LSP configs in
examples/lsp/and setup guide indocs/lsp.md.
strictnesslevels (1-3) to control review depth and noise.comment_typesfiltering (logic,syntax,style,informational) to focus output.- Scoped
custom_contextentries to inject path-specific notes and context files. pattern_repositoriessupport for shared cross-repo context packs (local or git-cloned).- Adaptive suppression of repeated low-value comment types based on accepted/rejected feedback history.
discusscommand for threaded follow-up Q&A on generated review comments.- Multi-hop symbol context via dependency graph expansion (
symbol_index_graph_hops,symbol_index_graph_max_files).