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.
Files changed (325) hide show
  1. package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts +8 -0
  2. package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts.map +1 -1
  3. package/dist/call-graph/extractors/csharp-data-access-extractor.js +8 -0
  4. package/dist/call-graph/extractors/csharp-data-access-extractor.js.map +1 -1
  5. package/dist/call-graph/extractors/csharp-extractor.d.ts +35 -0
  6. package/dist/call-graph/extractors/csharp-extractor.d.ts.map +1 -1
  7. package/dist/call-graph/extractors/csharp-extractor.js +362 -4
  8. package/dist/call-graph/extractors/csharp-extractor.js.map +1 -1
  9. package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts +37 -0
  10. package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts.map +1 -0
  11. package/dist/call-graph/extractors/csharp-hybrid-extractor.js +408 -0
  12. package/dist/call-graph/extractors/csharp-hybrid-extractor.js.map +1 -0
  13. package/dist/call-graph/extractors/hybrid-extractor-base.d.ts +102 -0
  14. package/dist/call-graph/extractors/hybrid-extractor-base.d.ts.map +1 -0
  15. package/dist/call-graph/extractors/hybrid-extractor-base.js +289 -0
  16. package/dist/call-graph/extractors/hybrid-extractor-base.js.map +1 -0
  17. package/dist/call-graph/extractors/index.d.ts +17 -13
  18. package/dist/call-graph/extractors/index.d.ts.map +1 -1
  19. package/dist/call-graph/extractors/index.js +24 -23
  20. package/dist/call-graph/extractors/index.js.map +1 -1
  21. package/dist/call-graph/extractors/java-data-access-extractor.d.ts +8 -0
  22. package/dist/call-graph/extractors/java-data-access-extractor.d.ts.map +1 -1
  23. package/dist/call-graph/extractors/java-data-access-extractor.js +8 -0
  24. package/dist/call-graph/extractors/java-data-access-extractor.js.map +1 -1
  25. package/dist/call-graph/extractors/java-extractor.d.ts +15 -0
  26. package/dist/call-graph/extractors/java-extractor.d.ts.map +1 -1
  27. package/dist/call-graph/extractors/java-extractor.js +120 -4
  28. package/dist/call-graph/extractors/java-extractor.js.map +1 -1
  29. package/dist/call-graph/extractors/java-hybrid-extractor.d.ts +36 -0
  30. package/dist/call-graph/extractors/java-hybrid-extractor.d.ts.map +1 -0
  31. package/dist/call-graph/extractors/java-hybrid-extractor.js +426 -0
  32. package/dist/call-graph/extractors/java-hybrid-extractor.js.map +1 -0
  33. package/dist/call-graph/extractors/php-data-access-extractor.d.ts +8 -0
  34. package/dist/call-graph/extractors/php-data-access-extractor.d.ts.map +1 -1
  35. package/dist/call-graph/extractors/php-data-access-extractor.js +8 -0
  36. package/dist/call-graph/extractors/php-data-access-extractor.js.map +1 -1
  37. package/dist/call-graph/extractors/php-extractor.d.ts +48 -1
  38. package/dist/call-graph/extractors/php-extractor.d.ts.map +1 -1
  39. package/dist/call-graph/extractors/php-extractor.js +460 -6
  40. package/dist/call-graph/extractors/php-extractor.js.map +1 -1
  41. package/dist/call-graph/extractors/php-hybrid-extractor.d.ts +35 -0
  42. package/dist/call-graph/extractors/php-hybrid-extractor.d.ts.map +1 -0
  43. package/dist/call-graph/extractors/php-hybrid-extractor.js +393 -0
  44. package/dist/call-graph/extractors/php-hybrid-extractor.js.map +1 -0
  45. package/dist/call-graph/extractors/python-data-access-extractor.d.ts +8 -0
  46. package/dist/call-graph/extractors/python-data-access-extractor.d.ts.map +1 -1
  47. package/dist/call-graph/extractors/python-data-access-extractor.js +8 -0
  48. package/dist/call-graph/extractors/python-data-access-extractor.js.map +1 -1
  49. package/dist/call-graph/extractors/python-hybrid-extractor.d.ts +85 -0
  50. package/dist/call-graph/extractors/python-hybrid-extractor.d.ts.map +1 -0
  51. package/dist/call-graph/extractors/python-hybrid-extractor.js +462 -0
  52. package/dist/call-graph/extractors/python-hybrid-extractor.js.map +1 -0
  53. package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts +154 -0
  54. package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts.map +1 -0
  55. package/dist/call-graph/extractors/regex/base-regex-extractor.js +346 -0
  56. package/dist/call-graph/extractors/regex/base-regex-extractor.js.map +1 -0
  57. package/dist/call-graph/extractors/regex/csharp-regex.d.ts +34 -0
  58. package/dist/call-graph/extractors/regex/csharp-regex.d.ts.map +1 -0
  59. package/dist/call-graph/extractors/regex/csharp-regex.js +393 -0
  60. package/dist/call-graph/extractors/regex/csharp-regex.js.map +1 -0
  61. package/dist/call-graph/extractors/regex/index.d.ts +25 -0
  62. package/dist/call-graph/extractors/regex/index.d.ts.map +1 -0
  63. package/dist/call-graph/extractors/regex/index.js +66 -0
  64. package/dist/call-graph/extractors/regex/index.js.map +1 -0
  65. package/dist/call-graph/extractors/regex/java-regex.d.ts +34 -0
  66. package/dist/call-graph/extractors/regex/java-regex.d.ts.map +1 -0
  67. package/dist/call-graph/extractors/regex/java-regex.js +327 -0
  68. package/dist/call-graph/extractors/regex/java-regex.js.map +1 -0
  69. package/dist/call-graph/extractors/regex/php-regex.d.ts +30 -0
  70. package/dist/call-graph/extractors/regex/php-regex.d.ts.map +1 -0
  71. package/dist/call-graph/extractors/regex/php-regex.js +333 -0
  72. package/dist/call-graph/extractors/regex/php-regex.js.map +1 -0
  73. package/dist/call-graph/extractors/regex/python-regex.d.ts +46 -0
  74. package/dist/call-graph/extractors/regex/python-regex.d.ts.map +1 -0
  75. package/dist/call-graph/extractors/regex/python-regex.js +380 -0
  76. package/dist/call-graph/extractors/regex/python-regex.js.map +1 -0
  77. package/dist/call-graph/extractors/regex/typescript-regex.d.ts +27 -0
  78. package/dist/call-graph/extractors/regex/typescript-regex.d.ts.map +1 -0
  79. package/dist/call-graph/extractors/regex/typescript-regex.js +349 -0
  80. package/dist/call-graph/extractors/regex/typescript-regex.js.map +1 -0
  81. package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts +7 -0
  82. package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts.map +1 -1
  83. package/dist/call-graph/extractors/semantic-data-access-scanner.js +7 -0
  84. package/dist/call-graph/extractors/semantic-data-access-scanner.js.map +1 -1
  85. package/dist/call-graph/extractors/types.d.ts +111 -0
  86. package/dist/call-graph/extractors/types.d.ts.map +1 -0
  87. package/dist/call-graph/extractors/types.js +68 -0
  88. package/dist/call-graph/extractors/types.js.map +1 -0
  89. package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts +8 -0
  90. package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts.map +1 -1
  91. package/dist/call-graph/extractors/typescript-data-access-extractor.js +8 -0
  92. package/dist/call-graph/extractors/typescript-data-access-extractor.js.map +1 -1
  93. package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts +116 -0
  94. package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts.map +1 -0
  95. package/dist/call-graph/extractors/typescript-hybrid-extractor.js +635 -0
  96. package/dist/call-graph/extractors/typescript-hybrid-extractor.js.map +1 -0
  97. package/dist/error-handling/error-handling-analyzer.d.ts +73 -0
  98. package/dist/error-handling/error-handling-analyzer.d.ts.map +1 -0
  99. package/dist/error-handling/error-handling-analyzer.js +706 -0
  100. package/dist/error-handling/error-handling-analyzer.js.map +1 -0
  101. package/dist/error-handling/index.d.ts +8 -0
  102. package/dist/error-handling/index.d.ts.map +1 -0
  103. package/dist/error-handling/index.js +8 -0
  104. package/dist/error-handling/index.js.map +1 -0
  105. package/dist/error-handling/types.d.ts +307 -0
  106. package/dist/error-handling/types.d.ts.map +1 -0
  107. package/dist/error-handling/types.js +7 -0
  108. package/dist/error-handling/types.js.map +1 -0
  109. package/dist/index.d.ts +14 -0
  110. package/dist/index.d.ts.map +1 -1
  111. package/dist/index.js +29 -0
  112. package/dist/index.js.map +1 -1
  113. package/dist/lake/pattern-shard-store.d.ts +6 -0
  114. package/dist/lake/pattern-shard-store.d.ts.map +1 -1
  115. package/dist/lake/pattern-shard-store.js +6 -0
  116. package/dist/lake/pattern-shard-store.js.map +1 -1
  117. package/dist/module-coupling/coupling-analyzer.d.ts +73 -0
  118. package/dist/module-coupling/coupling-analyzer.d.ts.map +1 -0
  119. package/dist/module-coupling/coupling-analyzer.js +668 -0
  120. package/dist/module-coupling/coupling-analyzer.js.map +1 -0
  121. package/dist/module-coupling/index.d.ts +9 -0
  122. package/dist/module-coupling/index.d.ts.map +1 -0
  123. package/dist/module-coupling/index.js +9 -0
  124. package/dist/module-coupling/index.js.map +1 -0
  125. package/dist/module-coupling/types.d.ts +273 -0
  126. package/dist/module-coupling/types.d.ts.map +1 -0
  127. package/dist/module-coupling/types.js +8 -0
  128. package/dist/module-coupling/types.js.map +1 -0
  129. package/dist/patterns/adapters/index.d.ts +11 -0
  130. package/dist/patterns/adapters/index.d.ts.map +1 -0
  131. package/dist/patterns/adapters/index.js +11 -0
  132. package/dist/patterns/adapters/index.js.map +1 -0
  133. package/dist/patterns/adapters/pattern-store-adapter.d.ts +59 -0
  134. package/dist/patterns/adapters/pattern-store-adapter.d.ts.map +1 -0
  135. package/dist/patterns/adapters/pattern-store-adapter.js +468 -0
  136. package/dist/patterns/adapters/pattern-store-adapter.js.map +1 -0
  137. package/dist/patterns/adapters/service-factory.d.ts +40 -0
  138. package/dist/patterns/adapters/service-factory.d.ts.map +1 -0
  139. package/dist/patterns/adapters/service-factory.js +144 -0
  140. package/dist/patterns/adapters/service-factory.js.map +1 -0
  141. package/dist/patterns/errors.d.ts +32 -0
  142. package/dist/patterns/errors.d.ts.map +1 -0
  143. package/dist/patterns/errors.js +45 -0
  144. package/dist/patterns/errors.js.map +1 -0
  145. package/dist/patterns/impl/cached-repository.d.ts +79 -0
  146. package/dist/patterns/impl/cached-repository.d.ts.map +1 -0
  147. package/dist/patterns/impl/cached-repository.js +296 -0
  148. package/dist/patterns/impl/cached-repository.js.map +1 -0
  149. package/dist/patterns/impl/file-repository.d.ts +75 -0
  150. package/dist/patterns/impl/file-repository.d.ts.map +1 -0
  151. package/dist/patterns/impl/file-repository.js +507 -0
  152. package/dist/patterns/impl/file-repository.js.map +1 -0
  153. package/dist/patterns/impl/index.d.ts +16 -0
  154. package/dist/patterns/impl/index.d.ts.map +1 -0
  155. package/dist/patterns/impl/index.js +21 -0
  156. package/dist/patterns/impl/index.js.map +1 -0
  157. package/dist/patterns/impl/memory-repository.d.ts +56 -0
  158. package/dist/patterns/impl/memory-repository.d.ts.map +1 -0
  159. package/dist/patterns/impl/memory-repository.js +323 -0
  160. package/dist/patterns/impl/memory-repository.js.map +1 -0
  161. package/dist/patterns/impl/pattern-service.d.ts +52 -0
  162. package/dist/patterns/impl/pattern-service.d.ts.map +1 -0
  163. package/dist/patterns/impl/pattern-service.js +382 -0
  164. package/dist/patterns/impl/pattern-service.js.map +1 -0
  165. package/dist/patterns/impl/repository-factory.d.ts +44 -0
  166. package/dist/patterns/impl/repository-factory.d.ts.map +1 -0
  167. package/dist/patterns/impl/repository-factory.js +140 -0
  168. package/dist/patterns/impl/repository-factory.js.map +1 -0
  169. package/dist/patterns/impl/unified-file-repository.d.ts +111 -0
  170. package/dist/patterns/impl/unified-file-repository.d.ts.map +1 -0
  171. package/dist/patterns/impl/unified-file-repository.js +677 -0
  172. package/dist/patterns/impl/unified-file-repository.js.map +1 -0
  173. package/dist/patterns/index.d.ts +23 -0
  174. package/dist/patterns/index.d.ts.map +1 -0
  175. package/dist/patterns/index.js +41 -0
  176. package/dist/patterns/index.js.map +1 -0
  177. package/dist/patterns/repository.d.ts +241 -0
  178. package/dist/patterns/repository.d.ts.map +1 -0
  179. package/dist/patterns/repository.js +23 -0
  180. package/dist/patterns/repository.js.map +1 -0
  181. package/dist/patterns/service.d.ts +245 -0
  182. package/dist/patterns/service.d.ts.map +1 -0
  183. package/dist/patterns/service.js +25 -0
  184. package/dist/patterns/service.js.map +1 -0
  185. package/dist/patterns/types.d.ts +227 -0
  186. package/dist/patterns/types.d.ts.map +1 -0
  187. package/dist/patterns/types.js +117 -0
  188. package/dist/patterns/types.js.map +1 -0
  189. package/dist/store/pattern-store.d.ts +6 -0
  190. package/dist/store/pattern-store.d.ts.map +1 -1
  191. package/dist/store/pattern-store.js +6 -0
  192. package/dist/store/pattern-store.js.map +1 -1
  193. package/dist/test-topology/extractors/base-test-extractor.d.ts +89 -0
  194. package/dist/test-topology/extractors/base-test-extractor.d.ts.map +1 -0
  195. package/dist/test-topology/extractors/base-test-extractor.js +187 -0
  196. package/dist/test-topology/extractors/base-test-extractor.js.map +1 -0
  197. package/dist/test-topology/extractors/csharp-test-extractor.d.ts +23 -0
  198. package/dist/test-topology/extractors/csharp-test-extractor.d.ts.map +1 -0
  199. package/dist/test-topology/extractors/csharp-test-extractor.js +367 -0
  200. package/dist/test-topology/extractors/csharp-test-extractor.js.map +1 -0
  201. package/dist/test-topology/extractors/index.d.ts +12 -0
  202. package/dist/test-topology/extractors/index.d.ts.map +1 -0
  203. package/dist/test-topology/extractors/index.js +12 -0
  204. package/dist/test-topology/extractors/index.js.map +1 -0
  205. package/dist/test-topology/extractors/java-test-extractor.d.ts +20 -0
  206. package/dist/test-topology/extractors/java-test-extractor.d.ts.map +1 -0
  207. package/dist/test-topology/extractors/java-test-extractor.js +275 -0
  208. package/dist/test-topology/extractors/java-test-extractor.js.map +1 -0
  209. package/dist/test-topology/extractors/php-test-extractor.d.ts +24 -0
  210. package/dist/test-topology/extractors/php-test-extractor.d.ts.map +1 -0
  211. package/dist/test-topology/extractors/php-test-extractor.js +409 -0
  212. package/dist/test-topology/extractors/php-test-extractor.js.map +1 -0
  213. package/dist/test-topology/extractors/python-test-extractor.d.ts +23 -0
  214. package/dist/test-topology/extractors/python-test-extractor.d.ts.map +1 -0
  215. package/dist/test-topology/extractors/python-test-extractor.js +342 -0
  216. package/dist/test-topology/extractors/python-test-extractor.js.map +1 -0
  217. package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts +51 -0
  218. package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts.map +1 -0
  219. package/dist/test-topology/extractors/regex/csharp-test-regex.js +383 -0
  220. package/dist/test-topology/extractors/regex/csharp-test-regex.js.map +1 -0
  221. package/dist/test-topology/extractors/regex/index.d.ts +18 -0
  222. package/dist/test-topology/extractors/regex/index.d.ts.map +1 -0
  223. package/dist/test-topology/extractors/regex/index.js +43 -0
  224. package/dist/test-topology/extractors/regex/index.js.map +1 -0
  225. package/dist/test-topology/extractors/regex/java-test-regex.d.ts +50 -0
  226. package/dist/test-topology/extractors/regex/java-test-regex.d.ts.map +1 -0
  227. package/dist/test-topology/extractors/regex/java-test-regex.js +370 -0
  228. package/dist/test-topology/extractors/regex/java-test-regex.js.map +1 -0
  229. package/dist/test-topology/extractors/regex/php-test-regex.d.ts +56 -0
  230. package/dist/test-topology/extractors/regex/php-test-regex.d.ts.map +1 -0
  231. package/dist/test-topology/extractors/regex/php-test-regex.js +503 -0
  232. package/dist/test-topology/extractors/regex/php-test-regex.js.map +1 -0
  233. package/dist/test-topology/extractors/regex/python-test-regex.d.ts +57 -0
  234. package/dist/test-topology/extractors/regex/python-test-regex.d.ts.map +1 -0
  235. package/dist/test-topology/extractors/regex/python-test-regex.js +381 -0
  236. package/dist/test-topology/extractors/regex/python-test-regex.js.map +1 -0
  237. package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts +60 -0
  238. package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts.map +1 -0
  239. package/dist/test-topology/extractors/regex/typescript-test-regex.js +368 -0
  240. package/dist/test-topology/extractors/regex/typescript-test-regex.js.map +1 -0
  241. package/dist/test-topology/extractors/typescript-test-extractor.d.ts +24 -0
  242. package/dist/test-topology/extractors/typescript-test-extractor.d.ts.map +1 -0
  243. package/dist/test-topology/extractors/typescript-test-extractor.js +266 -0
  244. package/dist/test-topology/extractors/typescript-test-extractor.js.map +1 -0
  245. package/dist/test-topology/hybrid-test-topology-analyzer.d.ts +98 -0
  246. package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -0
  247. package/dist/test-topology/hybrid-test-topology-analyzer.js +555 -0
  248. package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -0
  249. package/dist/test-topology/index.d.ts +16 -0
  250. package/dist/test-topology/index.d.ts.map +1 -0
  251. package/dist/test-topology/index.js +19 -0
  252. package/dist/test-topology/index.js.map +1 -0
  253. package/dist/test-topology/test-topology-analyzer.d.ts +85 -0
  254. package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -0
  255. package/dist/test-topology/test-topology-analyzer.js +538 -0
  256. package/dist/test-topology/test-topology-analyzer.js.map +1 -0
  257. package/dist/test-topology/types.d.ts +300 -0
  258. package/dist/test-topology/types.d.ts.map +1 -0
  259. package/dist/test-topology/types.js +7 -0
  260. package/dist/test-topology/types.js.map +1 -0
  261. package/dist/wrappers/clustering/clusterer.d.ts +43 -0
  262. package/dist/wrappers/clustering/clusterer.d.ts.map +1 -0
  263. package/dist/wrappers/clustering/clusterer.js +374 -0
  264. package/dist/wrappers/clustering/clusterer.js.map +1 -0
  265. package/dist/wrappers/clustering/exclusions.d.ts +47 -0
  266. package/dist/wrappers/clustering/exclusions.d.ts.map +1 -0
  267. package/dist/wrappers/clustering/exclusions.js +318 -0
  268. package/dist/wrappers/clustering/exclusions.js.map +1 -0
  269. package/dist/wrappers/clustering/index.d.ts +6 -0
  270. package/dist/wrappers/clustering/index.d.ts.map +1 -0
  271. package/dist/wrappers/clustering/index.js +6 -0
  272. package/dist/wrappers/clustering/index.js.map +1 -0
  273. package/dist/wrappers/detection/detector.d.ts +69 -0
  274. package/dist/wrappers/detection/detector.d.ts.map +1 -0
  275. package/dist/wrappers/detection/detector.js +279 -0
  276. package/dist/wrappers/detection/detector.js.map +1 -0
  277. package/dist/wrappers/detection/index.d.ts +5 -0
  278. package/dist/wrappers/detection/index.d.ts.map +1 -0
  279. package/dist/wrappers/detection/index.js +5 -0
  280. package/dist/wrappers/detection/index.js.map +1 -0
  281. package/dist/wrappers/export/index.d.ts +5 -0
  282. package/dist/wrappers/export/index.d.ts.map +1 -0
  283. package/dist/wrappers/export/index.js +5 -0
  284. package/dist/wrappers/export/index.js.map +1 -0
  285. package/dist/wrappers/export/json.d.ts +127 -0
  286. package/dist/wrappers/export/json.d.ts.map +1 -0
  287. package/dist/wrappers/export/json.js +160 -0
  288. package/dist/wrappers/export/json.js.map +1 -0
  289. package/dist/wrappers/index.d.ts +56 -0
  290. package/dist/wrappers/index.d.ts.map +1 -0
  291. package/dist/wrappers/index.js +159 -0
  292. package/dist/wrappers/index.js.map +1 -0
  293. package/dist/wrappers/integration/adapter.d.ts +52 -0
  294. package/dist/wrappers/integration/adapter.d.ts.map +1 -0
  295. package/dist/wrappers/integration/adapter.js +209 -0
  296. package/dist/wrappers/integration/adapter.js.map +1 -0
  297. package/dist/wrappers/integration/index.d.ts +9 -0
  298. package/dist/wrappers/integration/index.d.ts.map +1 -0
  299. package/dist/wrappers/integration/index.js +12 -0
  300. package/dist/wrappers/integration/index.js.map +1 -0
  301. package/dist/wrappers/integration/pattern-adapter.d.ts +52 -0
  302. package/dist/wrappers/integration/pattern-adapter.d.ts.map +1 -0
  303. package/dist/wrappers/integration/pattern-adapter.js +192 -0
  304. package/dist/wrappers/integration/pattern-adapter.js.map +1 -0
  305. package/dist/wrappers/integration/scanner.d.ts +85 -0
  306. package/dist/wrappers/integration/scanner.d.ts.map +1 -0
  307. package/dist/wrappers/integration/scanner.js +367 -0
  308. package/dist/wrappers/integration/scanner.js.map +1 -0
  309. package/dist/wrappers/primitives/discovery.d.ts +57 -0
  310. package/dist/wrappers/primitives/discovery.d.ts.map +1 -0
  311. package/dist/wrappers/primitives/discovery.js +389 -0
  312. package/dist/wrappers/primitives/discovery.js.map +1 -0
  313. package/dist/wrappers/primitives/index.d.ts +6 -0
  314. package/dist/wrappers/primitives/index.d.ts.map +1 -0
  315. package/dist/wrappers/primitives/index.js +6 -0
  316. package/dist/wrappers/primitives/index.js.map +1 -0
  317. package/dist/wrappers/primitives/registry.d.ts +63 -0
  318. package/dist/wrappers/primitives/registry.d.ts.map +1 -0
  319. package/dist/wrappers/primitives/registry.js +447 -0
  320. package/dist/wrappers/primitives/registry.js.map +1 -0
  321. package/dist/wrappers/types.d.ts +137 -0
  322. package/dist/wrappers/types.d.ts.map +1 -0
  323. package/dist/wrappers/types.js +7 -0
  324. package/dist/wrappers/types.js.map +1 -0
  325. package/package.json +5 -1
@@ -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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AC,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,EAChB,gBAAgB,EAChB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAcpD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAY;IAChD,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAA2B;IACxD,SAAS,CAAC,QAAQ,CAAC,QAAQ,mBAAmB;IAE9C;;OAEG;cACgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAmB3D,SAAS,CAAC,gBAAgB,CACxB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,kBAAkB,EAAE;IAqDvB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAuC1B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAmB1B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAyC7B,SAAS,CAAC,cAAc,CACtB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,eAAe,EAAE;IAuCpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B,SAAS,CAAC,cAAc,CACtB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,gBAAgB,EAAE;IAsErB,SAAS,CAAC,cAAc,CACtB,WA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