# Next Easy Improvements - Implementation Priority
## ✅ Already Implemented
1. **Spring Boot Blocker Fix** - ✅ DONE
2. **Jakarta Mappings YAML** - ✅ DONE (10+ mappings)
3. **Gradle Support** - ✅ DONE (both Groovy and Kotlin DSL)
4. **Enhanced Version Recommendations** - ✅ DONE (checks both groupId and artifactId)
---
## 🎯 Easy Next Steps (High Value, Low Effort)
### 1. Source Code Scanning (2-3 days) ⭐ HIGHEST PRIORITY
**Why**: Currently the tool only analyzes dependencies, not actual source code. This is a critical gap.
**Effort**: Medium (2-3 days)
**Value**: Very High - Provides complete migration scope
**Implementation**:
- Create `SourceCodeScanner` service
- Scan `.java` files for `javax.*` imports
- Return list of files with javax usage
- Add MCP tool `scanSourceCode`
**Files to Create**:
- `src/main/java/.../service/SourceCodeScanner.java`
- `src/main/java/.../domain/SourceCodeAnalysisResult.java`
- `src/main/java/.../domain/FileUsage.java`
- `src/main/java/.../domain/ImportStatement.java`
**MCP Tool to Add**:
```java
@McpTool(name = "scanSourceCode", description = "Scans source code for javax.* usage")
public String scanSourceCode(String projectPath)
```
**Impact**: Users can see exactly which files need migration, not just dependencies.
---
### 2. Improve Migration Plan Specificity (1-2 days)
**Why**: Current plans are generic ("Refactor Java files batch 1"). Need file-specific actions.
**Effort**: Low (1-2 days)
**Value**: High - Makes plans actionable
**Current Issue**: Plans don't tell users what to change in each file.
**Implementation**:
- Enhance `MigrationPlanner` to analyze files before creating phases
- Use `SourceCodeScanner` (from #1) to get specific imports per file
- Generate file-specific actions in migration plan
**Files to Modify**:
- `src/main/java/.../service/MigrationPlanner.java`
- `src/main/java/.../domain/RefactoringPhase.java` (add actions field)
**Example Output**:
```json
{
"phases": [{
"number": 2,
"files": ["src/main/java/MyServlet.java"],
"actions": [{
"file": "src/main/java/MyServlet.java",
"changes": [
"Line 5: Replace 'import javax.servlet.*' with 'import jakarta.servlet.*'",
"Line 12: Replace 'javax.servlet.ServletException' with 'jakarta.servlet.ServletException'"
]
}]
}]
}
```
**Impact**: Users know exactly what to change in each file.
---
### 3. Enhanced Version Recommendations (1 day)
**Why**: Currently only checks groupId starting with "javax." and a few artifactIds. Could be more comprehensive.
**Effort**: Low (1 day)
**Value**: Medium - Better coverage
**Current**: Already checks:
- `groupId.startsWith("javax.")`
- `artifactId.startsWith("javax-")`
- `artifactId.equals("javax.mail")`
- `artifactId.equals("validation-api")`
**Enhancement**: Add more common patterns:
- Check transitive dependencies
- Check for common javax patterns in artifactId
- Use mapping service more comprehensively
**Files to Modify**:
- `src/main/java/.../service/impl/DependencyAnalysisModuleImpl.java`
**Impact**: Finds more javax dependencies that need migration.
---
### 4. XML Configuration File Scanning (1-2 days)
**Why**: Many projects have `javax.*` references in XML configs (web.xml, persistence.xml, etc.)
**Effort**: Low-Medium (1-2 days)
**Value**: Medium - Catches hidden references
**Implementation**:
- Extend `SourceCodeScanner` to scan XML files
- Look for `javax.*` in:
- XML namespace declarations
- Class names in XML
- String values
**Files to Modify**:
- `src/main/java/.../service/SourceCodeScanner.java` (extend)
**Impact**: Finds javax usage in configuration files.
---
### 5. Migration Impact Summary (1 day)
**Why**: Users want to know migration scope before starting.
**Effort**: Low (1 day)
**Value**: Medium - Better user experience
**Implementation**:
- Create summary report combining:
- Dependency analysis results
- Source code scan results
- File count, line count estimates
- Risk assessment
**Files to Create**:
- `src/main/java/.../domain/MigrationImpactSummary.java`
**MCP Tool**:
```java
@McpTool(name = "analyzeMigrationImpact", description = "Analyzes full migration impact")
public String analyzeMigrationImpact(String projectPath)
```
**Impact**: Users get complete picture before starting migration.
---
## 📊 Implementation Priority
### Phase 1 (This Week - High Value)
1. **Source Code Scanning** (2-3 days) - Critical missing feature
2. **Improve Migration Plan Specificity** (1-2 days) - Makes plans useful
### Phase 2 (Next Week - Medium Value)
3. **Enhanced Version Recommendations** (1 day) - Better coverage
4. **XML Configuration Scanning** (1-2 days) - Complete picture
5. **Migration Impact Summary** (1 day) - Better UX
---
## 🚀 Recommended: Start with Source Code Scanning
**Why Source Code Scanning First?**
- It's the #1 missing feature (tool only analyzes dependencies)
- Enables other improvements (better migration plans, impact analysis)
- High user value - shows exactly what needs migration
- Medium effort - straightforward implementation
**After Source Code Scanning:**
- Migration plans can be file-specific
- Impact analysis can include file counts
- Users see complete migration scope
---
## 💡 Quick Implementation Strategy
### Source Code Scanner (Simplified Version - 1 day)
Start with a simple regex-based scanner (can upgrade to AST later):
```java
@Component
public class SourceCodeScanner {
public SourceCodeAnalysisResult scanProject(Path projectPath) {
List<FileUsage> usages = new ArrayList<>();
try (Stream<Path> paths = Files.walk(projectPath)) {
paths
.filter(Files::isRegularFile)
.filter(p -> p.toString().endsWith(".java"))
.filter(p -> !p.toString().contains("/target/"))
.filter(p -> !p.toString().contains("/build/"))
.forEach(file -> {
FileUsage usage = scanFile(file);
if (!usage.javaxImports().isEmpty()) {
usages.add(usage);
}
});
} catch (IOException e) {
log.error("Error scanning project", e);
}
return new SourceCodeAnalysisResult(usages);
}
private FileUsage scanFile(Path file) {
try {
String content = Files.readString(file);
List<ImportStatement> imports = extractJavaxImports(content);
return new FileUsage(
file,
imports,
file.toString().split("\n").length
);
} catch (IOException e) {
log.error("Error scanning file: " + file, e);
return new FileUsage(file, List.of(), 0);
}
}
private List<ImportStatement> extractJavaxImports(String content) {
List<ImportStatement> imports = new ArrayList<>();
Pattern pattern = Pattern.compile("^import\\s+(javax\\.\\w+.*);", Pattern.MULTILINE);
Matcher matcher = pattern.matcher(content);
String[] lines = content.split("\n");
while (matcher.find()) {
String fullImport = matcher.group(1);
int lineNumber = findLineNumber(lines, fullImport);
String jakartaEquivalent = fullImport.replace("javax.", "jakarta.");
imports.add(new ImportStatement(fullImport, jakartaEquivalent, lineNumber));
}
return imports;
}
private int findLineNumber(String[] lines, String searchText) {
for (int i = 0; i < lines.length; i++) {
if (lines[i].contains(searchText)) {
return i + 1;
}
}
return 0;
}
}
```
This simple version can be implemented in 1 day and provides immediate value!