driftdetect-core 0.4.6 → 0.6.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/boundaries/types.d.ts +1 -1
- package/dist/boundaries/types.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.js +1 -0
- 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 +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/go-data-access-extractor.d.ts +80 -0
- package/dist/call-graph/extractors/go-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-data-access-extractor.js +457 -0
- package/dist/call-graph/extractors/go-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/go-extractor.d.ts +103 -0
- package/dist/call-graph/extractors/go-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-extractor.js +509 -0
- package/dist/call-graph/extractors/go-extractor.js.map +1 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.d.ts +97 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.js +496 -0
- package/dist/call-graph/extractors/go-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/go-regex.d.ts +51 -0
- package/dist/call-graph/extractors/regex/go-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/go-regex.js +435 -0
- package/dist/call-graph/extractors/regex/go-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/index.d.ts +26 -0
- package/dist/call-graph/extractors/regex/index.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/index.js +74 -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/call-graph/index.d.ts +3 -0
- package/dist/call-graph/index.d.ts.map +1 -1
- package/dist/call-graph/index.js +5 -0
- package/dist/call-graph/index.js.map +1 -1
- package/dist/call-graph/types.d.ts +1 -1
- package/dist/call-graph/types.d.ts.map +1 -1
- package/dist/constraints/extraction/constraint-synthesizer.d.ts +72 -0
- package/dist/constraints/extraction/constraint-synthesizer.d.ts.map +1 -0
- package/dist/constraints/extraction/constraint-synthesizer.js +336 -0
- package/dist/constraints/extraction/constraint-synthesizer.js.map +1 -0
- package/dist/constraints/extraction/index.d.ts +10 -0
- package/dist/constraints/extraction/index.d.ts.map +1 -0
- package/dist/constraints/extraction/index.js +10 -0
- package/dist/constraints/extraction/index.js.map +1 -0
- package/dist/constraints/extraction/invariant-detector.d.ts +109 -0
- package/dist/constraints/extraction/invariant-detector.d.ts.map +1 -0
- package/dist/constraints/extraction/invariant-detector.js +979 -0
- package/dist/constraints/extraction/invariant-detector.js.map +1 -0
- package/dist/constraints/index.d.ts +15 -0
- package/dist/constraints/index.d.ts.map +1 -0
- package/dist/constraints/index.js +16 -0
- package/dist/constraints/index.js.map +1 -0
- package/dist/constraints/store/constraint-store.d.ts +110 -0
- package/dist/constraints/store/constraint-store.d.ts.map +1 -0
- package/dist/constraints/store/constraint-store.js +584 -0
- package/dist/constraints/store/constraint-store.js.map +1 -0
- package/dist/constraints/types.d.ts +605 -0
- package/dist/constraints/types.d.ts.map +1 -0
- package/dist/constraints/types.js +57 -0
- package/dist/constraints/types.js.map +1 -0
- package/dist/constraints/verification/constraint-verifier.d.ts +100 -0
- package/dist/constraints/verification/constraint-verifier.d.ts.map +1 -0
- package/dist/constraints/verification/constraint-verifier.js +638 -0
- package/dist/constraints/verification/constraint-verifier.js.map +1 -0
- package/dist/constraints/verification/index.d.ts +8 -0
- package/dist/constraints/verification/index.d.ts.map +1 -0
- package/dist/constraints/verification/index.js +8 -0
- package/dist/constraints/verification/index.js.map +1 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.d.ts +121 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.d.ts.map +1 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.js +904 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.js.map +1 -0
- package/dist/decisions/analyzer/index.d.ts +5 -0
- package/dist/decisions/analyzer/index.d.ts.map +1 -0
- package/dist/decisions/analyzer/index.js +5 -0
- package/dist/decisions/analyzer/index.js.map +1 -0
- package/dist/decisions/extractors/base-commit-extractor.d.ts +104 -0
- package/dist/decisions/extractors/base-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/base-commit-extractor.js +305 -0
- package/dist/decisions/extractors/base-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/csharp-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/csharp-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/csharp-commit-extractor.js +281 -0
- package/dist/decisions/extractors/csharp-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/index.d.ts +31 -0
- package/dist/decisions/extractors/index.d.ts.map +1 -0
- package/dist/decisions/extractors/index.js +63 -0
- package/dist/decisions/extractors/index.js.map +1 -0
- package/dist/decisions/extractors/java-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/java-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/java-commit-extractor.js +248 -0
- package/dist/decisions/extractors/java-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/php-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/php-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/php-commit-extractor.js +280 -0
- package/dist/decisions/extractors/php-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/python-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/python-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/python-commit-extractor.js +248 -0
- package/dist/decisions/extractors/python-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/typescript-commit-extractor.d.ts +37 -0
- package/dist/decisions/extractors/typescript-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/typescript-commit-extractor.js +229 -0
- package/dist/decisions/extractors/typescript-commit-extractor.js.map +1 -0
- package/dist/decisions/git/commit-parser.d.ts +58 -0
- package/dist/decisions/git/commit-parser.d.ts.map +1 -0
- package/dist/decisions/git/commit-parser.js +344 -0
- package/dist/decisions/git/commit-parser.js.map +1 -0
- package/dist/decisions/git/diff-analyzer.d.ts +30 -0
- package/dist/decisions/git/diff-analyzer.d.ts.map +1 -0
- package/dist/decisions/git/diff-analyzer.js +492 -0
- package/dist/decisions/git/diff-analyzer.js.map +1 -0
- package/dist/decisions/git/git-walker.d.ts +64 -0
- package/dist/decisions/git/git-walker.d.ts.map +1 -0
- package/dist/decisions/git/git-walker.js +441 -0
- package/dist/decisions/git/git-walker.js.map +1 -0
- package/dist/decisions/git/index.d.ts +11 -0
- package/dist/decisions/git/index.d.ts.map +1 -0
- package/dist/decisions/git/index.js +13 -0
- package/dist/decisions/git/index.js.map +1 -0
- package/dist/decisions/git/types.d.ts +223 -0
- package/dist/decisions/git/types.d.ts.map +1 -0
- package/dist/decisions/git/types.js +7 -0
- package/dist/decisions/git/types.js.map +1 -0
- package/dist/decisions/index.d.ts +27 -0
- package/dist/decisions/index.d.ts.map +1 -0
- package/dist/decisions/index.js +45 -0
- package/dist/decisions/index.js.map +1 -0
- package/dist/decisions/types.d.ts +530 -0
- package/dist/decisions/types.d.ts.map +1 -0
- package/dist/decisions/types.js +8 -0
- package/dist/decisions/types.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/go/go-analyzer.d.ts +203 -0
- package/dist/go/go-analyzer.d.ts.map +1 -0
- package/dist/go/go-analyzer.js +509 -0
- package/dist/go/go-analyzer.js.map +1 -0
- package/dist/go/index.d.ts +7 -0
- package/dist/go/index.d.ts.map +1 -0
- package/dist/go/index.js +8 -0
- package/dist/go/index.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -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/parsers/tree-sitter/go-loader.d.ts +50 -0
- package/dist/parsers/tree-sitter/go-loader.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/go-loader.js +161 -0
- package/dist/parsers/tree-sitter/go-loader.js.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts +250 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.js +707 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.js.map +1 -0
- package/dist/parsers/types.d.ts +1 -1
- package/dist/parsers/types.d.ts.map +1 -1
- 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/simulation/approach-generator.d.ts +73 -0
- package/dist/simulation/approach-generator.d.ts.map +1 -0
- package/dist/simulation/approach-generator.js +371 -0
- package/dist/simulation/approach-generator.js.map +1 -0
- package/dist/simulation/index.d.ts +14 -0
- package/dist/simulation/index.d.ts.map +1 -0
- package/dist/simulation/index.js +19 -0
- package/dist/simulation/index.js.map +1 -0
- package/dist/simulation/language-strategies/csharp-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/csharp-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/csharp-strategies.js +118 -0
- package/dist/simulation/language-strategies/csharp-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/index.d.ts +41 -0
- package/dist/simulation/language-strategies/index.d.ts.map +1 -0
- package/dist/simulation/language-strategies/index.js +92 -0
- package/dist/simulation/language-strategies/index.js.map +1 -0
- package/dist/simulation/language-strategies/java-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/java-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/java-strategies.js +119 -0
- package/dist/simulation/language-strategies/java-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/php-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/php-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/php-strategies.js +129 -0
- package/dist/simulation/language-strategies/php-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/python-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/python-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/python-strategies.js +208 -0
- package/dist/simulation/language-strategies/python-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/types.d.ts +67 -0
- package/dist/simulation/language-strategies/types.d.ts.map +1 -0
- package/dist/simulation/language-strategies/types.js +23 -0
- package/dist/simulation/language-strategies/types.js.map +1 -0
- package/dist/simulation/language-strategies/typescript-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/typescript-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/typescript-strategies.js +251 -0
- package/dist/simulation/language-strategies/typescript-strategies.js.map +1 -0
- package/dist/simulation/scorers/friction-scorer.d.ts +45 -0
- package/dist/simulation/scorers/friction-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/friction-scorer.js +336 -0
- package/dist/simulation/scorers/friction-scorer.js.map +1 -0
- package/dist/simulation/scorers/impact-scorer.d.ts +56 -0
- package/dist/simulation/scorers/impact-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/impact-scorer.js +273 -0
- package/dist/simulation/scorers/impact-scorer.js.map +1 -0
- package/dist/simulation/scorers/index.d.ts +12 -0
- package/dist/simulation/scorers/index.d.ts.map +1 -0
- package/dist/simulation/scorers/index.js +12 -0
- package/dist/simulation/scorers/index.js.map +1 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.d.ts +83 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.js +367 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.js.map +1 -0
- package/dist/simulation/scorers/security-scorer.d.ts +63 -0
- package/dist/simulation/scorers/security-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/security-scorer.js +346 -0
- package/dist/simulation/scorers/security-scorer.js.map +1 -0
- package/dist/simulation/simulation-engine.d.ts +89 -0
- package/dist/simulation/simulation-engine.d.ts.map +1 -0
- package/dist/simulation/simulation-engine.js +480 -0
- package/dist/simulation/simulation-engine.js.map +1 -0
- package/dist/simulation/types.d.ts +200 -0
- package/dist/simulation/types.d.ts.map +1 -0
- package/dist/simulation/types.js +23 -0
- package/dist/simulation/types.js.map +1 -0
- package/dist/speculative/approach-generator.d.ts +2 -0
- package/dist/speculative/approach-generator.d.ts.map +1 -0
- package/dist/speculative/approach-generator.js +2 -0
- package/dist/speculative/approach-generator.js.map +1 -0
- package/dist/speculative/templates/types.d.ts +133 -0
- package/dist/speculative/templates/types.d.ts.map +1 -0
- package/dist/speculative/templates/types.js +208 -0
- package/dist/speculative/templates/types.js.map +1 -0
- package/dist/speculative/types.d.ts +523 -0
- package/dist/speculative/types.d.ts.map +1 -0
- package/dist/speculative/types.js +71 -0
- package/dist/speculative/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/go-test-extractor.d.ts +33 -0
- package/dist/test-topology/extractors/go-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/go-test-extractor.js +436 -0
- package/dist/test-topology/extractors/go-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/index.d.ts +13 -0
- package/dist/test-topology/extractors/index.d.ts.map +1 -0
- package/dist/test-topology/extractors/index.js +13 -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/go-test-regex.d.ts +62 -0
- package/dist/test-topology/extractors/regex/go-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/go-test-regex.js +528 -0
- package/dist/test-topology/extractors/regex/go-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/index.d.ts +19 -0
- package/dist/test-topology/extractors/regex/index.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/index.js +47 -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 +556 -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 +539 -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/matching/database-sql-matcher.d.ts +42 -0
- package/dist/unified-provider/matching/database-sql-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/database-sql-matcher.js +282 -0
- package/dist/unified-provider/matching/database-sql-matcher.js.map +1 -0
- package/dist/unified-provider/matching/gorm-matcher.d.ts +41 -0
- package/dist/unified-provider/matching/gorm-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/gorm-matcher.js +222 -0
- package/dist/unified-provider/matching/gorm-matcher.js.map +1 -0
- package/dist/unified-provider/matching/index.d.ts +3 -0
- package/dist/unified-provider/matching/index.d.ts.map +1 -1
- package/dist/unified-provider/matching/index.js +4 -0
- package/dist/unified-provider/matching/index.js.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.d.ts.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.js +7 -0
- package/dist/unified-provider/matching/matcher-registry.js.map +1 -1
- package/dist/unified-provider/matching/sqlx-matcher.d.ts +40 -0
- package/dist/unified-provider/matching/sqlx-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/sqlx-matcher.js +214 -0
- package/dist/unified-provider/matching/sqlx-matcher.js.map +1 -0
- package/dist/unified-provider/normalization/go-normalizer.d.ts +62 -0
- package/dist/unified-provider/normalization/go-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/go-normalizer.js +608 -0
- package/dist/unified-provider/normalization/go-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/index.d.ts +1 -0
- package/dist/unified-provider/normalization/index.d.ts.map +1 -1
- package/dist/unified-provider/normalization/index.js +6 -1
- package/dist/unified-provider/normalization/index.js.map +1 -1
- package/dist/unified-provider/types.d.ts +1 -1
- package/dist/unified-provider/types.d.ts.map +1 -1
- package/dist/wpf/extractors/binding-error-detector.d.ts +75 -0
- package/dist/wpf/extractors/binding-error-detector.d.ts.map +1 -0
- package/dist/wpf/extractors/binding-error-detector.js +290 -0
- package/dist/wpf/extractors/binding-error-detector.js.map +1 -0
- package/dist/wpf/extractors/code-behind-linker.d.ts +70 -0
- package/dist/wpf/extractors/code-behind-linker.d.ts.map +1 -0
- package/dist/wpf/extractors/code-behind-linker.js +172 -0
- package/dist/wpf/extractors/code-behind-linker.js.map +1 -0
- package/dist/wpf/extractors/dependency-property-extractor.d.ts +61 -0
- package/dist/wpf/extractors/dependency-property-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/dependency-property-extractor.js +201 -0
- package/dist/wpf/extractors/dependency-property-extractor.js.map +1 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.d.ts +82 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.d.ts.map +1 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.js +412 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.js.map +1 -0
- package/dist/wpf/extractors/regex/xaml-regex.d.ts +77 -0
- package/dist/wpf/extractors/regex/xaml-regex.d.ts.map +1 -0
- package/dist/wpf/extractors/regex/xaml-regex.js +353 -0
- package/dist/wpf/extractors/regex/xaml-regex.js.map +1 -0
- package/dist/wpf/extractors/resource-dictionary-parser.d.ts +103 -0
- package/dist/wpf/extractors/resource-dictionary-parser.d.ts.map +1 -0
- package/dist/wpf/extractors/resource-dictionary-parser.js +296 -0
- package/dist/wpf/extractors/resource-dictionary-parser.js.map +1 -0
- package/dist/wpf/extractors/value-converter-extractor.d.ts +128 -0
- package/dist/wpf/extractors/value-converter-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/value-converter-extractor.js +312 -0
- package/dist/wpf/extractors/value-converter-extractor.js.map +1 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts +104 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.js +513 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.js.map +1 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts +98 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.js +444 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.js.map +1 -0
- package/dist/wpf/index.d.ts +25 -0
- package/dist/wpf/index.d.ts.map +1 -0
- package/dist/wpf/index.js +31 -0
- package/dist/wpf/index.js.map +1 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.d.ts +82 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.d.ts.map +1 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.js +311 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.js.map +1 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.d.ts +129 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.d.ts.map +1 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.js +367 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.js.map +1 -0
- package/dist/wpf/linkers/datacontext-resolver.d.ts +66 -0
- package/dist/wpf/linkers/datacontext-resolver.d.ts.map +1 -0
- package/dist/wpf/linkers/datacontext-resolver.js +240 -0
- package/dist/wpf/linkers/datacontext-resolver.js.map +1 -0
- package/dist/wpf/linkers/viewmodel-linker.d.ts +71 -0
- package/dist/wpf/linkers/viewmodel-linker.d.ts.map +1 -0
- package/dist/wpf/linkers/viewmodel-linker.js +268 -0
- package/dist/wpf/linkers/viewmodel-linker.js.map +1 -0
- package/dist/wpf/types.d.ts +451 -0
- package/dist/wpf/types.d.ts.map +1 -0
- package/dist/wpf/types.js +8 -0
- package/dist/wpf/types.js.map +1 -0
- package/dist/wpf/wpf-analyzer.d.ts +114 -0
- package/dist/wpf/wpf-analyzer.d.ts.map +1 -0
- package/dist/wpf/wpf-analyzer.js +332 -0
- package/dist/wpf/wpf-analyzer.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 +210 -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 +33 -18
- package/LICENSE +0 -21
|
@@ -0,0 +1,333 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* PHP regex patterns
|
|
9
|
+
*/
|
|
10
|
+
const PHP_PATTERNS = {
|
|
11
|
+
language: 'php',
|
|
12
|
+
functions: [],
|
|
13
|
+
classes: [],
|
|
14
|
+
imports: [],
|
|
15
|
+
exports: [],
|
|
16
|
+
calls: [],
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* PHP regex-based extractor
|
|
20
|
+
*/
|
|
21
|
+
export class PhpRegexExtractor extends BaseRegexExtractor {
|
|
22
|
+
language = 'php';
|
|
23
|
+
extensions = ['.php', '.phtml', '.php3', '.php4', '.php5', '.php7', '.phps'];
|
|
24
|
+
patterns = PHP_PATTERNS;
|
|
25
|
+
// ==========================================================================
|
|
26
|
+
// Function Extraction
|
|
27
|
+
// ==========================================================================
|
|
28
|
+
extractFunctions(cleanSource, originalSource, _filePath) {
|
|
29
|
+
const functions = [];
|
|
30
|
+
const seen = new Set();
|
|
31
|
+
// Pattern: function name(...) { ... }
|
|
32
|
+
// With optional visibility, static, return type
|
|
33
|
+
const funcPattern = /(?:public|private|protected|static|\s)*function\s+(\w+)\s*\(([^)]*)\)\s*(?::\s*\??\s*(\w+))?\s*\{/g;
|
|
34
|
+
let match;
|
|
35
|
+
while ((match = funcPattern.exec(cleanSource)) !== null) {
|
|
36
|
+
const name = match[1];
|
|
37
|
+
const paramsStr = match[2] || '';
|
|
38
|
+
const returnType = 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
|
+
const endIndex = this.findBlockEnd(cleanSource, match.index);
|
|
45
|
+
const endLine = this.getLineNumber(originalSource, endIndex);
|
|
46
|
+
const isStatic = match[0].includes('static');
|
|
47
|
+
const isPublic = match[0].includes('public') || (!match[0].includes('private') && !match[0].includes('protected'));
|
|
48
|
+
const isMethod = match[0].includes('public') || match[0].includes('private') || match[0].includes('protected');
|
|
49
|
+
const params = this.parsePhpParameters(paramsStr);
|
|
50
|
+
const funcOpts = {
|
|
51
|
+
name,
|
|
52
|
+
startLine,
|
|
53
|
+
endLine,
|
|
54
|
+
parameters: params,
|
|
55
|
+
isMethod,
|
|
56
|
+
isStatic,
|
|
57
|
+
isExported: isPublic,
|
|
58
|
+
isConstructor: name === '__construct',
|
|
59
|
+
};
|
|
60
|
+
if (returnType)
|
|
61
|
+
funcOpts.returnType = returnType;
|
|
62
|
+
functions.push(this.createFunction(funcOpts));
|
|
63
|
+
}
|
|
64
|
+
return functions;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Parse PHP parameters
|
|
68
|
+
*/
|
|
69
|
+
parsePhpParameters(paramsStr) {
|
|
70
|
+
if (!paramsStr.trim())
|
|
71
|
+
return [];
|
|
72
|
+
const params = [];
|
|
73
|
+
const parts = paramsStr.split(',');
|
|
74
|
+
for (const part of parts) {
|
|
75
|
+
let trimmed = part.trim();
|
|
76
|
+
if (!trimmed)
|
|
77
|
+
continue;
|
|
78
|
+
let type;
|
|
79
|
+
let hasDefault = false;
|
|
80
|
+
const isRest = trimmed.startsWith('...');
|
|
81
|
+
if (isRest) {
|
|
82
|
+
trimmed = trimmed.slice(3);
|
|
83
|
+
}
|
|
84
|
+
// Handle default values
|
|
85
|
+
if (trimmed.includes('=')) {
|
|
86
|
+
hasDefault = true;
|
|
87
|
+
trimmed = trimmed.split('=')[0].trim();
|
|
88
|
+
}
|
|
89
|
+
// Handle type hints
|
|
90
|
+
const typeMatch = trimmed.match(/^(\??\w+(?:\|\w+)*)\s+\$(\w+)/);
|
|
91
|
+
if (typeMatch) {
|
|
92
|
+
type = typeMatch[1];
|
|
93
|
+
trimmed = typeMatch[2];
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
// Just variable name
|
|
97
|
+
trimmed = trimmed.replace(/^\$/, '');
|
|
98
|
+
}
|
|
99
|
+
if (trimmed) {
|
|
100
|
+
params.push({ name: trimmed.replace(/^\$/, ''), type, hasDefault, isRest });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return params;
|
|
104
|
+
}
|
|
105
|
+
// ==========================================================================
|
|
106
|
+
// Class Extraction
|
|
107
|
+
// ==========================================================================
|
|
108
|
+
extractClasses(cleanSource, originalSource, _filePath) {
|
|
109
|
+
const classes = [];
|
|
110
|
+
// Pattern: class Name extends Base implements Interface { ... }
|
|
111
|
+
const classPattern = /(?:abstract\s+)?(?:final\s+)?class\s+(\w+)(?:\s+extends\s+(\w+))?(?:\s+implements\s+([^{]+))?\s*\{/g;
|
|
112
|
+
let match;
|
|
113
|
+
while ((match = classPattern.exec(cleanSource)) !== null) {
|
|
114
|
+
const name = match[1];
|
|
115
|
+
const startLine = this.getLineNumber(originalSource, match.index);
|
|
116
|
+
const endIndex = this.findBlockEnd(cleanSource, match.index);
|
|
117
|
+
const endLine = this.getLineNumber(originalSource, endIndex);
|
|
118
|
+
const baseClasses = [];
|
|
119
|
+
if (match[2])
|
|
120
|
+
baseClasses.push(match[2]);
|
|
121
|
+
if (match[3]) {
|
|
122
|
+
const interfaces = match[3].split(',').map(i => i.trim()).filter(i => i);
|
|
123
|
+
baseClasses.push(...interfaces);
|
|
124
|
+
}
|
|
125
|
+
// Extract method names
|
|
126
|
+
const classBody = cleanSource.slice(match.index, endIndex);
|
|
127
|
+
const methods = this.extractMethodNames(classBody);
|
|
128
|
+
classes.push(this.createClass({
|
|
129
|
+
name,
|
|
130
|
+
startLine,
|
|
131
|
+
endLine,
|
|
132
|
+
baseClasses,
|
|
133
|
+
methods,
|
|
134
|
+
isExported: true, // PHP classes are always "exported" within namespace
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
// Also extract interfaces and traits
|
|
138
|
+
const interfacePattern = /interface\s+(\w+)(?:\s+extends\s+([^{]+))?\s*\{/g;
|
|
139
|
+
while ((match = interfacePattern.exec(cleanSource)) !== null) {
|
|
140
|
+
const name = match[1];
|
|
141
|
+
const startLine = this.getLineNumber(originalSource, match.index);
|
|
142
|
+
const endIndex = this.findBlockEnd(cleanSource, match.index);
|
|
143
|
+
const endLine = this.getLineNumber(originalSource, endIndex);
|
|
144
|
+
const baseClasses = match[2] ? match[2].split(',').map(i => i.trim()).filter(i => i) : [];
|
|
145
|
+
classes.push(this.createClass({
|
|
146
|
+
name,
|
|
147
|
+
startLine,
|
|
148
|
+
endLine,
|
|
149
|
+
baseClasses,
|
|
150
|
+
methods: [],
|
|
151
|
+
isExported: true,
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
const traitPattern = /trait\s+(\w+)\s*\{/g;
|
|
155
|
+
while ((match = traitPattern.exec(cleanSource)) !== null) {
|
|
156
|
+
const name = match[1];
|
|
157
|
+
const startLine = this.getLineNumber(originalSource, match.index);
|
|
158
|
+
const endIndex = this.findBlockEnd(cleanSource, match.index);
|
|
159
|
+
const endLine = this.getLineNumber(originalSource, endIndex);
|
|
160
|
+
const classBody = cleanSource.slice(match.index, endIndex);
|
|
161
|
+
const methods = this.extractMethodNames(classBody);
|
|
162
|
+
classes.push(this.createClass({
|
|
163
|
+
name,
|
|
164
|
+
startLine,
|
|
165
|
+
endLine,
|
|
166
|
+
baseClasses: [],
|
|
167
|
+
methods,
|
|
168
|
+
isExported: true,
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
return classes;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Extract method names from a class body
|
|
175
|
+
*/
|
|
176
|
+
extractMethodNames(classBody) {
|
|
177
|
+
const methods = [];
|
|
178
|
+
const methodPattern = /(?:public|private|protected|static|\s)*function\s+(\w+)\s*\(/g;
|
|
179
|
+
let match;
|
|
180
|
+
while ((match = methodPattern.exec(classBody)) !== null) {
|
|
181
|
+
methods.push(match[1]);
|
|
182
|
+
}
|
|
183
|
+
return methods;
|
|
184
|
+
}
|
|
185
|
+
// ==========================================================================
|
|
186
|
+
// Import Extraction
|
|
187
|
+
// ==========================================================================
|
|
188
|
+
extractImports(cleanSource, originalSource, _filePath) {
|
|
189
|
+
const imports = [];
|
|
190
|
+
// Pattern 1: use Namespace\Class;
|
|
191
|
+
// Pattern 2: use Namespace\Class as Alias;
|
|
192
|
+
const usePattern = /use\s+([^;]+);/g;
|
|
193
|
+
let match;
|
|
194
|
+
while ((match = usePattern.exec(cleanSource)) !== null) {
|
|
195
|
+
const useStr = match[1].trim();
|
|
196
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
197
|
+
// Handle grouped use: use Namespace\{Class1, Class2};
|
|
198
|
+
if (useStr.includes('{')) {
|
|
199
|
+
const groupMatch = useStr.match(/^([^{]+)\{([^}]+)\}/);
|
|
200
|
+
if (groupMatch) {
|
|
201
|
+
const prefix = groupMatch[1].trim();
|
|
202
|
+
const names = groupMatch[2].split(',').map(n => {
|
|
203
|
+
const parts = n.trim().split(/\s+as\s+/);
|
|
204
|
+
const imported = prefix + parts[0].trim();
|
|
205
|
+
const local = (parts[1] || parts[0].split('\\').pop()).trim();
|
|
206
|
+
return { imported, local, isDefault: false, isNamespace: false };
|
|
207
|
+
});
|
|
208
|
+
imports.push(this.createImport({ source: prefix, names, line }));
|
|
209
|
+
}
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
// Handle single use with optional alias
|
|
213
|
+
const parts = useStr.split(/\s+as\s+/);
|
|
214
|
+
const imported = parts[0].trim();
|
|
215
|
+
const local = (parts[1] || imported.split('\\').pop()).trim();
|
|
216
|
+
imports.push(this.createImport({
|
|
217
|
+
source: imported,
|
|
218
|
+
names: [{ imported, local, isDefault: false, isNamespace: false }],
|
|
219
|
+
line,
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
// Pattern: require/include statements
|
|
223
|
+
const requirePattern = /(?:require|include)(?:_once)?\s*\(?['"]([^'"]+)['"]\)?/g;
|
|
224
|
+
while ((match = requirePattern.exec(cleanSource)) !== null) {
|
|
225
|
+
const source = match[1];
|
|
226
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
227
|
+
imports.push(this.createImport({
|
|
228
|
+
source,
|
|
229
|
+
names: [{ imported: source, local: source, isDefault: false, isNamespace: false }],
|
|
230
|
+
line,
|
|
231
|
+
}));
|
|
232
|
+
}
|
|
233
|
+
return imports;
|
|
234
|
+
}
|
|
235
|
+
// ==========================================================================
|
|
236
|
+
// Export Extraction
|
|
237
|
+
// ==========================================================================
|
|
238
|
+
extractExports(cleanSource, originalSource, _filePath) {
|
|
239
|
+
const exports = [];
|
|
240
|
+
// PHP doesn't have explicit exports, but we can detect namespace declarations
|
|
241
|
+
const namespacePattern = /namespace\s+([^;{]+)/g;
|
|
242
|
+
let match;
|
|
243
|
+
while ((match = namespacePattern.exec(cleanSource)) !== null) {
|
|
244
|
+
const name = match[1].trim();
|
|
245
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
246
|
+
exports.push(this.createExport({ name, line }));
|
|
247
|
+
}
|
|
248
|
+
return exports;
|
|
249
|
+
}
|
|
250
|
+
// ==========================================================================
|
|
251
|
+
// Call Extraction
|
|
252
|
+
// ==========================================================================
|
|
253
|
+
extractCalls(cleanSource, originalSource, _filePath) {
|
|
254
|
+
const calls = [];
|
|
255
|
+
const seen = new Set();
|
|
256
|
+
// Pattern 1: Object method calls - $obj->method(...)
|
|
257
|
+
const methodCallPattern = /(\$\w+)->(\w+)\s*\(/g;
|
|
258
|
+
let match;
|
|
259
|
+
while ((match = methodCallPattern.exec(cleanSource)) !== null) {
|
|
260
|
+
const receiver = match[1];
|
|
261
|
+
const calleeName = match[2];
|
|
262
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
263
|
+
const key = `${receiver}->${calleeName}:${line}`;
|
|
264
|
+
if (seen.has(key))
|
|
265
|
+
continue;
|
|
266
|
+
seen.add(key);
|
|
267
|
+
calls.push(this.createCall({
|
|
268
|
+
calleeName,
|
|
269
|
+
receiver,
|
|
270
|
+
fullExpression: `${receiver}->${calleeName}`,
|
|
271
|
+
line,
|
|
272
|
+
isMethodCall: true,
|
|
273
|
+
}));
|
|
274
|
+
}
|
|
275
|
+
// Pattern 2: Static method calls - Class::method(...)
|
|
276
|
+
const staticCallPattern = /(\w+)::(\w+)\s*\(/g;
|
|
277
|
+
while ((match = staticCallPattern.exec(cleanSource)) !== null) {
|
|
278
|
+
const receiver = match[1];
|
|
279
|
+
const calleeName = match[2];
|
|
280
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
281
|
+
const key = `${receiver}::${calleeName}:${line}`;
|
|
282
|
+
if (seen.has(key))
|
|
283
|
+
continue;
|
|
284
|
+
seen.add(key);
|
|
285
|
+
// Skip self:: and parent:: for now
|
|
286
|
+
if (receiver === 'self' || receiver === 'parent' || receiver === 'static')
|
|
287
|
+
continue;
|
|
288
|
+
calls.push(this.createCall({
|
|
289
|
+
calleeName,
|
|
290
|
+
receiver,
|
|
291
|
+
fullExpression: `${receiver}::${calleeName}`,
|
|
292
|
+
line,
|
|
293
|
+
isMethodCall: true,
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
// Pattern 3: Direct function calls - func(...)
|
|
297
|
+
const funcCallPattern = /(?<![->:\w])(\w+)\s*\(/g;
|
|
298
|
+
while ((match = funcCallPattern.exec(cleanSource)) !== null) {
|
|
299
|
+
const calleeName = match[1];
|
|
300
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
301
|
+
const key = `${calleeName}:${line}`;
|
|
302
|
+
if (seen.has(key))
|
|
303
|
+
continue;
|
|
304
|
+
seen.add(key);
|
|
305
|
+
// Skip keywords and language constructs
|
|
306
|
+
if (['if', 'for', 'foreach', 'while', 'switch', 'catch', 'function', 'return', 'throw', 'new', 'array', 'list', 'isset', 'empty', 'unset', 'echo', 'print'].includes(calleeName))
|
|
307
|
+
continue;
|
|
308
|
+
calls.push(this.createCall({
|
|
309
|
+
calleeName,
|
|
310
|
+
fullExpression: calleeName,
|
|
311
|
+
line,
|
|
312
|
+
}));
|
|
313
|
+
}
|
|
314
|
+
// Pattern 4: Constructor calls - new Class(...)
|
|
315
|
+
const newPattern = /new\s+(\w+)\s*\(/g;
|
|
316
|
+
while ((match = newPattern.exec(cleanSource)) !== null) {
|
|
317
|
+
const calleeName = match[1];
|
|
318
|
+
const line = this.getLineNumber(originalSource, match.index);
|
|
319
|
+
const key = `new:${calleeName}:${line}`;
|
|
320
|
+
if (seen.has(key))
|
|
321
|
+
continue;
|
|
322
|
+
seen.add(key);
|
|
323
|
+
calls.push(this.createCall({
|
|
324
|
+
calleeName,
|
|
325
|
+
fullExpression: `new ${calleeName}`,
|
|
326
|
+
line,
|
|
327
|
+
isConstructorCall: true,
|
|
328
|
+
}));
|
|
329
|
+
}
|
|
330
|
+
return calls;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
//# sourceMappingURL=php-regex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"php-regex.js","sourceRoot":"","sources":["../../../../src/call-graph/extractors/regex/php-regex.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAW/D;;GAEG;AACH,MAAM,YAAY,GAAqB;IACrC,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;CACV,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,kBAAkB;IAC9C,QAAQ,GAAsB,KAAK,CAAC;IACpC,UAAU,GAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7E,QAAQ,GAAG,YAAY,CAAC;IAE3C,6EAA6E;IAC7E,sBAAsB;IACtB,6EAA6E;IAEnE,gBAAgB,CACxB,WAAmB,EACnB,cAAsB,EACtB,SAAiB;QAEjB,MAAM,SAAS,GAAyB,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAE/B,sCAAsC;QACtC,gDAAgD;QAChD,MAAM,WAAW,GAAG,oGAAoG,CAAC;QACzH,IAAI,KAAK,CAAC;QAEV,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACxD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,C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YAE3L,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;gBACzB,UAAU;gBACV,cAAc,EAAE,UAAU;gBAC1B,IAAI;aACL,CAAC,CAAC,CAAC;QACN,CAAC;QAED,gDAAgD;QAChD,MAAM,UAAU,GAAG,mBAAmB,CAAC;QAEvC,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,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python Regex Extractor
|
|
3
|
+
*
|
|
4
|
+
* Regex-based fallback extractor for Python 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
|
+
* Python regex-based extractor
|
|
11
|
+
*/
|
|
12
|
+
export declare class PythonRegexExtractor extends BaseRegexExtractor {
|
|
13
|
+
readonly language: CallGraphLanguage;
|
|
14
|
+
readonly extensions: string[];
|
|
15
|
+
protected readonly patterns: LanguagePatterns;
|
|
16
|
+
/**
|
|
17
|
+
* Override preprocessSource for Python-specific handling
|
|
18
|
+
*/
|
|
19
|
+
protected preprocessSource(source: string): string;
|
|
20
|
+
protected extractFunctions(cleanSource: string, originalSource: string, _filePath: string): FunctionExtraction[];
|
|
21
|
+
/**
|
|
22
|
+
* Find the end of a Python block based on indentation
|
|
23
|
+
*/
|
|
24
|
+
private findPythonBlockEnd;
|
|
25
|
+
/**
|
|
26
|
+
* Get decorators above a function definition
|
|
27
|
+
*/
|
|
28
|
+
private getDecoratorsAbove;
|
|
29
|
+
/**
|
|
30
|
+
* Parse Python parameters
|
|
31
|
+
*/
|
|
32
|
+
private parsePythonParameters;
|
|
33
|
+
protected extractClasses(cleanSource: string, originalSource: string, _filePath: string): ClassExtraction[];
|
|
34
|
+
/**
|
|
35
|
+
* Get character index from line number
|
|
36
|
+
*/
|
|
37
|
+
private getIndexFromLine;
|
|
38
|
+
/**
|
|
39
|
+
* Extract method names from a class body
|
|
40
|
+
*/
|
|
41
|
+
private extractMethodNames;
|
|
42
|
+
protected extractImports(cleanSource: string, originalSource: string, _filePath: string): ImportExtraction[];
|
|
43
|
+
protected extractExports(cleanSource: string, originalSource: string, _filePath: string): ExportExtraction[];
|
|
44
|
+
protected extractCalls(cleanSource: string, originalSource: string, _filePath: string): CallExtraction[];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=python-regex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python-regex.d.ts","sourceRoot":"","sources":["../../../../src/call-graph/extractors/regex/python-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,EA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