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,20 @@
1
+ /**
2
+ * Java Test Extractor
3
+ *
4
+ * Extracts test information from JUnit 4/5, TestNG, and Mockito.
5
+ */
6
+ import type Parser from 'tree-sitter';
7
+ import { BaseTestExtractor } from './base-test-extractor.js';
8
+ import type { TestExtraction, TestCase, MockStatement, SetupBlock, TestFramework } from '../types.js';
9
+ export declare class JavaTestExtractor extends BaseTestExtractor {
10
+ constructor(parser: Parser);
11
+ extract(content: string, filePath: string): TestExtraction;
12
+ detectFramework(root: Parser.SyntaxNode): TestFramework;
13
+ extractTestCases(root: Parser.SyntaxNode): TestCase[];
14
+ extractMocks(root: Parser.SyntaxNode, _framework: TestFramework): MockStatement[];
15
+ extractSetupBlocks(root: Parser.SyntaxNode): SetupBlock[];
16
+ protected findImports(root: Parser.SyntaxNode): string[];
17
+ private extractAssertions;
18
+ }
19
+ export declare function createJavaTestExtractor(parser: Parser): JavaTestExtractor;
20
+ //# sourceMappingURL=java-test-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"java-test-extractor.d.ts","sourceRoot":"","sources":["../../../src/test-topology/extractors/java-test-extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EACV,cAAc,EACd,QAAQ,EACR,aAAa,EACb,UAAU,EAEV,aAAa,EACd,MAAM,aAAa,CAAC;AAkBrB,qBAAa,iBAAkB,SAAQ,iBAAiB;gBAC1C,MAAM,EAAE,MAAM;IAI1B,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc;IA2B1D,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,aAAa;IAuBvD,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,QAAQ,EAAE;IAmErD,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,GAAG,aAAa,EAAE;IAiEjF,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,UAAU,EAAE;IA0CzD,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,EAAE;IAexD,OAAO,CAAC,iBAAiB;CAoC1B;AAMD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAEzE"}
@@ -0,0 +1,275 @@
1
+ /**
2
+ * Java Test Extractor
3
+ *
4
+ * Extracts test information from JUnit 4/5, TestNG, and Mockito.
5
+ */
6
+ import { BaseTestExtractor } from './base-test-extractor.js';
7
+ // ============================================================================
8
+ // Framework Detection
9
+ // ============================================================================
10
+ const FRAMEWORK_IMPORTS = {
11
+ 'org.junit.jupiter': 'junit5',
12
+ 'org.junit.jupiter.api': 'junit5',
13
+ 'org.junit': 'junit4',
14
+ 'org.junit.Test': 'junit4',
15
+ 'org.testng': 'testng',
16
+ };
17
+ // ============================================================================
18
+ // Extractor Implementation
19
+ // ============================================================================
20
+ export class JavaTestExtractor extends BaseTestExtractor {
21
+ constructor(parser) {
22
+ super(parser, 'java');
23
+ }
24
+ extract(content, filePath) {
25
+ const tree = this.parser.parse(content);
26
+ const root = tree.rootNode;
27
+ const framework = this.detectFramework(root);
28
+ const testCases = this.extractTestCases(root);
29
+ const mocks = this.extractMocks(root, framework);
30
+ const setupBlocks = this.extractSetupBlocks(root);
31
+ // Enrich test cases with quality
32
+ for (const test of testCases) {
33
+ const testMocks = mocks.filter(m => m.line >= test.line && m.line <= test.line + 100);
34
+ test.quality = this.calculateQuality(test.assertions, testMocks, test.directCalls);
35
+ }
36
+ return {
37
+ file: filePath,
38
+ framework,
39
+ language: 'java',
40
+ testCases,
41
+ mocks,
42
+ setupBlocks,
43
+ };
44
+ }
45
+ detectFramework(root) {
46
+ const imports = this.findImports(root);
47
+ for (const imp of imports) {
48
+ for (const [pattern, framework] of Object.entries(FRAMEWORK_IMPORTS)) {
49
+ if (imp.startsWith(pattern)) {
50
+ return framework;
51
+ }
52
+ }
53
+ }
54
+ // Check for annotations
55
+ const text = root.text;
56
+ if (text.includes('@Test') && text.includes('org.junit.jupiter')) {
57
+ return 'junit5';
58
+ }
59
+ if (text.includes('@Test')) {
60
+ return 'junit4';
61
+ }
62
+ return 'unknown';
63
+ }
64
+ extractTestCases(root) {
65
+ const testCases = [];
66
+ let currentClass;
67
+ this.walkNode(root, (node) => {
68
+ // Track class context
69
+ if (node.type === 'class_declaration') {
70
+ const nameNode = node.childForFieldName('name');
71
+ if (nameNode) {
72
+ currentClass = nameNode.text;
73
+ }
74
+ }
75
+ // Find @Test annotated methods
76
+ if (node.type === 'method_declaration') {
77
+ const modifiers = node.childForFieldName('modifiers');
78
+ const nameNode = node.childForFieldName('name');
79
+ const bodyNode = node.childForFieldName('body');
80
+ if (modifiers && nameNode && bodyNode) {
81
+ // Check for @Test annotation
82
+ let hasTestAnnotation = false;
83
+ this.walkNode(modifiers, (child) => {
84
+ if (child.type === 'marker_annotation' || child.type === 'annotation') {
85
+ const annotationName = child.text;
86
+ if (annotationName.includes('Test')) {
87
+ hasTestAnnotation = true;
88
+ }
89
+ }
90
+ });
91
+ if (hasTestAnnotation) {
92
+ const name = nameNode.text;
93
+ const qualifiedName = currentClass
94
+ ? `${currentClass}.${name}`
95
+ : name;
96
+ const directCalls = this.extractFunctionCalls(bodyNode);
97
+ const assertions = this.extractAssertions(bodyNode);
98
+ testCases.push({
99
+ id: this.generateTestId('', name, node.startPosition.row),
100
+ name,
101
+ parentBlock: currentClass,
102
+ qualifiedName,
103
+ file: '',
104
+ line: node.startPosition.row + 1,
105
+ directCalls,
106
+ transitiveCalls: [],
107
+ assertions,
108
+ quality: {
109
+ assertionCount: assertions.length,
110
+ hasErrorCases: false,
111
+ hasEdgeCases: false,
112
+ mockRatio: 0,
113
+ setupRatio: 0,
114
+ score: 50,
115
+ },
116
+ });
117
+ }
118
+ }
119
+ }
120
+ });
121
+ return testCases;
122
+ }
123
+ extractMocks(root, _framework) {
124
+ const mocks = [];
125
+ this.walkNode(root, (node) => {
126
+ // @Mock annotation on fields
127
+ if (node.type === 'field_declaration') {
128
+ const modifiers = node.childForFieldName('modifiers');
129
+ if (modifiers) {
130
+ let mockAnnotation = null;
131
+ this.walkNode(modifiers, (child) => {
132
+ if (child.type === 'marker_annotation' || child.type === 'annotation') {
133
+ const text = child.text;
134
+ if (text.includes('@Mock'))
135
+ mockAnnotation = '@Mock';
136
+ else if (text.includes('@MockBean'))
137
+ mockAnnotation = '@MockBean';
138
+ else if (text.includes('@Spy'))
139
+ mockAnnotation = '@Spy';
140
+ else if (text.includes('@InjectMocks'))
141
+ mockAnnotation = '@InjectMocks';
142
+ }
143
+ });
144
+ if (mockAnnotation) {
145
+ const declarator = node.namedChildren.find(c => c.type === 'variable_declarator');
146
+ const typeNode = node.childForFieldName('type');
147
+ if (declarator && typeNode) {
148
+ const fieldName = declarator.childForFieldName('name')?.text ?? 'unknown';
149
+ const fieldType = typeNode.text;
150
+ mocks.push({
151
+ target: `${fieldType}.${fieldName}`,
152
+ mockType: mockAnnotation,
153
+ line: node.startPosition.row + 1,
154
+ isExternal: false,
155
+ });
156
+ }
157
+ }
158
+ }
159
+ }
160
+ // Mockito.mock() calls
161
+ if (node.type === 'method_invocation') {
162
+ const objNode = node.childForFieldName('object');
163
+ const nameNode = node.childForFieldName('name');
164
+ if (objNode?.text === 'Mockito' && nameNode) {
165
+ const method = nameNode.text;
166
+ if (method === 'mock' || method === 'spy') {
167
+ const argsNode = node.childForFieldName('arguments');
168
+ const targetNode = argsNode?.namedChild(0);
169
+ mocks.push({
170
+ target: targetNode?.text ?? 'unknown',
171
+ mockType: `Mockito.${method}`,
172
+ line: node.startPosition.row + 1,
173
+ isExternal: false,
174
+ });
175
+ }
176
+ }
177
+ }
178
+ });
179
+ return mocks;
180
+ }
181
+ extractSetupBlocks(root) {
182
+ const blocks = [];
183
+ this.walkNode(root, (node) => {
184
+ if (node.type === 'method_declaration') {
185
+ const modifiers = node.childForFieldName('modifiers');
186
+ const bodyNode = node.childForFieldName('body');
187
+ if (modifiers && bodyNode) {
188
+ let setupType = null;
189
+ this.walkNode(modifiers, (child) => {
190
+ if (child.type === 'marker_annotation' || child.type === 'annotation') {
191
+ const text = child.text;
192
+ // JUnit 5
193
+ if (text.includes('@BeforeEach'))
194
+ setupType = 'beforeEach';
195
+ else if (text.includes('@AfterEach'))
196
+ setupType = 'afterEach';
197
+ else if (text.includes('@BeforeAll'))
198
+ setupType = 'beforeAll';
199
+ else if (text.includes('@AfterAll'))
200
+ setupType = 'afterAll';
201
+ // JUnit 4
202
+ else if (text.includes('@Before'))
203
+ setupType = 'beforeEach';
204
+ else if (text.includes('@After'))
205
+ setupType = 'afterEach';
206
+ else if (text.includes('@BeforeClass'))
207
+ setupType = 'beforeAll';
208
+ else if (text.includes('@AfterClass'))
209
+ setupType = 'afterAll';
210
+ }
211
+ });
212
+ if (setupType) {
213
+ const calls = this.extractFunctionCalls(bodyNode);
214
+ blocks.push({
215
+ type: setupType,
216
+ line: node.startPosition.row + 1,
217
+ calls,
218
+ });
219
+ }
220
+ }
221
+ }
222
+ });
223
+ return blocks;
224
+ }
225
+ findImports(root) {
226
+ const imports = [];
227
+ this.walkNode(root, (node) => {
228
+ if (node.type === 'import_declaration') {
229
+ const pathNode = node.namedChild(0);
230
+ if (pathNode) {
231
+ imports.push(pathNode.text);
232
+ }
233
+ }
234
+ });
235
+ return imports;
236
+ }
237
+ extractAssertions(node) {
238
+ const assertions = [];
239
+ this.walkNode(node, (child) => {
240
+ if (child.type === 'method_invocation') {
241
+ const nameNode = child.childForFieldName('name');
242
+ if (nameNode) {
243
+ const name = nameNode.text;
244
+ // JUnit assertions
245
+ if (name.startsWith('assert') || name === 'fail') {
246
+ assertions.push({
247
+ matcher: name,
248
+ line: child.startPosition.row + 1,
249
+ isErrorAssertion: name === 'assertThrows' || name === 'assertDoesNotThrow',
250
+ isEdgeCaseAssertion: name === 'assertNull' || name === 'assertNotNull' ||
251
+ name === 'assertTrue' || name === 'assertFalse',
252
+ });
253
+ }
254
+ // Mockito verify
255
+ if (name === 'verify') {
256
+ assertions.push({
257
+ matcher: 'verify',
258
+ line: child.startPosition.row + 1,
259
+ isErrorAssertion: false,
260
+ isEdgeCaseAssertion: false,
261
+ });
262
+ }
263
+ }
264
+ }
265
+ });
266
+ return assertions;
267
+ }
268
+ }
269
+ // ============================================================================
270
+ // Factory
271
+ // ============================================================================
272
+ export function createJavaTestExtractor(parser) {
273
+ return new JavaTestExtractor(parser);
274
+ }
275
+ //# sourceMappingURL=java-test-extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"java-test-extractor.js","sourceRoot":"","sources":["../../../src/test-topology/extractors/java-test-extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAU7D,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,MAAM,iBAAiB,GAAkC;IACvD,mBAAmB,EAAE,QAAQ;IAC7B,uBAAuB,EAAE,QAAQ;IACjC,WAAW,EAAE,QAAQ;IACrB,gBAAgB,EAAE,QAAQ;IAC1B,YAAY,EAAE,QAAQ;CACvB,CAAC;AAEF,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACtD,YAAY,MAAc;QACxB,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,CAAC,OAAe,EAAE,QAAgB;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACxC,MA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AAmB;oBACnB,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;wBACjD,UAAU,CAAC,IAAI,CAAC;4BACd,OAAO,EAAE,IAAI;4BACb,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,GAAG,CAAC;4BACjC,gBAAgB,EAAE,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,oBAAoB;4BAC1E,mBAAmB,EAAE,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,eAAe;gCAClD,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,aAAa;yBACpE,CAAC,CAAC;oBACL,CAAC;oBAED,iBAAiB;oBACjB,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;wBACtB,UAAU,CAAC,IAAI,CAAC;4BACd,OAAO,EAAE,QAAQ;4BACjB,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,GAAG,CAAC;4BACjC,gBAAgB,EAAE,KAAK;4BACvB,mBAAmB,EAAE,KAAK;yBAC3B,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * PHP Test Extractor
3
+ *
4
+ * Extracts test information from PHPUnit, Pest, and Codeception.
5
+ */
6
+ import type Parser from 'tree-sitter';
7
+ import { BaseTestExtractor } from './base-test-extractor.js';
8
+ import type { TestExtraction, TestCase, MockStatement, SetupBlock, TestFramework } from '../types.js';
9
+ export declare class PHPTestExtractor extends BaseTestExtractor {
10
+ constructor(parser: Parser);
11
+ extract(content: string, filePath: string): TestExtraction;
12
+ detectFramework(root: Parser.SyntaxNode): TestFramework;
13
+ extractTestCases(root: Parser.SyntaxNode): TestCase[];
14
+ extractMocks(root: Parser.SyntaxNode, _framework: TestFramework): MockStatement[];
15
+ extractSetupBlocks(root: Parser.SyntaxNode): SetupBlock[];
16
+ protected findImports(root: Parser.SyntaxNode): string[];
17
+ private hasTestAnnotation;
18
+ private extractAssertions;
19
+ private extractStringValue;
20
+ private extractClassReference;
21
+ private isExternalPHPClass;
22
+ }
23
+ export declare function createPHPTestExtractor(parser: Parser): PHPTestExtractor;
24
+ //# sourceMappingURL=php-test-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"php-test-extractor.d.ts","sourceRoot":"","sources":["../../../src/test-topology/extractors/php-test-extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EACV,cAAc,EACd,QAAQ,EACR,aAAa,EACb,UAAU,EAEV,aAAa,EACd,MAAM,aAAa,CAAC;AAiBrB,qBAAa,gBAAiB,SAAQ,iBAAiB;gBACzC,MAAM,EAAE,MAAM;IAI1B,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc;IA2B1D,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,aAAa;IAiCvD,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,QAAQ,EAAE;IAqGrD,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,GAAG,aAAa,EAAE;IAkFjF,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,UAAU,EAAE;IA2DzD,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,EAAE;IAiBxD,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,iBAAiB;IA2DzB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,qBAAqB;IAkB7B,OAAO,CAAC,kBAAkB;CAU3B;AAMD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAEvE"}