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,370 @@
1
+ /**
2
+ * Java Test Regex Extractor
3
+ *
4
+ * Regex-based fallback for extracting test information when tree-sitter is unavailable.
5
+ * Supports JUnit 4/5, TestNG, and Mockito.
6
+ */
7
+ // ============================================================================
8
+ // Extractor
9
+ // ============================================================================
10
+ export class JavaTestRegexExtractor {
11
+ language = 'java';
12
+ extensions = ['.java'];
13
+ /**
14
+ * Extract test information using regex patterns
15
+ */
16
+ extract(content, filePath) {
17
+ const framework = this.detectFramework(content);
18
+ const testCases = this.extractTestCases(content, filePath);
19
+ const mocks = this.extractMocks(content);
20
+ const setupBlocks = this.extractSetupBlocks(content);
21
+ // Enrich test cases with quality
22
+ for (const test of testCases) {
23
+ const testMocks = mocks.filter(m => m.line >= test.line && m.line <= test.line + 100);
24
+ test.quality = this.calculateQuality(test.assertions, testMocks, test.directCalls);
25
+ }
26
+ return {
27
+ file: filePath,
28
+ framework,
29
+ language: 'java',
30
+ testCases,
31
+ mocks,
32
+ setupBlocks,
33
+ };
34
+ }
35
+ /**
36
+ * Detect test framework
37
+ */
38
+ detectFramework(content) {
39
+ // Check imports
40
+ if (/import\s+org\.junit\.jupiter/.test(content))
41
+ return 'junit5';
42
+ if (/import\s+org\.junit\./.test(content))
43
+ return 'junit4';
44
+ if (/import\s+org\.testng\./.test(content))
45
+ return 'testng';
46
+ // Check annotations
47
+ if (/@Test/.test(content)) {
48
+ if (/org\.junit\.jupiter/.test(content))
49
+ return 'junit5';
50
+ return 'junit4';
51
+ }
52
+ return 'unknown';
53
+ }
54
+ /**
55
+ * Extract test cases
56
+ */
57
+ extractTestCases(content, filePath) {
58
+ const testCases = [];
59
+ const lines = content.split('\n');
60
+ // Track current class
61
+ let currentClass;
62
+ for (let i = 0; i < lines.length; i++) {
63
+ const line = lines[i];
64
+ const lineNum = i + 1;
65
+ // Check for class definition
66
+ const classMatch = line.match(/class\s+(\w+)/);
67
+ if (classMatch) {
68
+ currentClass = classMatch[1];
69
+ continue;
70
+ }
71
+ // Check for @Test annotation
72
+ if (/@Test/.test(line)) {
73
+ // Find the method on this or next lines
74
+ let methodLine = i;
75
+ let methodMatch = null;
76
+ for (let j = i; j < Math.min(i + 5, lines.length); j++) {
77
+ methodMatch = lines[j].match(/(?:public|private|protected)?\s*(?:void|[A-Z]\w*)\s+(\w+)\s*\(/);
78
+ if (methodMatch) {
79
+ methodLine = j;
80
+ break;
81
+ }
82
+ }
83
+ if (methodMatch) {
84
+ const testName = methodMatch[1];
85
+ const qualifiedName = currentClass
86
+ ? `${currentClass}.${testName}`
87
+ : testName;
88
+ // Extract test body
89
+ const testBody = this.extractMethodBody(lines, methodLine);
90
+ const directCalls = this.extractFunctionCalls(testBody);
91
+ const assertions = this.extractAssertions(testBody, lineNum);
92
+ testCases.push({
93
+ id: `${filePath}:${testName}:${lineNum}`,
94
+ name: testName,
95
+ parentBlock: currentClass,
96
+ qualifiedName,
97
+ file: filePath,
98
+ line: lineNum,
99
+ directCalls,
100
+ transitiveCalls: [],
101
+ assertions,
102
+ quality: {
103
+ assertionCount: assertions.length,
104
+ hasErrorCases: false,
105
+ hasEdgeCases: false,
106
+ mockRatio: 0,
107
+ setupRatio: 0,
108
+ score: 50,
109
+ },
110
+ });
111
+ }
112
+ }
113
+ }
114
+ return testCases;
115
+ }
116
+ /**
117
+ * Extract method body based on braces
118
+ */
119
+ extractMethodBody(lines, startIndex) {
120
+ const bodyLines = [];
121
+ let braceCount = 0;
122
+ let started = false;
123
+ for (let i = startIndex; i < Math.min(startIndex + 200, lines.length); i++) {
124
+ const line = lines[i];
125
+ for (const char of line) {
126
+ if (char === '{') {
127
+ braceCount++;
128
+ started = true;
129
+ }
130
+ else if (char === '}') {
131
+ braceCount--;
132
+ }
133
+ }
134
+ bodyLines.push(line);
135
+ if (started && braceCount <= 0) {
136
+ break;
137
+ }
138
+ }
139
+ return bodyLines.join('\n');
140
+ }
141
+ /**
142
+ * Extract function calls from test body
143
+ */
144
+ extractFunctionCalls(body) {
145
+ const calls = [];
146
+ const seen = new Set();
147
+ // Pattern for method calls
148
+ const callPattern = /\b([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/g;
149
+ let match;
150
+ while ((match = callPattern.exec(body)) !== null) {
151
+ const name = match[1];
152
+ if (this.isTestFrameworkCall(name))
153
+ continue;
154
+ if (!seen.has(name)) {
155
+ seen.add(name);
156
+ calls.push(name);
157
+ }
158
+ }
159
+ return calls;
160
+ }
161
+ /**
162
+ * Extract assertions
163
+ */
164
+ extractAssertions(body, baseLineNum) {
165
+ const assertions = [];
166
+ const lines = body.split('\n');
167
+ for (let i = 0; i < lines.length; i++) {
168
+ const line = lines[i];
169
+ const lineNum = baseLineNum + i;
170
+ // JUnit assertions: assert*, fail
171
+ const assertMatch = line.match(/\b(assert\w+|fail)\s*\(/);
172
+ if (assertMatch) {
173
+ const matcher = assertMatch[1];
174
+ assertions.push({
175
+ matcher,
176
+ line: lineNum,
177
+ isErrorAssertion: matcher === 'assertThrows' || matcher === 'assertDoesNotThrow',
178
+ isEdgeCaseAssertion: matcher === 'assertNull' || matcher === 'assertNotNull' ||
179
+ matcher === 'assertTrue' || matcher === 'assertFalse',
180
+ });
181
+ }
182
+ // Mockito verify
183
+ if (/\bverify\s*\(/.test(line)) {
184
+ assertions.push({
185
+ matcher: 'verify',
186
+ line: lineNum,
187
+ isErrorAssertion: false,
188
+ isEdgeCaseAssertion: false,
189
+ });
190
+ }
191
+ }
192
+ return assertions;
193
+ }
194
+ /**
195
+ * Extract mock statements
196
+ */
197
+ extractMocks(content) {
198
+ const mocks = [];
199
+ const lines = content.split('\n');
200
+ for (let i = 0; i < lines.length; i++) {
201
+ const line = lines[i];
202
+ const lineNum = i + 1;
203
+ // @Mock annotation
204
+ if (/@Mock\b/.test(line)) {
205
+ // Get field from next line
206
+ const nextLine = lines[i + 1];
207
+ if (nextLine) {
208
+ const fieldMatch = nextLine.match(/(\w+)\s+(\w+)\s*;/);
209
+ if (fieldMatch) {
210
+ mocks.push({
211
+ target: `${fieldMatch[1]}.${fieldMatch[2]}`,
212
+ mockType: '@Mock',
213
+ line: lineNum,
214
+ isExternal: false,
215
+ });
216
+ }
217
+ }
218
+ }
219
+ // @MockBean annotation (Spring)
220
+ if (/@MockBean\b/.test(line)) {
221
+ const nextLine = lines[i + 1];
222
+ if (nextLine) {
223
+ const fieldMatch = nextLine.match(/(\w+)\s+(\w+)\s*;/);
224
+ if (fieldMatch) {
225
+ mocks.push({
226
+ target: `${fieldMatch[1]}.${fieldMatch[2]}`,
227
+ mockType: '@MockBean',
228
+ line: lineNum,
229
+ isExternal: false,
230
+ });
231
+ }
232
+ }
233
+ }
234
+ // @Spy annotation
235
+ if (/@Spy\b/.test(line)) {
236
+ const nextLine = lines[i + 1];
237
+ if (nextLine) {
238
+ const fieldMatch = nextLine.match(/(\w+)\s+(\w+)\s*;/);
239
+ if (fieldMatch) {
240
+ mocks.push({
241
+ target: `${fieldMatch[1]}.${fieldMatch[2]}`,
242
+ mockType: '@Spy',
243
+ line: lineNum,
244
+ isExternal: false,
245
+ });
246
+ }
247
+ }
248
+ }
249
+ // Mockito.mock() calls
250
+ const mockCallMatch = line.match(/Mockito\.mock\s*\(\s*(\w+)\.class\s*\)/);
251
+ if (mockCallMatch) {
252
+ mocks.push({
253
+ target: mockCallMatch[1],
254
+ mockType: 'Mockito.mock',
255
+ line: lineNum,
256
+ isExternal: false,
257
+ });
258
+ }
259
+ // Mockito.spy() calls
260
+ const spyCallMatch = line.match(/Mockito\.spy\s*\(\s*(\w+)/);
261
+ if (spyCallMatch) {
262
+ mocks.push({
263
+ target: spyCallMatch[1],
264
+ mockType: 'Mockito.spy',
265
+ line: lineNum,
266
+ isExternal: false,
267
+ });
268
+ }
269
+ // mock() static import
270
+ const staticMockMatch = line.match(/\bmock\s*\(\s*(\w+)\.class\s*\)/);
271
+ if (staticMockMatch && !line.includes('Mockito.')) {
272
+ mocks.push({
273
+ target: staticMockMatch[1],
274
+ mockType: 'mock',
275
+ line: lineNum,
276
+ isExternal: false,
277
+ });
278
+ }
279
+ }
280
+ return mocks;
281
+ }
282
+ /**
283
+ * Extract setup blocks
284
+ */
285
+ extractSetupBlocks(content) {
286
+ const blocks = [];
287
+ const lines = content.split('\n');
288
+ const setupAnnotations = {
289
+ '@BeforeEach': 'beforeEach',
290
+ '@AfterEach': 'afterEach',
291
+ '@BeforeAll': 'beforeAll',
292
+ '@AfterAll': 'afterAll',
293
+ '@Before': 'beforeEach', // JUnit 4
294
+ '@After': 'afterEach', // JUnit 4
295
+ '@BeforeClass': 'beforeAll', // JUnit 4
296
+ '@AfterClass': 'afterAll', // JUnit 4
297
+ };
298
+ for (let i = 0; i < lines.length; i++) {
299
+ const line = lines[i];
300
+ const lineNum = i + 1;
301
+ for (const [annotation, type] of Object.entries(setupAnnotations)) {
302
+ if (line.includes(annotation)) {
303
+ // Find the method body
304
+ let methodLine = i;
305
+ for (let j = i; j < Math.min(i + 5, lines.length); j++) {
306
+ if (/(?:public|private|protected)?\s*(?:void|static\s+void)\s+\w+\s*\(/.test(lines[j])) {
307
+ methodLine = j;
308
+ break;
309
+ }
310
+ }
311
+ const body = this.extractMethodBody(lines, methodLine);
312
+ const calls = this.extractFunctionCalls(body);
313
+ blocks.push({
314
+ type,
315
+ line: lineNum,
316
+ calls,
317
+ });
318
+ break;
319
+ }
320
+ }
321
+ }
322
+ return blocks;
323
+ }
324
+ isTestFrameworkCall(name) {
325
+ const frameworkCalls = [
326
+ 'assertEquals', 'assertTrue', 'assertFalse', 'assertNull', 'assertNotNull',
327
+ 'assertThrows', 'assertDoesNotThrow', 'assertArrayEquals', 'assertSame',
328
+ 'assertNotSame', 'assertAll', 'fail', 'verify', 'when', 'given', 'then',
329
+ 'mock', 'spy', 'doReturn', 'doThrow', 'doNothing', 'doAnswer',
330
+ ];
331
+ return frameworkCalls.includes(name);
332
+ }
333
+ calculateQuality(assertions, mocks, directCalls) {
334
+ const assertionCount = assertions.length;
335
+ const hasErrorCases = assertions.some(a => a.isErrorAssertion);
336
+ const hasEdgeCases = assertions.some(a => a.isEdgeCaseAssertion);
337
+ const totalCalls = mocks.length + directCalls.length;
338
+ const mockRatio = totalCalls > 0 ? mocks.length / totalCalls : 0;
339
+ let score = 50;
340
+ if (assertionCount >= 1)
341
+ score += 10;
342
+ if (assertionCount >= 3)
343
+ score += 10;
344
+ if (hasErrorCases)
345
+ score += 15;
346
+ if (hasEdgeCases)
347
+ score += 10;
348
+ if (mockRatio > 0.7)
349
+ score -= 15;
350
+ else if (mockRatio > 0.5)
351
+ score -= 5;
352
+ if (assertionCount === 0)
353
+ score -= 20;
354
+ return {
355
+ assertionCount,
356
+ hasErrorCases,
357
+ hasEdgeCases,
358
+ mockRatio: Math.round(mockRatio * 100) / 100,
359
+ setupRatio: 0,
360
+ score: Math.max(0, Math.min(100, score)),
361
+ };
362
+ }
363
+ }
364
+ /**
365
+ * Factory function
366
+ */
367
+ export function createJavaTestRegexExtractor() {
368
+ return new JavaTestRegexExtractor();
369
+ }
370
+ //# sourceMappingURL=java-test-regex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"java-test-regex.js","sourceRoot":"","sources":["../../../../src/test-topology/extractors/regex/java-test-regex.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,OAAO,sBAAsB;IACxB,QAAQ,GAAG,MAAe,CAAC;IAC3B,UAAU,GAAG,CAAC,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,OAAO,CAAC,OAAe,EAAE,QAAgB;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC3D,MAAM,KAAK,GAAG,IAAI,CA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E,CAAC;QACf,IAAI,cAAc,IAAI,CAAC;YAAE,KAAK,IAAI,EAAE,CAAC;QACrC,IAAI,cAAc,IAAI,CAAC;YAAE,KAAK,IAAI,EAAE,CAAC;QACrC,IAAI,aAAa;YAAE,KAAK,IAAI,EAAE,CAAC;QAC/B,IAAI,YAAY;YAAE,KAAK,IAAI,EAAE,CAAC;QAC9B,IAAI,SAAS,GAAG,GAAG;YAAE,KAAK,IAAI,EAAE,CAAC;aAC5B,IAAI,SAAS,GAAG,GAAG;YAAE,KAAK,IAAI,CAAC,CAAC;QACrC,IAAI,cAAc,KAAK,CAAC;YAAE,KAAK,IAAI,EAAE,CAAC;QAEtC,OAAO;YACL,cAAc;YACd,aAAa;YACb,YAAY;YACZ,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,GAAG;YAC5C,UAAU,EAAE,CAAC;YACb,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SACzC,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B;IAC1C,OAAO,IAAI,sBAAsB,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * PHP Test Regex Extractor
3
+ *
4
+ * Regex-based fallback for extracting test information when tree-sitter is unavailable.
5
+ * Supports PHPUnit, Pest, and Codeception.
6
+ */
7
+ import type { TestExtraction, TestCase, MockStatement, SetupBlock, TestFramework } from '../../types.js';
8
+ export declare class PHPTestRegexExtractor {
9
+ readonly language: "php";
10
+ readonly extensions: string[];
11
+ /**
12
+ * Extract test information using regex patterns
13
+ */
14
+ extract(content: string, filePath: string): TestExtraction;
15
+ /**
16
+ * Detect test framework
17
+ */
18
+ detectFramework(content: string): TestFramework;
19
+ /**
20
+ * Extract test cases
21
+ */
22
+ extractTestCases(content: string, filePath: string, framework: TestFramework): TestCase[];
23
+ /**
24
+ * Extract method body based on braces
25
+ */
26
+ private extractMethodBody;
27
+ /**
28
+ * Extract Pest test body (closure-based)
29
+ */
30
+ private extractPestBody;
31
+ /**
32
+ * Extract function calls from test body
33
+ */
34
+ private extractFunctionCalls;
35
+ /**
36
+ * Extract assertions
37
+ */
38
+ private extractAssertions;
39
+ /**
40
+ * Extract mock statements
41
+ */
42
+ extractMocks(content: string): MockStatement[];
43
+ /**
44
+ * Extract setup blocks
45
+ */
46
+ extractSetupBlocks(content: string, framework: TestFramework): SetupBlock[];
47
+ private extractClassReference;
48
+ private isTestFrameworkCall;
49
+ private isExternalPHPClass;
50
+ private calculateQuality;
51
+ }
52
+ /**
53
+ * Factory function
54
+ */
55
+ export declare function createPHPTestRegexExtractor(): PHPTestRegexExtractor;
56
+ //# sourceMappingURL=php-test-regex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"php-test-regex.d.ts","sourceRoot":"","sources":["../../../../src/test-topology/extractors/regex/php-test-regex.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,QAAQ,EACR,aAAa,EACb,UAAU,EAGV,aAAa,EACd,MAAM,gBAAgB,CAAC;AAMxB,qBAAa,qBAAqB;IAChC,QAAQ,CAAC,QAAQ,EAAG,KAAK,CAAU;IACnC,QAAQ,CAAC,UAAU,WAAY;IAE/B;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc;IAwB1D;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa;IAwB/C;;OAEG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,QAAQ,EAAE;IAuGzF;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA2BzB;;OAEG;IACH,OAAO,CAAC,eAAe;IA2BvB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA+B5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAiDzB;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE;IAgG9C;;OAEG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,UAAU,EAAE;IAgE3E,OAAO,CAAC,qBAAqB;IAkB7B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,gBAAgB;CA8BzB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,qBAAqB,CAEnE"}