diffscope 0.5.2

A composable code review engine with smart analysis, confidence scoring, and professional reporting
# Diffscope Enhanced Features

## Smart Review System

Diffscope now includes a comprehensive smart review system inspired by modern code review tools, providing intelligent analysis with actionable insights.

### Features Added

#### 1. Enhanced Comment System
- **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

#### 2. Comprehensive Issue Classification
- **Severity Levels**: Error, Warning, Info, Suggestion
- **Extended Categories**: 
  - Security (๐Ÿ”’)
  - Performance (โšก) 
  - Bug (๐Ÿ›)
  - Style (๐ŸŽจ)
  - Documentation (๐Ÿ“š)
  - Testing (๐Ÿงช)
  - Maintainability (๐Ÿ”ง)
  - Architecture (๐Ÿ—๏ธ)

#### 3. Executive Summary & Analytics
- **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

#### 4. Smart Review Command
```bash
# 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
```

### Output Formats

#### Executive Summary
- ๐Ÿ“Š Code quality score with emoji indicators
- ๐Ÿ“ Total issues found with breakdown
- ๐Ÿšจ Critical issues requiring immediate attention
- ๐Ÿ“ Files analyzed count

#### Detailed Analysis
- Issues grouped by severity (Critical โ†’ High โ†’ Medium โ†’ Low)
- Per-issue metadata: confidence, effort, tags
- Code suggestions with diff previews
- File-grouped organization

### Security Enhancements

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**

### Performance Analysis

Advanced performance issue detection:

- **N+1 Query Detection**
- **Inefficient Algorithm Patterns**
- **Memory Usage Concerns**
- **Caching Opportunities**

### Example Usage

```bash
# 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
```

### Integration Benefits

1. **Higher Accuracy**: Advanced prompting and confidence scoring reduce false positives
2. **Actionable Insights**: Each issue includes specific fix suggestions
3. **Educational Value**: Explanations help developers learn best practices
4. **Prioritized Workflow**: Issues ranked by severity and effort for efficient fixing
5. **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.