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
33d763c41b
fix: allow internal bounded context imports in aggregate detection (v0.7.3)
2025-11-25 00:54:03 +05:00
imfozilbek
3cd97c6197
fix: add errors/exceptions folders to DDD non-aggregate list (v0.7.2)
2025-11-25 00:43:41 +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
c75738ba51
feat: add aggregate boundary validation (v0.7.0)
...
Implement DDD aggregate boundary validation to detect and prevent direct
entity references across aggregate boundaries.
Features:
- Detect direct entity imports between aggregates
- Allow only ID or Value Object references
- Support multiple folder structures (domain/aggregates/*, domain/*, domain/entities/*)
- Filter allowed imports (value-objects, events, repositories, services)
- Critical severity level for violations
- 41 comprehensive tests with 92.55% coverage
- CLI output with detailed suggestions
- Examples of good and bad patterns
Breaking changes: None
Backwards compatible: Yes
2025-11-24 23:54:16 +05:00