|
46 | 46 |
|
47 | 47 | ### Refactoring Priority
|
48 | 48 |
|
49 |
| -1. **extension.ts** (38.68% coverage) - extract initialization logic |
| 49 | +1. **extension.ts** (39.71% → 71.02% coverage ✅) - Break down monolithic activate() function |
| 50 | + |
| 51 | + Extract these helper functions (TDD - write tests first): |
| 52 | + |
| 53 | + - [x] setupRemoteSSHExtension() - Configure remote SSH extension |
| 54 | + - [x] initializeInfrastructure() - Create storage and logger |
| 55 | + - [x] initializeRestClient() - Setup REST client |
| 56 | + - [x] setupTreeViews() - Create workspace providers and trees |
| 57 | + - [x] registerUriHandler() - Handle vscode:// URIs |
| 58 | + - [ ] registerCommands() - Register all VS Code commands |
| 59 | + - [ ] handleRemoteEnvironment() - Setup remote workspace if needed |
| 60 | + - [ ] checkAuthentication() - Verify user auth and fetch workspaces |
| 61 | + - [ ] handleAutologin() - Process autologin configuration |
| 62 | + |
| 63 | + Approach: Extract one function at a time, add tests, maintain passing suite |
| 64 | + |
50 | 65 | 2. **remote.ts** (49.21% coverage) - break down 400+ line methods
|
51 | 66 | 3. **commands.ts** (64.19% coverage) - create UI abstraction layer
|
52 | 67 |
|
|
59 | 74 |
|
60 | 75 | ## Success Metrics
|
61 | 76 |
|
62 |
| -| Metric | Target | Current | Status | |
63 |
| -| ------------------------ | ------ | ------- | ----------- | |
64 |
| -| Unit test coverage | 80%+ | 74.97% | 🔄 Progress | |
| 77 | +| Metric | Target | Current | Status | |
| 78 | +| ------------------------ | ------ | --------------------- | ----------- | |
| 79 | +| Unit test coverage | 80%+ | 77.28% | 🔄 Progress | |
65 | 80 | | Integration tests | 60+ | 69 | ✅ Complete |
|
66 | 81 | | Logger adoption | 100% | 100% | ✅ Complete |
|
67 |
| -| Files with <50% coverage | 0 | 3 | 🔄 Progress | |
| 82 | +| Files with <50% coverage | 0 | 1 | 🔄 Progress | |
68 | 83 |
|
69 | 84 | ## Immediate Next Steps
|
70 | 85 |
|
71 |
| -1. **Clean up api.test.ts** |
| 86 | +1. **Refactor extension.ts using TDD** |
| 87 | + |
| 88 | + - Start with setupRemoteSSHExtension() - write test first |
| 89 | + - Continue with initializeInfrastructure() and other functions |
| 90 | + - Run `yarn test:ci --coverage` after each extraction |
| 91 | + - Target: 39.71% → 60%+ coverage |
72 | 92 |
|
| 93 | +2. **Clean up api.test.ts** |
73 | 94 | - Remove eslint-disable comment
|
74 | 95 | - Create proper mock types for 30+ `as any` casts
|
75 | 96 | - Consider exposing test interfaces for better type safety
|
76 |
| - |
77 |
| -3. **Improve low-coverage files** |
78 |
| - - extension.ts: 38.68% → 60%+ (extract initialization) |
79 |
| - - remote.ts: 49.21% → 70%+ (break down large methods) |
80 |
| - - commands.ts: 64.19% → 75%+ (UI abstraction) |
|
0 commit comments