driftdetect-core 0.4.6 → 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/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 +8 -0
- 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/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 +8 -0
- 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 +8 -0
- 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 +8 -0
- 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 +7 -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 +7 -0
- 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 +8 -0
- 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/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 +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- 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/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/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/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/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 +5 -1
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Java Regex Extractor
|
|
3
|
+
*
|
|
4
|
+
* Regex-based fallback extractor for Java when tree-sitter is unavailable.
|
|
5
|
+
*/
|
|
6
|
+
import { BaseRegexExtractor } from './base-regex-extractor.js';
|
|
7
|
+
/**
|
|
8
|
+
* Java regex patterns
|
|
9
|
+
*/
|
|
10
|
+
const JAVA_PATTERNS = {
|
|
11
|
+
language: 'java',
|
|
12
|
+
functions: [],
|
|
13
|
+
classes: [],
|
|
14
|
+
imports: [],
|
|
15
|
+
exports: [],
|
|
16
|
+
calls: [],
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Java regex-based extractor
|
|
20
|
+
*/
|
|
21
|
+
export class JavaRegexExtractor extends BaseRegexExtractor {
|
|
22
|
+
language = 'java';
|
|
23
|
+
extensions = ['.java'];
|
|
24
|
+
patterns = JAVA_PATTERNS;
|
|
25
|
+
// ==========================================================================
|
|
26
|
+
// Function Extraction
|
|
27
|
+
// ==========================================================================
|
|
28
|
+
extractFunctions(cleanSource, originalSource, _filePath) {
|
|
29
|
+
const functions = [];
|
|
30
|
+
const seen = new Set();
|
|
31
|
+
// Pattern: method declarations
|
|
32
|
+
// [modifiers] [<generics>] returnType methodName(params) [throws ...] {
|
|
33
|
+
const methodPattern = /(?:@\w+(?:\([^)]*\))?\s*)*(?:public|private|protected|static|final|abstract|synchronized|native|\s)*(?:<[^>]+>\s+)?(\w+(?:<[^>]+>)?)\s+(\w+)\s*\(([^)]*)\)\s*(?:throws\s+[^{]+)?\s*\{/g;
|
|
34
|
+
let match;
|
|
35
|
+
while ((match = methodPattern.exec(cleanSource)) !== null) {
|
|
36
|
+
const returnType = match[1];
|
|
37
|
+
const name = match[2];
|
|
38
|
+
const paramsStr = match[3] || '';
|
|
39
|
+
const startLine = this.getLineNumber(originalSource, match.index);
|
|
40
|
+
const key = `${name}:${startLine}`;
|
|
41
|
+
if (seen.has(key))
|
|
42
|
+
continue;
|
|
43
|
+
seen.add(key);
|
|
44
|
+
// Skip if this looks like a control structure
|
|
45
|
+
if (['if', 'for', 'while', 'switch', 'catch', 'try'].includes(name))
|
|
46
|
+
continue;
|
|
47
|
+
const endIndex = this.findBlockEnd(cleanSource, match.index);
|
|
48
|
+
const endLine = this.getLineNumber(originalSource, endIndex);
|
|
49
|
+
const isStatic = match[0].includes('static');
|
|
50
|
+
const isPublic = match[0].includes('public');
|
|
51
|
+
const isConstructor = returnType === name; // Constructor has same name as return type
|
|
52
|
+
const params = this.parseJavaParameters(paramsStr);
|
|
53
|
+
const decorators = this.getAnnotationsAbove(cleanSource, match.index);
|
|
54
|
+
const funcOpts = {
|
|
55
|
+
name,
|
|
56
|
+
startLine,
|
|
57
|
+
endLine,
|
|
58
|
+
parameters: params,
|
|
59
|
+
isMethod: true,
|
|
60
|
+
isStatic,
|
|
61
|
+
isExported: isPublic,
|
|
62
|
+
isConstructor,
|
|
63
|
+
decorators,
|
|
64
|
+
};
|
|
65
|
+
if (!isConstructor)
|
|
66
|
+
funcOpts.returnType = returnType;
|
|
67
|
+
functions.push(this.createFunction(funcOpts));
|
|
68
|
+
}
|
|
69
|
+
return functions;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get annotations above a method
|
|
73
|
+
*/
|
|
74
|
+
getAnnotationsAbove(source, methodIndex) {
|
|
75
|
+
const annotations = [];
|
|
76
|
+
const beforeMethod = source.slice(0, methodIndex);
|
|
77
|
+
const lines = beforeMethod.split('\n');
|
|
78
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
79
|
+
const line = lines[i].trim();
|
|
80
|
+
if (line.startsWith('@')) {
|
|
81
|
+
annotations.unshift(line);
|
|
82
|
+
}
|
|
83
|
+
else if (line && !line.startsWith('//') && !line.startsWith('*')) {
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return annotations;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Parse Java parameters
|
|
91
|
+
*/
|
|
92
|
+
parseJavaParameters(paramsStr) {
|
|
93
|
+
if (!paramsStr.trim())
|
|
94
|
+
return [];
|
|
95
|
+
const params = [];
|
|
96
|
+
// Split by comma, but be careful of generics
|
|
97
|
+
const parts = [];
|
|
98
|
+
let current = '';
|
|
99
|
+
let depth = 0;
|
|
100
|
+
for (const char of paramsStr) {
|
|
101
|
+
if (char === '<')
|
|
102
|
+
depth++;
|
|
103
|
+
else if (char === '>')
|
|
104
|
+
depth--;
|
|
105
|
+
else if (char === ',' && depth === 0) {
|
|
106
|
+
parts.push(current.trim());
|
|
107
|
+
current = '';
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
current += char;
|
|
111
|
+
}
|
|
112
|
+
if (current.trim())
|
|
113
|
+
parts.push(current.trim());
|
|
114
|
+
for (const part of parts) {
|
|
115
|
+
const trimmed = part.trim();
|
|
116
|
+
if (!trimmed)
|
|
117
|
+
continue;
|
|
118
|
+
// Handle varargs
|
|
119
|
+
const isRest = trimmed.includes('...');
|
|
120
|
+
// Pattern: [final] Type name or Type... name
|
|
121
|
+
const paramMatch = trimmed.match(/(?:final\s+)?(\w+(?:<[^>]+>)?(?:\[\])?(?:\.\.\.)?)\s+(\w+)/);
|
|
122
|
+
if (paramMatch) {
|
|
123
|
+
const type = paramMatch[1].replace('...', '');
|
|
124
|
+
const name = paramMatch[2];
|
|
125
|
+
params.push({ name, type, hasDefault: false, isRest });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return params;
|
|
129
|
+
}
|
|
130
|
+
// ==========================================================================
|
|
131
|
+
// Class Extraction
|
|
132
|
+
// ==========================================================================
|
|
133
|
+
extractClasses(cleanSource, originalSource, _filePath) {
|
|
134
|
+
const classes = [];
|
|
135
|
+
// Pattern: class Name<T> extends Base implements Interface1, Interface2 {
|
|
136
|
+
const classPattern = /(?:public|private|protected|abstract|final|static|\s)*class\s+(\w+)(?:<[^>]+>)?(?:\s+extends\s+(\w+(?:<[^>]+>)?))?(?:\s+implements\s+([^{]+))?\s*\{/g;
|
|
137
|
+
let match;
|
|
138
|
+
while ((match = classPattern.exec(cleanSource)) !== null) {
|
|
139
|
+
const name = match[1];
|
|
140
|
+
const startLine = this.getLineNumber(originalSource, match.index);
|
|
141
|
+
const endIndex = this.findBlockEnd(cleanSource, match.index);
|
|
142
|
+
const endLine = this.getLineNumber(originalSource, endIndex);
|
|
143
|
+
const baseClasses = [];
|
|
144
|
+
if (match[2])
|
|
145
|
+
baseClasses.push(match[2].replace(/<[^>]+>/, ''));
|
|
146
|
+
if (match[3]) {
|
|
147
|
+
const interfaces = match[3].split(',').map(i => i.trim().replace(/<[^>]+>/, '')).filter(i => i);
|
|
148
|
+
baseClasses.push(...interfaces);
|
|
149
|
+
}
|
|
150
|
+
const classBody = cleanSource.slice(match.index, endIndex);
|
|
151
|
+
const methods = this.extractMethodNames(classBody);
|
|
152
|
+
const isPublic = match[0].includes('public');
|
|
153
|
+
classes.push(this.createClass({
|
|
154
|
+
name,
|
|
155
|
+
startLine,
|
|
156
|
+
endLine,
|
|
157
|
+
baseClasses,
|
|
158
|
+
methods,
|
|
159
|
+
isExported: isPublic,
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
// Also extract interfaces
|
|
163
|
+
const interfacePattern = /(?:public\s+)?interface\s+(\w+)(?:<[^>]+>)?(?:\s+extends\s+([^{]+))?\s*\{/g;
|
|
164
|
+
while ((match = interfacePattern.exec(cleanSource)) !== null) {
|
|
165
|
+
const name = match[1];
|
|
166
|
+
const startLine = this.getLineNumber(originalSource, match.index);
|
|
167
|
+
const endIndex = this.findBlockEnd(cleanSource, match.index);
|
|
168
|
+
const endLine = this.getLineNumber(originalSource, endIndex);
|
|
169
|
+
const baseClasses = match[2]
|
|
170
|
+
? match[2].split(',').map(i => i.trim().replace(/<[^>]+>/, '')).filter(i => i)
|
|
171
|
+
: [];
|
|
172
|
+
classes.push(this.createClass({
|
|
173
|
+
name,
|
|
174
|
+
startLine,
|
|
175
|
+
endLine,
|
|
176
|
+
baseClasses,
|
|
177
|
+
methods: [],
|
|
178
|
+
isExported: match[0].includes('public'),
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
// Also extract enums
|
|
182
|
+
const enumPattern = /(?:public\s+)?enum\s+(\w+)(?:\s+implements\s+([^{]+))?\s*\{/g;
|
|
183
|
+
while ((match = enumPattern.exec(cleanSource)) !== null) {
|
|
184
|
+
const name = match[1];
|
|
185
|
+
const startLine = this.getLineNumber(originalSource, match.index);
|
|
186
|
+
const endIndex = this.findBlockEnd(cleanSource, match.index);
|
|
187
|
+
const endLine = this.getLineNumber(originalSource, endIndex);
|
|
188
|
+
classes.push(this.createClass({
|
|
189
|
+
name,
|
|
190
|
+
startLine,
|
|
191
|
+
endLine,
|
|
192
|
+
baseClasses: [],
|
|
193
|
+
methods: [],
|
|
194
|
+
isExported: match[0].includes('public'),
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
return classes;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Extract method names from a class body
|
|
201
|
+
*/
|
|
202
|
+
extractMethodNames(classBody) {
|
|
203
|
+
const methods = [];
|
|
204
|
+
const methodPattern = /(?:public|private|protected|static|final|abstract|synchronized|\s)*(?:<[^>]+>\s+)?(\w+(?:<[^>]+>)?)\s+(\w+)\s*\([^)]*\)\s*(?:throws\s+[^{]+)?\s*\{/g;
|
|
205
|
+
let match;
|
|
206
|
+
while ((match = methodPattern.exec(classBody)) !== null) {
|
|
207
|
+
const name = match[2];
|
|
208
|
+
if (!['if', 'for', 'while', 'switch', 'catch', 'try'].includes(name)) {
|
|
209
|
+
methods.push(name);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return methods;
|
|
213
|
+
}
|
|
214
|
+
// ==========================================================================
|
|
215
|
+
// Import Extraction
|
|
216
|
+
// ==========================================================================
|
|
217
|
+
extractImports(cleanSource, originalSource, _filePath) {
|
|
218
|
+
const imports = [];
|
|
219
|
+
// Pattern: import [static] package.Class;
|
|
220
|
+
const importPattern = /import\s+(?:static\s+)?([^;]+);/g;
|
|
221
|
+
let match;
|
|
222
|
+
while ((match = importPattern.exec(cleanSource)) !== null) {
|
|
223
|
+
const source = match[1].trim();
|
|
224
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
225
|
+
const isStatic = match[0].includes('static');
|
|
226
|
+
// Handle wildcard imports
|
|
227
|
+
if (source.endsWith('.*')) {
|
|
228
|
+
imports.push(this.createImport({
|
|
229
|
+
source: source.slice(0, -2),
|
|
230
|
+
names: [{ imported: '*', local: '*', isNamespace: true }],
|
|
231
|
+
line,
|
|
232
|
+
}));
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
const className = source.split('.').pop();
|
|
236
|
+
imports.push(this.createImport({
|
|
237
|
+
source,
|
|
238
|
+
names: [{ imported: className, local: className, isDefault: false, isNamespace: false }],
|
|
239
|
+
line,
|
|
240
|
+
isTypeOnly: !isStatic,
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
243
|
+
return imports;
|
|
244
|
+
}
|
|
245
|
+
// ==========================================================================
|
|
246
|
+
// Export Extraction
|
|
247
|
+
// ==========================================================================
|
|
248
|
+
extractExports(cleanSource, originalSource, _filePath) {
|
|
249
|
+
const exports = [];
|
|
250
|
+
// Java doesn't have explicit exports, but we can detect package declarations
|
|
251
|
+
const packagePattern = /package\s+([^;]+);/g;
|
|
252
|
+
let match;
|
|
253
|
+
while ((match = packagePattern.exec(cleanSource)) !== null) {
|
|
254
|
+
const name = match[1].trim();
|
|
255
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
256
|
+
exports.push(this.createExport({ name, line }));
|
|
257
|
+
}
|
|
258
|
+
return exports;
|
|
259
|
+
}
|
|
260
|
+
// ==========================================================================
|
|
261
|
+
// Call Extraction
|
|
262
|
+
// ==========================================================================
|
|
263
|
+
extractCalls(cleanSource, originalSource, _filePath) {
|
|
264
|
+
const calls = [];
|
|
265
|
+
const seen = new Set();
|
|
266
|
+
// Pattern 1: Method calls - obj.method(...)
|
|
267
|
+
const methodCallPattern = /(\w+)\.(\w+)\s*\(/g;
|
|
268
|
+
let match;
|
|
269
|
+
while ((match = methodCallPattern.exec(cleanSource)) !== null) {
|
|
270
|
+
const receiver = match[1];
|
|
271
|
+
const calleeName = match[2];
|
|
272
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
273
|
+
const key = `${receiver}.${calleeName}:${line}`;
|
|
274
|
+
if (seen.has(key))
|
|
275
|
+
continue;
|
|
276
|
+
seen.add(key);
|
|
277
|
+
// Skip this.method calls for now
|
|
278
|
+
if (receiver === 'this' || receiver === 'super')
|
|
279
|
+
continue;
|
|
280
|
+
calls.push(this.createCall({
|
|
281
|
+
calleeName,
|
|
282
|
+
receiver,
|
|
283
|
+
fullExpression: `${receiver}.${calleeName}`,
|
|
284
|
+
line,
|
|
285
|
+
isMethodCall: true,
|
|
286
|
+
}));
|
|
287
|
+
}
|
|
288
|
+
// Pattern 2: Static method calls - Class.method(...)
|
|
289
|
+
// Already covered by pattern 1
|
|
290
|
+
// Pattern 3: Direct method calls (within same class) - method(...)
|
|
291
|
+
const funcCallPattern = /(?<![.\w])(\w+)\s*\(/g;
|
|
292
|
+
while ((match = funcCallPattern.exec(cleanSource)) !== null) {
|
|
293
|
+
const calleeName = match[1];
|
|
294
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
295
|
+
const key = `${calleeName}:${line}`;
|
|
296
|
+
if (seen.has(key))
|
|
297
|
+
continue;
|
|
298
|
+
seen.add(key);
|
|
299
|
+
// Skip keywords
|
|
300
|
+
if (['if', 'for', 'while', 'switch', 'catch', 'try', 'return', 'throw', 'new', 'class', 'interface', 'enum', 'synchronized', 'assert'].includes(calleeName))
|
|
301
|
+
continue;
|
|
302
|
+
calls.push(this.createCall({
|
|
303
|
+
calleeName,
|
|
304
|
+
fullExpression: calleeName,
|
|
305
|
+
line,
|
|
306
|
+
}));
|
|
307
|
+
}
|
|
308
|
+
// Pattern 4: Constructor calls - new Class(...)
|
|
309
|
+
const newPattern = /new\s+(\w+)(?:<[^>]*>)?\s*\(/g;
|
|
310
|
+
while ((match = newPattern.exec(cleanSource)) !== null) {
|
|
311
|
+
const calleeName = match[1];
|
|
312
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
313
|
+
const key = `new:${calleeName}:${line}`;
|
|
314
|
+
if (seen.has(key))
|
|
315
|
+
continue;
|
|
316
|
+
seen.add(key);
|
|
317
|
+
calls.push(this.createCall({
|
|
318
|
+
calleeName,
|
|
319
|
+
fullExpression: `new ${calleeName}`,
|
|
320
|
+
line,
|
|
321
|
+
isConstructorCall: true,
|
|
322
|
+
}));
|
|
323
|
+
}
|
|
324
|
+
return calls;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=java-regex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-regex.js","sourceRoot":"","sources":["../../../../src/call-graph/extractors/regex/java-regex.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB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QACN,CAAC;QAED,gDAAgD;QAChD,MAAM,UAAU,GAAG,+BAA+B,CAAC;QAEnD,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACvD,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7D,MAAM,GAAG,GAAG,OAAO,UAAU,IAAI,IAAI,EAAE,CAAC;YAExC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,SAAS;YAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAEd,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;gBACzB,UAAU;gBACV,cAAc,EAAE,OAAO,UAAU,EAAE;gBACnC,IAAI;gBACJ,iBAAiB,EAAE,IAAI;aACxB,CAAC,CAAC,CAAC;QACN,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PHP Regex Extractor
|
|
3
|
+
*
|
|
4
|
+
* Regex-based fallback extractor for PHP when tree-sitter is unavailable.
|
|
5
|
+
*/
|
|
6
|
+
import { BaseRegexExtractor } from './base-regex-extractor.js';
|
|
7
|
+
import type { CallGraphLanguage, FunctionExtraction, CallExtraction, ImportExtraction, ExportExtraction, ClassExtraction } from '../../types.js';
|
|
8
|
+
import type { LanguagePatterns } from '../types.js';
|
|
9
|
+
/**
|
|
10
|
+
* PHP regex-based extractor
|
|
11
|
+
*/
|
|
12
|
+
export declare class PhpRegexExtractor extends BaseRegexExtractor {
|
|
13
|
+
readonly language: CallGraphLanguage;
|
|
14
|
+
readonly extensions: string[];
|
|
15
|
+
protected readonly patterns: LanguagePatterns;
|
|
16
|
+
protected extractFunctions(cleanSource: string, originalSource: string, _filePath: string): FunctionExtraction[];
|
|
17
|
+
/**
|
|
18
|
+
* Parse PHP parameters
|
|
19
|
+
*/
|
|
20
|
+
private parsePhpParameters;
|
|
21
|
+
protected extractClasses(cleanSource: string, originalSource: string, _filePath: string): ClassExtraction[];
|
|
22
|
+
/**
|
|
23
|
+
* Extract method names from a class body
|
|
24
|
+
*/
|
|
25
|
+
private extractMethodNames;
|
|
26
|
+
protected extractImports(cleanSource: string, originalSource: string, _filePath: string): ImportExtraction[];
|
|
27
|
+
protected extractExports(cleanSource: string, originalSource: string, _filePath: string): ExportExtraction[];
|
|
28
|
+
protected extractCalls(cleanSource: string, originalSource: string, _filePath: string): CallExtraction[];
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=php-regex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"php-regex.d.ts","sourceRoot":"","sources":["../../../../src/call-graph/extractors/regex/php-regex.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAcpD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,kBAAkB;IACvD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAS;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAmE;IAChG,SAAS,CAAC,QAAQ,CAAC,QAAQ,mBAAgB;IAM3C,SAAS,CAAC,gBAAgB,CACxB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,kBAAkB,EAAE;IA8CvB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA8C1B,SAAS,CAAC,cAAc,CACtB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,eAAe,EAAE;IA6EpB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B,SAAS,CAAC,cAAc,CACtB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,gBAAgB,EAAE;IA6DrB,SAAS,CAAC,cAAc,CACtB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,gBAAgB,EAAE;IAqBrB,SAAS,CAAC,YAAY,CACpB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,cAAc,EAAE;CA4FpB"}
|