driftdetect-core 0.4.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/boundaries/boundary-scanner.d.ts.map +1 -1
- package/dist/boundaries/boundary-scanner.js +184 -18
- package/dist/boundaries/boundary-scanner.js.map +1 -1
- package/dist/boundaries/types.d.ts +34 -2
- package/dist/boundaries/types.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.d.ts +3 -0
- package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.js +81 -18
- package/dist/call-graph/analysis/graph-builder.js.map +1 -1
- package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/csharp-data-access-extractor.js +18 -5
- package/dist/call-graph/extractors/csharp-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/csharp-extractor.d.ts +35 -0
- package/dist/call-graph/extractors/csharp-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/csharp-extractor.js +362 -4
- package/dist/call-graph/extractors/csharp-extractor.js.map +1 -1
- package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts +37 -0
- package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/csharp-hybrid-extractor.js +408 -0
- package/dist/call-graph/extractors/csharp-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/data-access-extractor.d.ts +16 -2
- package/dist/call-graph/extractors/data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/data-access-extractor.js +114 -5
- package/dist/call-graph/extractors/data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/hybrid-extractor-base.d.ts +102 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.d.ts.map +1 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.js +289 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.js.map +1 -0
- package/dist/call-graph/extractors/index.d.ts +17 -13
- package/dist/call-graph/extractors/index.d.ts.map +1 -1
- package/dist/call-graph/extractors/index.js +24 -23
- package/dist/call-graph/extractors/index.js.map +1 -1
- package/dist/call-graph/extractors/java-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/java-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/java-data-access-extractor.js +20 -6
- package/dist/call-graph/extractors/java-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/java-extractor.d.ts +15 -0
- package/dist/call-graph/extractors/java-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/java-extractor.js +120 -4
- package/dist/call-graph/extractors/java-extractor.js.map +1 -1
- package/dist/call-graph/extractors/java-hybrid-extractor.d.ts +36 -0
- package/dist/call-graph/extractors/java-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/java-hybrid-extractor.js +426 -0
- package/dist/call-graph/extractors/java-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/php-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/php-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/php-data-access-extractor.js +20 -6
- package/dist/call-graph/extractors/php-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/php-extractor.d.ts +48 -1
- package/dist/call-graph/extractors/php-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/php-extractor.js +460 -6
- package/dist/call-graph/extractors/php-extractor.js.map +1 -1
- package/dist/call-graph/extractors/php-hybrid-extractor.d.ts +35 -0
- package/dist/call-graph/extractors/php-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/php-hybrid-extractor.js +393 -0
- package/dist/call-graph/extractors/php-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/python-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/python-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/python-data-access-extractor.js +20 -6
- package/dist/call-graph/extractors/python-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/python-hybrid-extractor.d.ts +85 -0
- package/dist/call-graph/extractors/python-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/python-hybrid-extractor.js +462 -0
- package/dist/call-graph/extractors/python-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts +154 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.js +346 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.js.map +1 -0
- package/dist/call-graph/extractors/regex/csharp-regex.d.ts +34 -0
- package/dist/call-graph/extractors/regex/csharp-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/csharp-regex.js +393 -0
- package/dist/call-graph/extractors/regex/csharp-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/index.d.ts +25 -0
- package/dist/call-graph/extractors/regex/index.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/index.js +66 -0
- package/dist/call-graph/extractors/regex/index.js.map +1 -0
- package/dist/call-graph/extractors/regex/java-regex.d.ts +34 -0
- package/dist/call-graph/extractors/regex/java-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/java-regex.js +327 -0
- package/dist/call-graph/extractors/regex/java-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/php-regex.d.ts +30 -0
- package/dist/call-graph/extractors/regex/php-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/php-regex.js +333 -0
- package/dist/call-graph/extractors/regex/php-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/python-regex.d.ts +46 -0
- package/dist/call-graph/extractors/regex/python-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/python-regex.js +380 -0
- package/dist/call-graph/extractors/regex/python-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/typescript-regex.d.ts +27 -0
- package/dist/call-graph/extractors/regex/typescript-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/typescript-regex.js +349 -0
- package/dist/call-graph/extractors/regex/typescript-regex.js.map +1 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts +11 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts.map +1 -1
- package/dist/call-graph/extractors/semantic-data-access-scanner.js +53 -2
- package/dist/call-graph/extractors/semantic-data-access-scanner.js.map +1 -1
- package/dist/call-graph/extractors/types.d.ts +111 -0
- package/dist/call-graph/extractors/types.d.ts.map +1 -0
- package/dist/call-graph/extractors/types.js +68 -0
- package/dist/call-graph/extractors/types.js.map +1 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/typescript-data-access-extractor.js +31 -10
- package/dist/call-graph/extractors/typescript-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts +116 -0
- package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/typescript-hybrid-extractor.js +635 -0
- package/dist/call-graph/extractors/typescript-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/index.d.ts +2 -4
- package/dist/call-graph/index.d.ts.map +1 -1
- package/dist/call-graph/index.js +5 -6
- package/dist/call-graph/index.js.map +1 -1
- package/dist/error-handling/error-handling-analyzer.d.ts +73 -0
- package/dist/error-handling/error-handling-analyzer.d.ts.map +1 -0
- package/dist/error-handling/error-handling-analyzer.js +706 -0
- package/dist/error-handling/error-handling-analyzer.js.map +1 -0
- package/dist/error-handling/index.d.ts +8 -0
- package/dist/error-handling/index.d.ts.map +1 -0
- package/dist/error-handling/index.js +8 -0
- package/dist/error-handling/index.js.map +1 -0
- package/dist/error-handling/types.d.ts +307 -0
- package/dist/error-handling/types.d.ts.map +1 -0
- package/dist/error-handling/types.js +7 -0
- package/dist/error-handling/types.js.map +1 -0
- package/dist/index.d.ts +18 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -5
- package/dist/index.js.map +1 -1
- package/dist/lake/pattern-shard-store.d.ts +6 -0
- package/dist/lake/pattern-shard-store.d.ts.map +1 -1
- package/dist/lake/pattern-shard-store.js +6 -0
- package/dist/lake/pattern-shard-store.js.map +1 -1
- package/dist/language-intelligence/base-normalizer.d.ts +68 -0
- package/dist/language-intelligence/base-normalizer.d.ts.map +1 -0
- package/dist/language-intelligence/base-normalizer.js +210 -0
- package/dist/language-intelligence/base-normalizer.js.map +1 -0
- package/dist/language-intelligence/framework-registry.d.ts +89 -0
- package/dist/language-intelligence/framework-registry.d.ts.map +1 -0
- package/dist/language-intelligence/framework-registry.js +165 -0
- package/dist/language-intelligence/framework-registry.js.map +1 -0
- package/dist/language-intelligence/frameworks/aspnet.d.ts +11 -0
- package/dist/language-intelligence/frameworks/aspnet.d.ts.map +1 -0
- package/dist/language-intelligence/frameworks/aspnet.js +325 -0
- package/dist/language-intelligence/frameworks/aspnet.js.map +1 -0
- package/dist/language-intelligence/frameworks/fastapi.d.ts +11 -0
- package/dist/language-intelligence/frameworks/fastapi.d.ts.map +1 -0
- package/dist/language-intelligence/frameworks/fastapi.js +188 -0
- package/dist/language-intelligence/frameworks/fastapi.js.map +1 -0
- package/dist/language-intelligence/frameworks/index.d.ts +32 -0
- package/dist/language-intelligence/frameworks/index.d.ts.map +1 -0
- package/dist/language-intelligence/frameworks/index.js +51 -0
- package/dist/language-intelligence/frameworks/index.js.map +1 -0
- package/dist/language-intelligence/frameworks/laravel.d.ts +12 -0
- package/dist/language-intelligence/frameworks/laravel.d.ts.map +1 -0
- package/dist/language-intelligence/frameworks/laravel.js +194 -0
- package/dist/language-intelligence/frameworks/laravel.js.map +1 -0
- package/dist/language-intelligence/frameworks/nestjs.d.ts +11 -0
- package/dist/language-intelligence/frameworks/nestjs.d.ts.map +1 -0
- package/dist/language-intelligence/frameworks/nestjs.js +307 -0
- package/dist/language-intelligence/frameworks/nestjs.js.map +1 -0
- package/dist/language-intelligence/frameworks/spring.d.ts +11 -0
- package/dist/language-intelligence/frameworks/spring.d.ts.map +1 -0
- package/dist/language-intelligence/frameworks/spring.js +369 -0
- package/dist/language-intelligence/frameworks/spring.js.map +1 -0
- package/dist/language-intelligence/index.d.ts +33 -0
- package/dist/language-intelligence/index.d.ts.map +1 -0
- package/dist/language-intelligence/index.js +37 -0
- package/dist/language-intelligence/index.js.map +1 -0
- package/dist/language-intelligence/language-intelligence.d.ts +99 -0
- package/dist/language-intelligence/language-intelligence.d.ts.map +1 -0
- package/dist/language-intelligence/language-intelligence.js +239 -0
- package/dist/language-intelligence/language-intelligence.js.map +1 -0
- package/dist/language-intelligence/normalizers/csharp-normalizer.d.ts +39 -0
- package/dist/language-intelligence/normalizers/csharp-normalizer.d.ts.map +1 -0
- package/dist/language-intelligence/normalizers/csharp-normalizer.js +86 -0
- package/dist/language-intelligence/normalizers/csharp-normalizer.js.map +1 -0
- package/dist/language-intelligence/normalizers/index.d.ts +25 -0
- package/dist/language-intelligence/normalizers/index.d.ts.map +1 -0
- package/dist/language-intelligence/normalizers/index.js +60 -0
- package/dist/language-intelligence/normalizers/index.js.map +1 -0
- package/dist/language-intelligence/normalizers/java-normalizer.d.ts +39 -0
- package/dist/language-intelligence/normalizers/java-normalizer.d.ts.map +1 -0
- package/dist/language-intelligence/normalizers/java-normalizer.js +96 -0
- package/dist/language-intelligence/normalizers/java-normalizer.js.map +1 -0
- package/dist/language-intelligence/normalizers/php-normalizer.d.ts +39 -0
- package/dist/language-intelligence/normalizers/php-normalizer.d.ts.map +1 -0
- package/dist/language-intelligence/normalizers/php-normalizer.js +86 -0
- package/dist/language-intelligence/normalizers/php-normalizer.js.map +1 -0
- package/dist/language-intelligence/normalizers/python-normalizer.d.ts +39 -0
- package/dist/language-intelligence/normalizers/python-normalizer.d.ts.map +1 -0
- package/dist/language-intelligence/normalizers/python-normalizer.js +95 -0
- package/dist/language-intelligence/normalizers/python-normalizer.js.map +1 -0
- package/dist/language-intelligence/normalizers/typescript-normalizer.d.ts +39 -0
- package/dist/language-intelligence/normalizers/typescript-normalizer.d.ts.map +1 -0
- package/dist/language-intelligence/normalizers/typescript-normalizer.js +84 -0
- package/dist/language-intelligence/normalizers/typescript-normalizer.js.map +1 -0
- package/dist/language-intelligence/types.d.ts +270 -0
- package/dist/language-intelligence/types.d.ts.map +1 -0
- package/dist/language-intelligence/types.js +9 -0
- package/dist/language-intelligence/types.js.map +1 -0
- package/dist/module-coupling/coupling-analyzer.d.ts +73 -0
- package/dist/module-coupling/coupling-analyzer.d.ts.map +1 -0
- package/dist/module-coupling/coupling-analyzer.js +668 -0
- package/dist/module-coupling/coupling-analyzer.js.map +1 -0
- package/dist/module-coupling/index.d.ts +9 -0
- package/dist/module-coupling/index.d.ts.map +1 -0
- package/dist/module-coupling/index.js +9 -0
- package/dist/module-coupling/index.js.map +1 -0
- package/dist/module-coupling/types.d.ts +273 -0
- package/dist/module-coupling/types.d.ts.map +1 -0
- package/dist/module-coupling/types.js +8 -0
- package/dist/module-coupling/types.js.map +1 -0
- package/dist/patterns/adapters/index.d.ts +11 -0
- package/dist/patterns/adapters/index.d.ts.map +1 -0
- package/dist/patterns/adapters/index.js +11 -0
- package/dist/patterns/adapters/index.js.map +1 -0
- package/dist/patterns/adapters/pattern-store-adapter.d.ts +59 -0
- package/dist/patterns/adapters/pattern-store-adapter.d.ts.map +1 -0
- package/dist/patterns/adapters/pattern-store-adapter.js +468 -0
- package/dist/patterns/adapters/pattern-store-adapter.js.map +1 -0
- package/dist/patterns/adapters/service-factory.d.ts +40 -0
- package/dist/patterns/adapters/service-factory.d.ts.map +1 -0
- package/dist/patterns/adapters/service-factory.js +144 -0
- package/dist/patterns/adapters/service-factory.js.map +1 -0
- package/dist/patterns/errors.d.ts +32 -0
- package/dist/patterns/errors.d.ts.map +1 -0
- package/dist/patterns/errors.js +45 -0
- package/dist/patterns/errors.js.map +1 -0
- package/dist/patterns/impl/cached-repository.d.ts +79 -0
- package/dist/patterns/impl/cached-repository.d.ts.map +1 -0
- package/dist/patterns/impl/cached-repository.js +296 -0
- package/dist/patterns/impl/cached-repository.js.map +1 -0
- package/dist/patterns/impl/file-repository.d.ts +75 -0
- package/dist/patterns/impl/file-repository.d.ts.map +1 -0
- package/dist/patterns/impl/file-repository.js +507 -0
- package/dist/patterns/impl/file-repository.js.map +1 -0
- package/dist/patterns/impl/index.d.ts +16 -0
- package/dist/patterns/impl/index.d.ts.map +1 -0
- package/dist/patterns/impl/index.js +21 -0
- package/dist/patterns/impl/index.js.map +1 -0
- package/dist/patterns/impl/memory-repository.d.ts +56 -0
- package/dist/patterns/impl/memory-repository.d.ts.map +1 -0
- package/dist/patterns/impl/memory-repository.js +323 -0
- package/dist/patterns/impl/memory-repository.js.map +1 -0
- package/dist/patterns/impl/pattern-service.d.ts +52 -0
- package/dist/patterns/impl/pattern-service.d.ts.map +1 -0
- package/dist/patterns/impl/pattern-service.js +382 -0
- package/dist/patterns/impl/pattern-service.js.map +1 -0
- package/dist/patterns/impl/repository-factory.d.ts +44 -0
- package/dist/patterns/impl/repository-factory.d.ts.map +1 -0
- package/dist/patterns/impl/repository-factory.js +140 -0
- package/dist/patterns/impl/repository-factory.js.map +1 -0
- package/dist/patterns/impl/unified-file-repository.d.ts +111 -0
- package/dist/patterns/impl/unified-file-repository.d.ts.map +1 -0
- package/dist/patterns/impl/unified-file-repository.js +677 -0
- package/dist/patterns/impl/unified-file-repository.js.map +1 -0
- package/dist/patterns/index.d.ts +23 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +41 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/patterns/repository.d.ts +241 -0
- package/dist/patterns/repository.d.ts.map +1 -0
- package/dist/patterns/repository.js +23 -0
- package/dist/patterns/repository.js.map +1 -0
- package/dist/patterns/service.d.ts +245 -0
- package/dist/patterns/service.d.ts.map +1 -0
- package/dist/patterns/service.js +25 -0
- package/dist/patterns/service.js.map +1 -0
- package/dist/patterns/types.d.ts +227 -0
- package/dist/patterns/types.d.ts.map +1 -0
- package/dist/patterns/types.js +117 -0
- package/dist/patterns/types.js.map +1 -0
- package/dist/scanner/file-processor-worker.d.ts +66 -0
- package/dist/scanner/file-processor-worker.d.ts.map +1 -0
- package/dist/scanner/file-processor-worker.js +189 -0
- package/dist/scanner/file-processor-worker.js.map +1 -0
- package/dist/scanner/index.d.ts +2 -0
- package/dist/scanner/index.d.ts.map +1 -1
- package/dist/scanner/index.js +2 -0
- package/dist/scanner/index.js.map +1 -1
- package/dist/scanner/threaded-worker-pool.d.ts +182 -0
- package/dist/scanner/threaded-worker-pool.d.ts.map +1 -0
- package/dist/scanner/threaded-worker-pool.js +243 -0
- package/dist/scanner/threaded-worker-pool.js.map +1 -0
- package/dist/store/pattern-store.d.ts +6 -0
- package/dist/store/pattern-store.d.ts.map +1 -1
- package/dist/store/pattern-store.js +6 -0
- package/dist/store/pattern-store.js.map +1 -1
- package/dist/store/types.d.ts +6 -3
- package/dist/store/types.d.ts.map +1 -1
- package/dist/store/types.js.map +1 -1
- package/dist/test-topology/extractors/base-test-extractor.d.ts +89 -0
- package/dist/test-topology/extractors/base-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/base-test-extractor.js +187 -0
- package/dist/test-topology/extractors/base-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/csharp-test-extractor.d.ts +23 -0
- package/dist/test-topology/extractors/csharp-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/csharp-test-extractor.js +367 -0
- package/dist/test-topology/extractors/csharp-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/index.d.ts +12 -0
- package/dist/test-topology/extractors/index.d.ts.map +1 -0
- package/dist/test-topology/extractors/index.js +12 -0
- package/dist/test-topology/extractors/index.js.map +1 -0
- package/dist/test-topology/extractors/java-test-extractor.d.ts +20 -0
- package/dist/test-topology/extractors/java-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/java-test-extractor.js +275 -0
- package/dist/test-topology/extractors/java-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/php-test-extractor.d.ts +24 -0
- package/dist/test-topology/extractors/php-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/php-test-extractor.js +409 -0
- package/dist/test-topology/extractors/php-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/python-test-extractor.d.ts +23 -0
- package/dist/test-topology/extractors/python-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/python-test-extractor.js +342 -0
- package/dist/test-topology/extractors/python-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts +51 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.js +383 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/index.d.ts +18 -0
- package/dist/test-topology/extractors/regex/index.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/index.js +43 -0
- package/dist/test-topology/extractors/regex/index.js.map +1 -0
- package/dist/test-topology/extractors/regex/java-test-regex.d.ts +50 -0
- package/dist/test-topology/extractors/regex/java-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/java-test-regex.js +370 -0
- package/dist/test-topology/extractors/regex/java-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/php-test-regex.d.ts +56 -0
- package/dist/test-topology/extractors/regex/php-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/php-test-regex.js +503 -0
- package/dist/test-topology/extractors/regex/php-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/python-test-regex.d.ts +57 -0
- package/dist/test-topology/extractors/regex/python-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/python-test-regex.js +381 -0
- package/dist/test-topology/extractors/regex/python-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts +60 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.js +368 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/typescript-test-extractor.d.ts +24 -0
- package/dist/test-topology/extractors/typescript-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/typescript-test-extractor.js +266 -0
- package/dist/test-topology/extractors/typescript-test-extractor.js.map +1 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.d.ts +98 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.js +555 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -0
- package/dist/test-topology/index.d.ts +16 -0
- package/dist/test-topology/index.d.ts.map +1 -0
- package/dist/test-topology/index.js +19 -0
- package/dist/test-topology/index.js.map +1 -0
- package/dist/test-topology/test-topology-analyzer.d.ts +85 -0
- package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -0
- package/dist/test-topology/test-topology-analyzer.js +538 -0
- package/dist/test-topology/test-topology-analyzer.js.map +1 -0
- package/dist/test-topology/types.d.ts +300 -0
- package/dist/test-topology/types.d.ts.map +1 -0
- package/dist/test-topology/types.js +7 -0
- package/dist/test-topology/types.js.map +1 -0
- package/dist/unified-provider/compat/index.d.ts +11 -0
- package/dist/unified-provider/compat/index.d.ts.map +1 -0
- package/dist/unified-provider/compat/index.js +13 -0
- package/dist/unified-provider/compat/index.js.map +1 -0
- package/dist/unified-provider/compat/legacy-extractors.d.ts +63 -0
- package/dist/unified-provider/compat/legacy-extractors.d.ts.map +1 -0
- package/dist/unified-provider/compat/legacy-extractors.js +80 -0
- package/dist/unified-provider/compat/legacy-extractors.js.map +1 -0
- package/dist/unified-provider/compat/legacy-scanner.d.ts +28 -0
- package/dist/unified-provider/compat/legacy-scanner.d.ts.map +1 -0
- package/dist/unified-provider/compat/legacy-scanner.js +31 -0
- package/dist/unified-provider/compat/legacy-scanner.js.map +1 -0
- package/dist/unified-provider/index.d.ts +28 -0
- package/dist/unified-provider/index.d.ts.map +1 -0
- package/dist/unified-provider/index.js +47 -0
- package/dist/unified-provider/index.js.map +1 -0
- package/dist/unified-provider/integration/index.d.ts +9 -0
- package/dist/unified-provider/integration/index.d.ts.map +1 -0
- package/dist/unified-provider/integration/index.js +11 -0
- package/dist/unified-provider/integration/index.js.map +1 -0
- package/dist/unified-provider/integration/unified-data-access-adapter.d.ts +75 -0
- package/dist/unified-provider/integration/unified-data-access-adapter.d.ts.map +1 -0
- package/dist/unified-provider/integration/unified-data-access-adapter.js +210 -0
- package/dist/unified-provider/integration/unified-data-access-adapter.js.map +1 -0
- package/dist/unified-provider/integration/unified-scanner.d.ts +90 -0
- package/dist/unified-provider/integration/unified-scanner.d.ts.map +1 -0
- package/dist/unified-provider/integration/unified-scanner.js +369 -0
- package/dist/unified-provider/integration/unified-scanner.js.map +1 -0
- package/dist/unified-provider/matching/base-matcher.d.ts +80 -0
- package/dist/unified-provider/matching/base-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/base-matcher.js +196 -0
- package/dist/unified-provider/matching/base-matcher.js.map +1 -0
- package/dist/unified-provider/matching/django-matcher.d.ts +32 -0
- package/dist/unified-provider/matching/django-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/django-matcher.js +107 -0
- package/dist/unified-provider/matching/django-matcher.js.map +1 -0
- package/dist/unified-provider/matching/drizzle-matcher.d.ts +25 -0
- package/dist/unified-provider/matching/drizzle-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/drizzle-matcher.js +123 -0
- package/dist/unified-provider/matching/drizzle-matcher.js.map +1 -0
- package/dist/unified-provider/matching/efcore-matcher.d.ts +27 -0
- package/dist/unified-provider/matching/efcore-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/efcore-matcher.js +88 -0
- package/dist/unified-provider/matching/efcore-matcher.js.map +1 -0
- package/dist/unified-provider/matching/eloquent-matcher.d.ts +32 -0
- package/dist/unified-provider/matching/eloquent-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/eloquent-matcher.js +162 -0
- package/dist/unified-provider/matching/eloquent-matcher.js.map +1 -0
- package/dist/unified-provider/matching/index.d.ts +19 -0
- package/dist/unified-provider/matching/index.d.ts.map +1 -0
- package/dist/unified-provider/matching/index.js +24 -0
- package/dist/unified-provider/matching/index.js.map +1 -0
- package/dist/unified-provider/matching/knex-matcher.d.ts +26 -0
- package/dist/unified-provider/matching/knex-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/knex-matcher.js +109 -0
- package/dist/unified-provider/matching/knex-matcher.js.map +1 -0
- package/dist/unified-provider/matching/matcher-registry.d.ts +55 -0
- package/dist/unified-provider/matching/matcher-registry.d.ts.map +1 -0
- package/dist/unified-provider/matching/matcher-registry.js +130 -0
- package/dist/unified-provider/matching/matcher-registry.js.map +1 -0
- package/dist/unified-provider/matching/mongoose-matcher.d.ts +30 -0
- package/dist/unified-provider/matching/mongoose-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/mongoose-matcher.js +132 -0
- package/dist/unified-provider/matching/mongoose-matcher.js.map +1 -0
- package/dist/unified-provider/matching/prisma-matcher.d.ts +31 -0
- package/dist/unified-provider/matching/prisma-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/prisma-matcher.js +123 -0
- package/dist/unified-provider/matching/prisma-matcher.js.map +1 -0
- package/dist/unified-provider/matching/raw-sql-matcher.d.ts +31 -0
- package/dist/unified-provider/matching/raw-sql-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/raw-sql-matcher.js +173 -0
- package/dist/unified-provider/matching/raw-sql-matcher.js.map +1 -0
- package/dist/unified-provider/matching/sequelize-matcher.d.ts +28 -0
- package/dist/unified-provider/matching/sequelize-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/sequelize-matcher.js +132 -0
- package/dist/unified-provider/matching/sequelize-matcher.js.map +1 -0
- package/dist/unified-provider/matching/spring-data-matcher.d.ts +32 -0
- package/dist/unified-provider/matching/spring-data-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/spring-data-matcher.js +112 -0
- package/dist/unified-provider/matching/spring-data-matcher.js.map +1 -0
- package/dist/unified-provider/matching/sqlalchemy-matcher.d.ts +32 -0
- package/dist/unified-provider/matching/sqlalchemy-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/sqlalchemy-matcher.js +201 -0
- package/dist/unified-provider/matching/sqlalchemy-matcher.js.map +1 -0
- package/dist/unified-provider/matching/supabase-matcher.d.ts +27 -0
- package/dist/unified-provider/matching/supabase-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/supabase-matcher.js +122 -0
- package/dist/unified-provider/matching/supabase-matcher.js.map +1 -0
- package/dist/unified-provider/matching/typeorm-matcher.d.ts +32 -0
- package/dist/unified-provider/matching/typeorm-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/typeorm-matcher.js +169 -0
- package/dist/unified-provider/matching/typeorm-matcher.js.map +1 -0
- package/dist/unified-provider/migration/deprecated-extractors.d.ts +104 -0
- package/dist/unified-provider/migration/deprecated-extractors.d.ts.map +1 -0
- package/dist/unified-provider/migration/deprecated-extractors.js +129 -0
- package/dist/unified-provider/migration/deprecated-extractors.js.map +1 -0
- package/dist/unified-provider/migration/deprecated-scanner.d.ts +40 -0
- package/dist/unified-provider/migration/deprecated-scanner.d.ts.map +1 -0
- package/dist/unified-provider/migration/deprecated-scanner.js +49 -0
- package/dist/unified-provider/migration/deprecated-scanner.js.map +1 -0
- package/dist/unified-provider/migration/index.d.ts +41 -0
- package/dist/unified-provider/migration/index.d.ts.map +1 -0
- package/dist/unified-provider/migration/index.js +43 -0
- package/dist/unified-provider/migration/index.js.map +1 -0
- package/dist/unified-provider/normalization/base-normalizer.d.ts +188 -0
- package/dist/unified-provider/normalization/base-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/base-normalizer.js +339 -0
- package/dist/unified-provider/normalization/base-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/csharp-normalizer.d.ts +58 -0
- package/dist/unified-provider/normalization/csharp-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/csharp-normalizer.js +467 -0
- package/dist/unified-provider/normalization/csharp-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/index.d.ts +23 -0
- package/dist/unified-provider/normalization/index.d.ts.map +1 -0
- package/dist/unified-provider/normalization/index.js +62 -0
- package/dist/unified-provider/normalization/index.js.map +1 -0
- package/dist/unified-provider/normalization/java-normalizer.d.ts +54 -0
- package/dist/unified-provider/normalization/java-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/java-normalizer.js +453 -0
- package/dist/unified-provider/normalization/java-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/php-normalizer.d.ts +54 -0
- package/dist/unified-provider/normalization/php-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/php-normalizer.js +489 -0
- package/dist/unified-provider/normalization/php-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/python-normalizer.d.ts +61 -0
- package/dist/unified-provider/normalization/python-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/python-normalizer.js +548 -0
- package/dist/unified-provider/normalization/python-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/typescript-normalizer.d.ts +60 -0
- package/dist/unified-provider/normalization/typescript-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/typescript-normalizer.js +608 -0
- package/dist/unified-provider/normalization/typescript-normalizer.js.map +1 -0
- package/dist/unified-provider/parsing/index.d.ts +5 -0
- package/dist/unified-provider/parsing/index.d.ts.map +1 -0
- package/dist/unified-provider/parsing/index.js +5 -0
- package/dist/unified-provider/parsing/index.js.map +1 -0
- package/dist/unified-provider/parsing/parser-registry.d.ts +70 -0
- package/dist/unified-provider/parsing/parser-registry.d.ts.map +1 -0
- package/dist/unified-provider/parsing/parser-registry.js +260 -0
- package/dist/unified-provider/parsing/parser-registry.js.map +1 -0
- package/dist/unified-provider/provider/index.d.ts +5 -0
- package/dist/unified-provider/provider/index.d.ts.map +1 -0
- package/dist/unified-provider/provider/index.js +5 -0
- package/dist/unified-provider/provider/index.js.map +1 -0
- package/dist/unified-provider/provider/unified-language-provider.d.ts +56 -0
- package/dist/unified-provider/provider/unified-language-provider.d.ts.map +1 -0
- package/dist/unified-provider/provider/unified-language-provider.js +212 -0
- package/dist/unified-provider/provider/unified-language-provider.js.map +1 -0
- package/dist/unified-provider/types.d.ts +389 -0
- package/dist/unified-provider/types.d.ts.map +1 -0
- package/dist/unified-provider/types.js +9 -0
- package/dist/unified-provider/types.js.map +1 -0
- package/dist/wrappers/clustering/clusterer.d.ts +43 -0
- package/dist/wrappers/clustering/clusterer.d.ts.map +1 -0
- package/dist/wrappers/clustering/clusterer.js +374 -0
- package/dist/wrappers/clustering/clusterer.js.map +1 -0
- package/dist/wrappers/clustering/exclusions.d.ts +47 -0
- package/dist/wrappers/clustering/exclusions.d.ts.map +1 -0
- package/dist/wrappers/clustering/exclusions.js +318 -0
- package/dist/wrappers/clustering/exclusions.js.map +1 -0
- package/dist/wrappers/clustering/index.d.ts +6 -0
- package/dist/wrappers/clustering/index.d.ts.map +1 -0
- package/dist/wrappers/clustering/index.js +6 -0
- package/dist/wrappers/clustering/index.js.map +1 -0
- package/dist/wrappers/detection/detector.d.ts +69 -0
- package/dist/wrappers/detection/detector.d.ts.map +1 -0
- package/dist/wrappers/detection/detector.js +279 -0
- package/dist/wrappers/detection/detector.js.map +1 -0
- package/dist/wrappers/detection/index.d.ts +5 -0
- package/dist/wrappers/detection/index.d.ts.map +1 -0
- package/dist/wrappers/detection/index.js +5 -0
- package/dist/wrappers/detection/index.js.map +1 -0
- package/dist/wrappers/export/index.d.ts +5 -0
- package/dist/wrappers/export/index.d.ts.map +1 -0
- package/dist/wrappers/export/index.js +5 -0
- package/dist/wrappers/export/index.js.map +1 -0
- package/dist/wrappers/export/json.d.ts +127 -0
- package/dist/wrappers/export/json.d.ts.map +1 -0
- package/dist/wrappers/export/json.js +160 -0
- package/dist/wrappers/export/json.js.map +1 -0
- package/dist/wrappers/index.d.ts +56 -0
- package/dist/wrappers/index.d.ts.map +1 -0
- package/dist/wrappers/index.js +159 -0
- package/dist/wrappers/index.js.map +1 -0
- package/dist/wrappers/integration/adapter.d.ts +52 -0
- package/dist/wrappers/integration/adapter.d.ts.map +1 -0
- package/dist/wrappers/integration/adapter.js +209 -0
- package/dist/wrappers/integration/adapter.js.map +1 -0
- package/dist/wrappers/integration/index.d.ts +9 -0
- package/dist/wrappers/integration/index.d.ts.map +1 -0
- package/dist/wrappers/integration/index.js +12 -0
- package/dist/wrappers/integration/index.js.map +1 -0
- package/dist/wrappers/integration/pattern-adapter.d.ts +52 -0
- package/dist/wrappers/integration/pattern-adapter.d.ts.map +1 -0
- package/dist/wrappers/integration/pattern-adapter.js +192 -0
- package/dist/wrappers/integration/pattern-adapter.js.map +1 -0
- package/dist/wrappers/integration/scanner.d.ts +85 -0
- package/dist/wrappers/integration/scanner.d.ts.map +1 -0
- package/dist/wrappers/integration/scanner.js +367 -0
- package/dist/wrappers/integration/scanner.js.map +1 -0
- package/dist/wrappers/primitives/discovery.d.ts +57 -0
- package/dist/wrappers/primitives/discovery.d.ts.map +1 -0
- package/dist/wrappers/primitives/discovery.js +389 -0
- package/dist/wrappers/primitives/discovery.js.map +1 -0
- package/dist/wrappers/primitives/index.d.ts +6 -0
- package/dist/wrappers/primitives/index.d.ts.map +1 -0
- package/dist/wrappers/primitives/index.js +6 -0
- package/dist/wrappers/primitives/index.js.map +1 -0
- package/dist/wrappers/primitives/registry.d.ts +63 -0
- package/dist/wrappers/primitives/registry.d.ts.map +1 -0
- package/dist/wrappers/primitives/registry.js +447 -0
- package/dist/wrappers/primitives/registry.js.map +1 -0
- package/dist/wrappers/types.d.ts +137 -0
- package/dist/wrappers/types.d.ts.map +1 -0
- package/dist/wrappers/types.js +7 -0
- package/dist/wrappers/types.js.map +1 -0
- package/package.json +23 -18
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C# Test Extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts test information from xUnit, NUnit, MSTest, and Moq.
|
|
5
|
+
*/
|
|
6
|
+
import { BaseTestExtractor } from './base-test-extractor.js';
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// Framework Detection
|
|
9
|
+
// ============================================================================
|
|
10
|
+
const FRAMEWORK_NAMESPACES = {
|
|
11
|
+
'Xunit': 'xunit',
|
|
12
|
+
'xUnit': 'xunit',
|
|
13
|
+
'NUnit': 'nunit',
|
|
14
|
+
'NUnit.Framework': 'nunit',
|
|
15
|
+
'Microsoft.VisualStudio.TestTools.UnitTesting': 'mstest',
|
|
16
|
+
};
|
|
17
|
+
const FRAMEWORK_ATTRIBUTES = {
|
|
18
|
+
'Fact': 'xunit',
|
|
19
|
+
'Theory': 'xunit',
|
|
20
|
+
'Test': 'nunit',
|
|
21
|
+
'TestCase': 'nunit',
|
|
22
|
+
'TestMethod': 'mstest',
|
|
23
|
+
'DataTestMethod': 'mstest',
|
|
24
|
+
};
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// Extractor Implementation
|
|
27
|
+
// ============================================================================
|
|
28
|
+
export class CSharpTestExtractor extends BaseTestExtractor {
|
|
29
|
+
constructor(parser) {
|
|
30
|
+
super(parser, 'csharp');
|
|
31
|
+
}
|
|
32
|
+
extract(content, filePath) {
|
|
33
|
+
const tree = this.parser.parse(content);
|
|
34
|
+
const root = tree.rootNode;
|
|
35
|
+
const framework = this.detectFramework(root);
|
|
36
|
+
const testCases = this.extractTestCases(root);
|
|
37
|
+
const mocks = this.extractMocks(root, framework);
|
|
38
|
+
const setupBlocks = this.extractSetupBlocks(root);
|
|
39
|
+
// Enrich test cases with quality
|
|
40
|
+
for (const test of testCases) {
|
|
41
|
+
const testMocks = mocks.filter(m => m.line >= test.line && m.line <= test.line + 100);
|
|
42
|
+
test.quality = this.calculateQuality(test.assertions, testMocks, test.directCalls);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
file: filePath,
|
|
46
|
+
framework,
|
|
47
|
+
language: 'csharp',
|
|
48
|
+
testCases,
|
|
49
|
+
mocks,
|
|
50
|
+
setupBlocks,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
detectFramework(root) {
|
|
54
|
+
const imports = this.findImports(root);
|
|
55
|
+
// Check using statements
|
|
56
|
+
for (const imp of imports) {
|
|
57
|
+
for (const [pattern, framework] of Object.entries(FRAMEWORK_NAMESPACES)) {
|
|
58
|
+
if (imp.includes(pattern)) {
|
|
59
|
+
return framework;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Check for test attributes in the code
|
|
64
|
+
const text = root.text;
|
|
65
|
+
for (const [attr, framework] of Object.entries(FRAMEWORK_ATTRIBUTES)) {
|
|
66
|
+
if (text.includes(`[${attr}]`) || text.includes(`[${attr}(`)) {
|
|
67
|
+
return framework;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return 'unknown';
|
|
71
|
+
}
|
|
72
|
+
extractTestCases(root) {
|
|
73
|
+
const testCases = [];
|
|
74
|
+
let currentClass;
|
|
75
|
+
this.walkNode(root, (node) => {
|
|
76
|
+
// Track class context
|
|
77
|
+
if (node.type === 'class_declaration') {
|
|
78
|
+
const nameNode = node.childForFieldName('name');
|
|
79
|
+
if (nameNode) {
|
|
80
|
+
currentClass = nameNode.text;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Find methods with test attributes
|
|
84
|
+
if (node.type === 'method_declaration') {
|
|
85
|
+
const attributeList = this.findAttributeList(node);
|
|
86
|
+
const nameNode = node.childForFieldName('name');
|
|
87
|
+
const bodyNode = node.childForFieldName('body');
|
|
88
|
+
if (nameNode && bodyNode && this.hasTestAttribute(attributeList)) {
|
|
89
|
+
const name = nameNode.text;
|
|
90
|
+
const qualifiedName = currentClass
|
|
91
|
+
? `${currentClass}.${name}`
|
|
92
|
+
: name;
|
|
93
|
+
const directCalls = this.extractFunctionCalls(bodyNode);
|
|
94
|
+
const assertions = this.extractAssertions(bodyNode);
|
|
95
|
+
testCases.push({
|
|
96
|
+
id: this.generateTestId('', name, node.startPosition.row),
|
|
97
|
+
name,
|
|
98
|
+
parentBlock: currentClass,
|
|
99
|
+
qualifiedName,
|
|
100
|
+
file: '',
|
|
101
|
+
line: node.startPosition.row + 1,
|
|
102
|
+
directCalls,
|
|
103
|
+
transitiveCalls: [],
|
|
104
|
+
assertions,
|
|
105
|
+
quality: {
|
|
106
|
+
assertionCount: assertions.length,
|
|
107
|
+
hasErrorCases: false,
|
|
108
|
+
hasEdgeCases: false,
|
|
109
|
+
mockRatio: 0,
|
|
110
|
+
setupRatio: 0,
|
|
111
|
+
score: 50,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
return testCases;
|
|
118
|
+
}
|
|
119
|
+
extractMocks(root, _framework) {
|
|
120
|
+
const mocks = [];
|
|
121
|
+
this.walkNode(root, (node) => {
|
|
122
|
+
// new Mock<T>() pattern (Moq)
|
|
123
|
+
if (node.type === 'object_creation_expression') {
|
|
124
|
+
const typeNode = node.childForFieldName('type');
|
|
125
|
+
if (typeNode) {
|
|
126
|
+
const typeText = typeNode.text;
|
|
127
|
+
// Mock<IService>
|
|
128
|
+
if (typeText.startsWith('Mock<')) {
|
|
129
|
+
const mockTarget = typeText.slice(5, -1); // Extract type from Mock<Type>
|
|
130
|
+
mocks.push({
|
|
131
|
+
target: mockTarget,
|
|
132
|
+
mockType: 'Mock<T>',
|
|
133
|
+
line: node.startPosition.row + 1,
|
|
134
|
+
isExternal: this.isExternalCSharpType(mockTarget),
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
// Substitute.For<IService>() (NSubstitute)
|
|
138
|
+
if (typeText.includes('Substitute')) {
|
|
139
|
+
mocks.push({
|
|
140
|
+
target: typeText,
|
|
141
|
+
mockType: 'NSubstitute',
|
|
142
|
+
line: node.startPosition.row + 1,
|
|
143
|
+
isExternal: false,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// Substitute.For<T>() pattern (NSubstitute)
|
|
149
|
+
if (node.type === 'invocation_expression') {
|
|
150
|
+
const fnNode = node.childForFieldName('function');
|
|
151
|
+
if (fnNode?.type === 'member_access_expression') {
|
|
152
|
+
const text = fnNode.text;
|
|
153
|
+
if (text.includes('Substitute.For')) {
|
|
154
|
+
const typeMatch = text.match(/For<([^>]+)>/);
|
|
155
|
+
mocks.push({
|
|
156
|
+
target: typeMatch?.[1] ?? 'unknown',
|
|
157
|
+
mockType: 'Substitute.For<T>',
|
|
158
|
+
line: node.startPosition.row + 1,
|
|
159
|
+
isExternal: false,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
// A.Fake<T>() (FakeItEasy)
|
|
163
|
+
if (text.includes('A.Fake')) {
|
|
164
|
+
const typeMatch = text.match(/Fake<([^>]+)>/);
|
|
165
|
+
mocks.push({
|
|
166
|
+
target: typeMatch?.[1] ?? 'unknown',
|
|
167
|
+
mockType: 'A.Fake<T>',
|
|
168
|
+
line: node.startPosition.row + 1,
|
|
169
|
+
isExternal: false,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// .Setup() calls on mocks (Moq)
|
|
175
|
+
if (node.type === 'invocation_expression') {
|
|
176
|
+
const fnNode = node.childForFieldName('function');
|
|
177
|
+
if (fnNode?.type === 'member_access_expression') {
|
|
178
|
+
const nameNode = fnNode.childForFieldName('name');
|
|
179
|
+
if (nameNode?.text === 'Setup' || nameNode?.text === 'SetupGet' ||
|
|
180
|
+
nameNode?.text === 'SetupSet' || nameNode?.text === 'SetupSequence') {
|
|
181
|
+
mocks.push({
|
|
182
|
+
target: 'mock_setup',
|
|
183
|
+
mockType: `Moq.${nameNode.text}`,
|
|
184
|
+
line: node.startPosition.row + 1,
|
|
185
|
+
isExternal: false,
|
|
186
|
+
hasImplementation: true,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
return mocks;
|
|
193
|
+
}
|
|
194
|
+
extractSetupBlocks(root) {
|
|
195
|
+
const blocks = [];
|
|
196
|
+
this.walkNode(root, (node) => {
|
|
197
|
+
if (node.type === 'method_declaration') {
|
|
198
|
+
const attributeList = this.findAttributeList(node);
|
|
199
|
+
const bodyNode = node.childForFieldName('body');
|
|
200
|
+
if (bodyNode) {
|
|
201
|
+
let setupType = null;
|
|
202
|
+
// Check for setup/teardown attributes
|
|
203
|
+
for (const attr of attributeList) {
|
|
204
|
+
const attrText = attr.text;
|
|
205
|
+
// xUnit: constructor is setup, IDisposable.Dispose is teardown
|
|
206
|
+
// NUnit
|
|
207
|
+
if (attrText.includes('[SetUp]'))
|
|
208
|
+
setupType = 'beforeEach';
|
|
209
|
+
else if (attrText.includes('[TearDown]'))
|
|
210
|
+
setupType = 'afterEach';
|
|
211
|
+
else if (attrText.includes('[OneTimeSetUp]'))
|
|
212
|
+
setupType = 'beforeAll';
|
|
213
|
+
else if (attrText.includes('[OneTimeTearDown]'))
|
|
214
|
+
setupType = 'afterAll';
|
|
215
|
+
// MSTest
|
|
216
|
+
else if (attrText.includes('[TestInitialize]'))
|
|
217
|
+
setupType = 'beforeEach';
|
|
218
|
+
else if (attrText.includes('[TestCleanup]'))
|
|
219
|
+
setupType = 'afterEach';
|
|
220
|
+
else if (attrText.includes('[ClassInitialize]'))
|
|
221
|
+
setupType = 'beforeAll';
|
|
222
|
+
else if (attrText.includes('[ClassCleanup]'))
|
|
223
|
+
setupType = 'afterAll';
|
|
224
|
+
}
|
|
225
|
+
if (setupType) {
|
|
226
|
+
const calls = this.extractFunctionCalls(bodyNode);
|
|
227
|
+
blocks.push({
|
|
228
|
+
type: setupType,
|
|
229
|
+
line: node.startPosition.row + 1,
|
|
230
|
+
calls,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
// xUnit: constructor is setup
|
|
236
|
+
if (node.type === 'constructor_declaration') {
|
|
237
|
+
const bodyNode = node.childForFieldName('body');
|
|
238
|
+
if (bodyNode) {
|
|
239
|
+
const calls = this.extractFunctionCalls(bodyNode);
|
|
240
|
+
blocks.push({
|
|
241
|
+
type: 'beforeEach',
|
|
242
|
+
line: node.startPosition.row + 1,
|
|
243
|
+
calls,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
return blocks;
|
|
249
|
+
}
|
|
250
|
+
findImports(root) {
|
|
251
|
+
const imports = [];
|
|
252
|
+
this.walkNode(root, (node) => {
|
|
253
|
+
if (node.type === 'using_directive') {
|
|
254
|
+
const nameNode = node.childForFieldName('name');
|
|
255
|
+
if (nameNode) {
|
|
256
|
+
imports.push(nameNode.text);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
return imports;
|
|
261
|
+
}
|
|
262
|
+
findAttributeList(node) {
|
|
263
|
+
const attributes = [];
|
|
264
|
+
// Look for attribute_list siblings before the method
|
|
265
|
+
let sibling = node.previousNamedSibling;
|
|
266
|
+
while (sibling && sibling.type === 'attribute_list') {
|
|
267
|
+
attributes.push(sibling);
|
|
268
|
+
sibling = sibling.previousNamedSibling;
|
|
269
|
+
}
|
|
270
|
+
// Also check children
|
|
271
|
+
this.walkNode(node, (child) => {
|
|
272
|
+
if (child.type === 'attribute_list') {
|
|
273
|
+
attributes.push(child);
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
return attributes;
|
|
277
|
+
}
|
|
278
|
+
hasTestAttribute(attributeList) {
|
|
279
|
+
const testAttributes = ['Fact', 'Theory', 'Test', 'TestCase', 'TestMethod', 'DataTestMethod'];
|
|
280
|
+
for (const attrList of attributeList) {
|
|
281
|
+
const text = attrList.text;
|
|
282
|
+
for (const attr of testAttributes) {
|
|
283
|
+
if (text.includes(`[${attr}]`) || text.includes(`[${attr}(`)) {
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
extractAssertions(node) {
|
|
291
|
+
const assertions = [];
|
|
292
|
+
this.walkNode(node, (child) => {
|
|
293
|
+
if (child.type === 'invocation_expression') {
|
|
294
|
+
const fnNode = child.childForFieldName('function');
|
|
295
|
+
if (fnNode?.type === 'member_access_expression') {
|
|
296
|
+
const objNode = fnNode.childForFieldName('expression');
|
|
297
|
+
const nameNode = fnNode.childForFieldName('name');
|
|
298
|
+
if (objNode && nameNode) {
|
|
299
|
+
const obj = objNode.text;
|
|
300
|
+
const method = nameNode.text;
|
|
301
|
+
// xUnit Assert
|
|
302
|
+
if (obj === 'Assert') {
|
|
303
|
+
assertions.push({
|
|
304
|
+
matcher: `Assert.${method}`,
|
|
305
|
+
line: child.startPosition.row + 1,
|
|
306
|
+
isErrorAssertion: method === 'Throws' || method === 'ThrowsAsync' ||
|
|
307
|
+
method === 'ThrowsAny' || method === 'ThrowsAnyAsync',
|
|
308
|
+
isEdgeCaseAssertion: method === 'Null' || method === 'NotNull' ||
|
|
309
|
+
method === 'Empty' || method === 'NotEmpty',
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
// NUnit Assert
|
|
313
|
+
if (obj === 'Assert' || obj.endsWith('.Assert')) {
|
|
314
|
+
assertions.push({
|
|
315
|
+
matcher: method,
|
|
316
|
+
line: child.startPosition.row + 1,
|
|
317
|
+
isErrorAssertion: method === 'Throws' || method === 'ThrowsAsync' ||
|
|
318
|
+
method === 'Catch' || method === 'CatchAsync',
|
|
319
|
+
isEdgeCaseAssertion: method === 'IsNull' || method === 'IsNotNull' ||
|
|
320
|
+
method === 'IsEmpty' || method === 'IsNotEmpty',
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
// FluentAssertions: .Should()
|
|
324
|
+
if (method === 'Should') {
|
|
325
|
+
assertions.push({
|
|
326
|
+
matcher: 'Should',
|
|
327
|
+
line: child.startPosition.row + 1,
|
|
328
|
+
isErrorAssertion: false,
|
|
329
|
+
isEdgeCaseAssertion: false,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
// Moq Verify
|
|
333
|
+
if (method === 'Verify' || method === 'VerifyAll' || method === 'VerifyNoOtherCalls') {
|
|
334
|
+
assertions.push({
|
|
335
|
+
matcher: `Mock.${method}`,
|
|
336
|
+
line: child.startPosition.row + 1,
|
|
337
|
+
isErrorAssertion: false,
|
|
338
|
+
isEdgeCaseAssertion: false,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
return assertions;
|
|
346
|
+
}
|
|
347
|
+
isExternalCSharpType(typeName) {
|
|
348
|
+
// Interface naming convention - typically internal
|
|
349
|
+
if (typeName.startsWith('I') && typeName.length > 1 &&
|
|
350
|
+
typeName[1] === typeName[1]?.toUpperCase()) {
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
// Common external types
|
|
354
|
+
const externalPrefixes = [
|
|
355
|
+
'System.', 'Microsoft.', 'Newtonsoft.', 'AutoMapper.',
|
|
356
|
+
'Serilog.', 'NLog.', 'log4net.',
|
|
357
|
+
];
|
|
358
|
+
return externalPrefixes.some(prefix => typeName.startsWith(prefix));
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
// ============================================================================
|
|
362
|
+
// Factory
|
|
363
|
+
// ============================================================================
|
|
364
|
+
export function createCSharpTestExtractor(parser) {
|
|
365
|
+
return new CSharpTestExtractor(parser);
|
|
366
|
+
}
|
|
367
|
+
//# sourceMappingURL=csharp-test-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csharp-test-extractor.js","sourceRoot":"","sources":["../../../src/test-topology/extractors/cshar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,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,oBAAoB,EAAE,CAAC;4BACrF,UAAU,CAAC,IAAI,CAAC;gCACd,OAAO,EAAE,QAAQ,MAAM,EAAE;gCACzB,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,GAAG,CAAC;gCACjC,gBAAgB,EAAE,KAAK;gCACvB,mBAAmB,EAAE,KAAK;6BAC3B,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;IAEO,oBAAoB,CAAC,QAAgB;QAC3C,mDAAmD;QACnD,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;YAC/C,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,CAAC;YAC/C,OAAO,KAAK,CAAC;QACf,CAAC;QAED,wBAAwB;QACxB,MAAM,gBAAgB,GAAG;YACvB,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa;YACrD,UAAU,EAAE,OAAO,EAAE,UAAU;SAChC,CAAC;QAEF,OAAO,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACtE,CAAC;CACF;AAED,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,UAAU,yBAAyB,CAAC,MAAc;IACtD,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Extractors Index
|
|
3
|
+
*
|
|
4
|
+
* Language-specific test extractors for various test frameworks.
|
|
5
|
+
*/
|
|
6
|
+
export { BaseTestExtractor, type QueryMatch, type TestFrameworkConfig } from './base-test-extractor.js';
|
|
7
|
+
export { TypeScriptTestExtractor, createTypeScriptTestExtractor } from './typescript-test-extractor.js';
|
|
8
|
+
export { PythonTestExtractor, createPythonTestExtractor } from './python-test-extractor.js';
|
|
9
|
+
export { JavaTestExtractor, createJavaTestExtractor } from './java-test-extractor.js';
|
|
10
|
+
export { CSharpTestExtractor, createCSharpTestExtractor } from './csharp-test-extractor.js';
|
|
11
|
+
export { PHPTestExtractor, createPHPTestExtractor } from './php-test-extractor.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test-topology/extractors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Extractors Index
|
|
3
|
+
*
|
|
4
|
+
* Language-specific test extractors for various test frameworks.
|
|
5
|
+
*/
|
|
6
|
+
export { BaseTestExtractor } from './base-test-extractor.js';
|
|
7
|
+
export { TypeScriptTestExtractor, createTypeScriptTestExtractor } from './typescript-test-extractor.js';
|
|
8
|
+
export { PythonTestExtractor, createPythonTestExtractor } from './python-test-extractor.js';
|
|
9
|
+
export { JavaTestExtractor, createJavaTestExtractor } from './java-test-extractor.js';
|
|
10
|
+
export { CSharpTestExtractor, createCSharpTestExtractor } from './csharp-test-extractor.js';
|
|
11
|
+
export { PHPTestExtractor, createPHPTestExtractor } from './php-test-extractor.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/test-topology/extractors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAA6C,MAAM,0BAA0B,CAAC;AACxG,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Java Test Extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts test information from JUnit 4/5, TestNG, and Mockito.
|
|
5
|
+
*/
|
|
6
|
+
import type Parser from 'tree-sitter';
|
|
7
|
+
import { BaseTestExtractor } from './base-test-extractor.js';
|
|
8
|
+
import type { TestExtraction, TestCase, MockStatement, SetupBlock, TestFramework } from '../types.js';
|
|
9
|
+
export declare class JavaTestExtractor extends BaseTestExtractor {
|
|
10
|
+
constructor(parser: Parser);
|
|
11
|
+
extract(content: string, filePath: string): TestExtraction;
|
|
12
|
+
detectFramework(root: Parser.SyntaxNode): TestFramework;
|
|
13
|
+
extractTestCases(root: Parser.SyntaxNode): TestCase[];
|
|
14
|
+
extractMocks(root: Parser.SyntaxNode, _framework: TestFramework): MockStatement[];
|
|
15
|
+
extractSetupBlocks(root: Parser.SyntaxNode): SetupBlock[];
|
|
16
|
+
protected findImports(root: Parser.SyntaxNode): string[];
|
|
17
|
+
private extractAssertions;
|
|
18
|
+
}
|
|
19
|
+
export declare function createJavaTestExtractor(parser: Parser): JavaTestExtractor;
|
|
20
|
+
//# sourceMappingURL=java-test-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-test-extractor.d.ts","sourceRoot":"","sources":["../../../src/test-topology/extractors/java-test-extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EACV,cAAc,EACd,QAAQ,EACR,aAAa,EACb,UAAU,EAEV,aAAa,EACd,MAAM,aAAa,CAAC;AAkBrB,qBAAa,iBAAkB,SAAQ,iBAAiB;gBAC1C,MAAM,EAAE,MAAM;IAI1B,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc;IA2B1D,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,aAAa;IAuBvD,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,QAAQ,EAAE;IAmErD,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,GAAG,aAAa,EAAE;IAiEjF,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,UAAU,EAAE;IA0CzD,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,EAAE;IAexD,OAAO,CAAC,iBAAiB;CAoC1B;AAMD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAEzE"}
|