imfozilbek
8d400c9517
refactor: extract detector logic into focused strategy classes
...
Refactored three largest detectors to improve maintainability and reduce complexity:
- AggregateBoundaryDetector: 381 → 162 lines (57% reduction)
- HardcodeDetector: 459 → 89 lines (81% reduction)
- RepositoryPatternDetector: 479 → 106 lines (78% reduction)
Added 13 new strategy classes:
- FolderRegistry - centralized DDD folder name management
- AggregatePathAnalyzer - path parsing and aggregate extraction
- ImportValidator - import validation logic
- BraceTracker - brace and bracket counting
- ConstantsFileChecker - constants file detection
- ExportConstantAnalyzer - export const analysis
- MagicNumberMatcher - magic number detection
- MagicStringMatcher - magic string detection
- OrmTypeMatcher - ORM type matching
- MethodNameValidator - repository method validation
- RepositoryFileAnalyzer - file role detection
- RepositoryViolationDetector - violation detection logic
All 519 tests passing, zero ESLint errors, no breaking changes.
2025-11-25 17:41:32 +05:00
imfozilbek
8dd445995d
fix: eliminate magic strings and fix aggregate boundary detection
...
- Extract DDD folder names and repository method suggestions to constants
- Fix regex pattern to support relative paths (domain/... without leading /)
- Add non-aggregate folder exclusions (constants, shared, factories, etc.)
- Remove findAll, exists, count from ORM_QUERY_METHODS (valid domain methods)
- Add exists, count, countBy patterns to domainMethodPatterns
- Add aggregate boundary test examples
2025-11-25 00:29:02 +05:00
imfozilbek
83b5dccee4
fix: improve repository method name suggestions and patterns
...
- Add smart context-aware suggestions for repository method names
- queryUsers() → search, findBy[Property]
- selectById() → findBy[Property], get[Entity]
- insertUser() → create, add[Entity], store[Entity]
- And more intelligent pattern matching
- Expand domain method patterns support
- find*() methods (findNodes, findNodeById, findSimilar)
- saveAll() batch operations
- deleteBy*() methods (deleteByPath, deleteById)
- deleteAll() clear operations
- add*() methods (addRelationship, addItem)
- initializeCollection() initialization
- Remove findAll from ORM blacklist (valid domain method)
- Reduce complexity in suggestDomainMethodName (22 → 9)
Version 0.6.4
2025-11-24 23:49:49 +05:00
imfozilbek
5a648e2c29
fix: reduce false positives in Repository Pattern detection
...
- Added 11 new valid DDD repository method patterns
- Support for has*(), is*(), exists*(), clear*(), store*() methods
- Support for lifecycle methods: initialize(), close(), connect(), disconnect()
- Fixes issue where valid DDD patterns were flagged as violations
- Better alignment with real-world Domain-Driven Design practices
This reduces false positives in projects using cache repositories,
connection management, and domain-specific query methods.
Version: 0.6.3
2025-11-24 23:04:57 +05:00
imfozilbek
0534fdf1bd
feat: add repository pattern validation (v0.5.0)
...
Add comprehensive Repository Pattern validation to detect violations
and ensure proper domain-infrastructure separation.
Features:
- ORM type detection in repository interfaces (25+ patterns)
- Concrete repository usage detection in use cases
- Repository instantiation detection (new Repository())
- Domain language validation for repository methods
- Smart violation reporting with fix suggestions
Tests:
- 31 new tests for repository pattern detection
- 292 total tests passing (100% pass rate)
- 96.77% statement coverage, 83.82% branch coverage
Examples:
- 8 example files (4 bad patterns, 4 good patterns)
- Demonstrates Clean Architecture and SOLID principles
2025-11-24 20:11:43 +05:00