driftdetect-core 0.4.5 → 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 (578) hide show
  1. package/LICENSE +21 -0
  2. package/dist/boundaries/boundary-scanner.d.ts.map +1 -1
  3. package/dist/boundaries/boundary-scanner.js +184 -18
  4. package/dist/boundaries/boundary-scanner.js.map +1 -1
  5. package/dist/boundaries/types.d.ts +34 -2
  6. package/dist/boundaries/types.d.ts.map +1 -1
  7. package/dist/call-graph/analysis/graph-builder.d.ts +3 -0
  8. package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -1
  9. package/dist/call-graph/analysis/graph-builder.js +81 -18
  10. package/dist/call-graph/analysis/graph-builder.js.map +1 -1
  11. package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts +8 -0
  12. package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts.map +1 -1
  13. package/dist/call-graph/extractors/csharp-data-access-extractor.js +18 -5
  14. package/dist/call-graph/extractors/csharp-data-access-extractor.js.map +1 -1
  15. package/dist/call-graph/extractors/csharp-extractor.d.ts +35 -0
  16. package/dist/call-graph/extractors/csharp-extractor.d.ts.map +1 -1
  17. package/dist/call-graph/extractors/csharp-extractor.js +362 -4
  18. package/dist/call-graph/extractors/csharp-extractor.js.map +1 -1
  19. package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts +37 -0
  20. package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts.map +1 -0
  21. package/dist/call-graph/extractors/csharp-hybrid-extractor.js +408 -0
  22. package/dist/call-graph/extractors/csharp-hybrid-extractor.js.map +1 -0
  23. package/dist/call-graph/extractors/data-access-extractor.d.ts +16 -2
  24. package/dist/call-graph/extractors/data-access-extractor.d.ts.map +1 -1
  25. package/dist/call-graph/extractors/data-access-extractor.js +114 -5
  26. package/dist/call-graph/extractors/data-access-extractor.js.map +1 -1
  27. package/dist/call-graph/extractors/hybrid-extractor-base.d.ts +102 -0
  28. package/dist/call-graph/extractors/hybrid-extractor-base.d.ts.map +1 -0
  29. package/dist/call-graph/extractors/hybrid-extractor-base.js +289 -0
  30. package/dist/call-graph/extractors/hybrid-extractor-base.js.map +1 -0
  31. package/dist/call-graph/extractors/index.d.ts +17 -13
  32. package/dist/call-graph/extractors/index.d.ts.map +1 -1
  33. package/dist/call-graph/extractors/index.js +24 -23
  34. package/dist/call-graph/extractors/index.js.map +1 -1
  35. package/dist/call-graph/extractors/java-data-access-extractor.d.ts +8 -0
  36. package/dist/call-graph/extractors/java-data-access-extractor.d.ts.map +1 -1
  37. package/dist/call-graph/extractors/java-data-access-extractor.js +20 -6
  38. package/dist/call-graph/extractors/java-data-access-extractor.js.map +1 -1
  39. package/dist/call-graph/extractors/java-extractor.d.ts +15 -0
  40. package/dist/call-graph/extractors/java-extractor.d.ts.map +1 -1
  41. package/dist/call-graph/extractors/java-extractor.js +120 -4
  42. package/dist/call-graph/extractors/java-extractor.js.map +1 -1
  43. package/dist/call-graph/extractors/java-hybrid-extractor.d.ts +36 -0
  44. package/dist/call-graph/extractors/java-hybrid-extractor.d.ts.map +1 -0
  45. package/dist/call-graph/extractors/java-hybrid-extractor.js +426 -0
  46. package/dist/call-graph/extractors/java-hybrid-extractor.js.map +1 -0
  47. package/dist/call-graph/extractors/php-data-access-extractor.d.ts +8 -0
  48. package/dist/call-graph/extractors/php-data-access-extractor.d.ts.map +1 -1
  49. package/dist/call-graph/extractors/php-data-access-extractor.js +20 -6
  50. package/dist/call-graph/extractors/php-data-access-extractor.js.map +1 -1
  51. package/dist/call-graph/extractors/php-extractor.d.ts +48 -1
  52. package/dist/call-graph/extractors/php-extractor.d.ts.map +1 -1
  53. package/dist/call-graph/extractors/php-extractor.js +460 -6
  54. package/dist/call-graph/extractors/php-extractor.js.map +1 -1
  55. package/dist/call-graph/extractors/php-hybrid-extractor.d.ts +35 -0
  56. package/dist/call-graph/extractors/php-hybrid-extractor.d.ts.map +1 -0
  57. package/dist/call-graph/extractors/php-hybrid-extractor.js +393 -0
  58. package/dist/call-graph/extractors/php-hybrid-extractor.js.map +1 -0
  59. package/dist/call-graph/extractors/python-data-access-extractor.d.ts +8 -0
  60. package/dist/call-graph/extractors/python-data-access-extractor.d.ts.map +1 -1
  61. package/dist/call-graph/extractors/python-data-access-extractor.js +20 -6
  62. package/dist/call-graph/extractors/python-data-access-extractor.js.map +1 -1
  63. package/dist/call-graph/extractors/python-hybrid-extractor.d.ts +85 -0
  64. package/dist/call-graph/extractors/python-hybrid-extractor.d.ts.map +1 -0
  65. package/dist/call-graph/extractors/python-hybrid-extractor.js +462 -0
  66. package/dist/call-graph/extractors/python-hybrid-extractor.js.map +1 -0
  67. package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts +154 -0
  68. package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts.map +1 -0
  69. package/dist/call-graph/extractors/regex/base-regex-extractor.js +346 -0
  70. package/dist/call-graph/extractors/regex/base-regex-extractor.js.map +1 -0
  71. package/dist/call-graph/extractors/regex/csharp-regex.d.ts +34 -0
  72. package/dist/call-graph/extractors/regex/csharp-regex.d.ts.map +1 -0
  73. package/dist/call-graph/extractors/regex/csharp-regex.js +393 -0
  74. package/dist/call-graph/extractors/regex/csharp-regex.js.map +1 -0
  75. package/dist/call-graph/extractors/regex/index.d.ts +25 -0
  76. package/dist/call-graph/extractors/regex/index.d.ts.map +1 -0
  77. package/dist/call-graph/extractors/regex/index.js +66 -0
  78. package/dist/call-graph/extractors/regex/index.js.map +1 -0
  79. package/dist/call-graph/extractors/regex/java-regex.d.ts +34 -0
  80. package/dist/call-graph/extractors/regex/java-regex.d.ts.map +1 -0
  81. package/dist/call-graph/extractors/regex/java-regex.js +327 -0
  82. package/dist/call-graph/extractors/regex/java-regex.js.map +1 -0
  83. package/dist/call-graph/extractors/regex/php-regex.d.ts +30 -0
  84. package/dist/call-graph/extractors/regex/php-regex.d.ts.map +1 -0
  85. package/dist/call-graph/extractors/regex/php-regex.js +333 -0
  86. package/dist/call-graph/extractors/regex/php-regex.js.map +1 -0
  87. package/dist/call-graph/extractors/regex/python-regex.d.ts +46 -0
  88. package/dist/call-graph/extractors/regex/python-regex.d.ts.map +1 -0
  89. package/dist/call-graph/extractors/regex/python-regex.js +380 -0
  90. package/dist/call-graph/extractors/regex/python-regex.js.map +1 -0
  91. package/dist/call-graph/extractors/regex/typescript-regex.d.ts +27 -0
  92. package/dist/call-graph/extractors/regex/typescript-regex.d.ts.map +1 -0
  93. package/dist/call-graph/extractors/regex/typescript-regex.js +349 -0
  94. package/dist/call-graph/extractors/regex/typescript-regex.js.map +1 -0
  95. package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts +11 -0
  96. package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts.map +1 -1
  97. package/dist/call-graph/extractors/semantic-data-access-scanner.js +53 -2
  98. package/dist/call-graph/extractors/semantic-data-access-scanner.js.map +1 -1
  99. package/dist/call-graph/extractors/types.d.ts +111 -0
  100. package/dist/call-graph/extractors/types.d.ts.map +1 -0
  101. package/dist/call-graph/extractors/types.js +68 -0
  102. package/dist/call-graph/extractors/types.js.map +1 -0
  103. package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts +8 -0
  104. package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts.map +1 -1
  105. package/dist/call-graph/extractors/typescript-data-access-extractor.js +31 -10
  106. package/dist/call-graph/extractors/typescript-data-access-extractor.js.map +1 -1
  107. package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts +116 -0
  108. package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts.map +1 -0
  109. package/dist/call-graph/extractors/typescript-hybrid-extractor.js +635 -0
  110. package/dist/call-graph/extractors/typescript-hybrid-extractor.js.map +1 -0
  111. package/dist/call-graph/index.d.ts +2 -4
  112. package/dist/call-graph/index.d.ts.map +1 -1
  113. package/dist/call-graph/index.js +5 -6
  114. package/dist/call-graph/index.js.map +1 -1
  115. package/dist/error-handling/error-handling-analyzer.d.ts +73 -0
  116. package/dist/error-handling/error-handling-analyzer.d.ts.map +1 -0
  117. package/dist/error-handling/error-handling-analyzer.js +706 -0
  118. package/dist/error-handling/error-handling-analyzer.js.map +1 -0
  119. package/dist/error-handling/index.d.ts +8 -0
  120. package/dist/error-handling/index.d.ts.map +1 -0
  121. package/dist/error-handling/index.js +8 -0
  122. package/dist/error-handling/index.js.map +1 -0
  123. package/dist/error-handling/types.d.ts +307 -0
  124. package/dist/error-handling/types.d.ts.map +1 -0
  125. package/dist/error-handling/types.js +7 -0
  126. package/dist/error-handling/types.js.map +1 -0
  127. package/dist/index.d.ts +18 -2
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +44 -5
  130. package/dist/index.js.map +1 -1
  131. package/dist/lake/pattern-shard-store.d.ts +6 -0
  132. package/dist/lake/pattern-shard-store.d.ts.map +1 -1
  133. package/dist/lake/pattern-shard-store.js +6 -0
  134. package/dist/lake/pattern-shard-store.js.map +1 -1
  135. package/dist/language-intelligence/base-normalizer.d.ts +68 -0
  136. package/dist/language-intelligence/base-normalizer.d.ts.map +1 -0
  137. package/dist/language-intelligence/base-normalizer.js +210 -0
  138. package/dist/language-intelligence/base-normalizer.js.map +1 -0
  139. package/dist/language-intelligence/framework-registry.d.ts +89 -0
  140. package/dist/language-intelligence/framework-registry.d.ts.map +1 -0
  141. package/dist/language-intelligence/framework-registry.js +165 -0
  142. package/dist/language-intelligence/framework-registry.js.map +1 -0
  143. package/dist/language-intelligence/frameworks/aspnet.d.ts +11 -0
  144. package/dist/language-intelligence/frameworks/aspnet.d.ts.map +1 -0
  145. package/dist/language-intelligence/frameworks/aspnet.js +325 -0
  146. package/dist/language-intelligence/frameworks/aspnet.js.map +1 -0
  147. package/dist/language-intelligence/frameworks/fastapi.d.ts +11 -0
  148. package/dist/language-intelligence/frameworks/fastapi.d.ts.map +1 -0
  149. package/dist/language-intelligence/frameworks/fastapi.js +188 -0
  150. package/dist/language-intelligence/frameworks/fastapi.js.map +1 -0
  151. package/dist/language-intelligence/frameworks/index.d.ts +32 -0
  152. package/dist/language-intelligence/frameworks/index.d.ts.map +1 -0
  153. package/dist/language-intelligence/frameworks/index.js +51 -0
  154. package/dist/language-intelligence/frameworks/index.js.map +1 -0
  155. package/dist/language-intelligence/frameworks/laravel.d.ts +12 -0
  156. package/dist/language-intelligence/frameworks/laravel.d.ts.map +1 -0
  157. package/dist/language-intelligence/frameworks/laravel.js +194 -0
  158. package/dist/language-intelligence/frameworks/laravel.js.map +1 -0
  159. package/dist/language-intelligence/frameworks/nestjs.d.ts +11 -0
  160. package/dist/language-intelligence/frameworks/nestjs.d.ts.map +1 -0
  161. package/dist/language-intelligence/frameworks/nestjs.js +307 -0
  162. package/dist/language-intelligence/frameworks/nestjs.js.map +1 -0
  163. package/dist/language-intelligence/frameworks/spring.d.ts +11 -0
  164. package/dist/language-intelligence/frameworks/spring.d.ts.map +1 -0
  165. package/dist/language-intelligence/frameworks/spring.js +369 -0
  166. package/dist/language-intelligence/frameworks/spring.js.map +1 -0
  167. package/dist/language-intelligence/index.d.ts +33 -0
  168. package/dist/language-intelligence/index.d.ts.map +1 -0
  169. package/dist/language-intelligence/index.js +37 -0
  170. package/dist/language-intelligence/index.js.map +1 -0
  171. package/dist/language-intelligence/language-intelligence.d.ts +99 -0
  172. package/dist/language-intelligence/language-intelligence.d.ts.map +1 -0
  173. package/dist/language-intelligence/language-intelligence.js +239 -0
  174. package/dist/language-intelligence/language-intelligence.js.map +1 -0
  175. package/dist/language-intelligence/normalizers/csharp-normalizer.d.ts +39 -0
  176. package/dist/language-intelligence/normalizers/csharp-normalizer.d.ts.map +1 -0
  177. package/dist/language-intelligence/normalizers/csharp-normalizer.js +86 -0
  178. package/dist/language-intelligence/normalizers/csharp-normalizer.js.map +1 -0
  179. package/dist/language-intelligence/normalizers/index.d.ts +25 -0
  180. package/dist/language-intelligence/normalizers/index.d.ts.map +1 -0
  181. package/dist/language-intelligence/normalizers/index.js +60 -0
  182. package/dist/language-intelligence/normalizers/index.js.map +1 -0
  183. package/dist/language-intelligence/normalizers/java-normalizer.d.ts +39 -0
  184. package/dist/language-intelligence/normalizers/java-normalizer.d.ts.map +1 -0
  185. package/dist/language-intelligence/normalizers/java-normalizer.js +96 -0
  186. package/dist/language-intelligence/normalizers/java-normalizer.js.map +1 -0
  187. package/dist/language-intelligence/normalizers/php-normalizer.d.ts +39 -0
  188. package/dist/language-intelligence/normalizers/php-normalizer.d.ts.map +1 -0
  189. package/dist/language-intelligence/normalizers/php-normalizer.js +86 -0
  190. package/dist/language-intelligence/normalizers/php-normalizer.js.map +1 -0
  191. package/dist/language-intelligence/normalizers/python-normalizer.d.ts +39 -0
  192. package/dist/language-intelligence/normalizers/python-normalizer.d.ts.map +1 -0
  193. package/dist/language-intelligence/normalizers/python-normalizer.js +95 -0
  194. package/dist/language-intelligence/normalizers/python-normalizer.js.map +1 -0
  195. package/dist/language-intelligence/normalizers/typescript-normalizer.d.ts +39 -0
  196. package/dist/language-intelligence/normalizers/typescript-normalizer.d.ts.map +1 -0
  197. package/dist/language-intelligence/normalizers/typescript-normalizer.js +84 -0
  198. package/dist/language-intelligence/normalizers/typescript-normalizer.js.map +1 -0
  199. package/dist/language-intelligence/types.d.ts +270 -0
  200. package/dist/language-intelligence/types.d.ts.map +1 -0
  201. package/dist/language-intelligence/types.js +9 -0
  202. package/dist/language-intelligence/types.js.map +1 -0
  203. package/dist/module-coupling/coupling-analyzer.d.ts +73 -0
  204. package/dist/module-coupling/coupling-analyzer.d.ts.map +1 -0
  205. package/dist/module-coupling/coupling-analyzer.js +668 -0
  206. package/dist/module-coupling/coupling-analyzer.js.map +1 -0
  207. package/dist/module-coupling/index.d.ts +9 -0
  208. package/dist/module-coupling/index.d.ts.map +1 -0
  209. package/dist/module-coupling/index.js +9 -0
  210. package/dist/module-coupling/index.js.map +1 -0
  211. package/dist/module-coupling/types.d.ts +273 -0
  212. package/dist/module-coupling/types.d.ts.map +1 -0
  213. package/dist/module-coupling/types.js +8 -0
  214. package/dist/module-coupling/types.js.map +1 -0
  215. package/dist/patterns/adapters/index.d.ts +11 -0
  216. package/dist/patterns/adapters/index.d.ts.map +1 -0
  217. package/dist/patterns/adapters/index.js +11 -0
  218. package/dist/patterns/adapters/index.js.map +1 -0
  219. package/dist/patterns/adapters/pattern-store-adapter.d.ts +59 -0
  220. package/dist/patterns/adapters/pattern-store-adapter.d.ts.map +1 -0
  221. package/dist/patterns/adapters/pattern-store-adapter.js +468 -0
  222. package/dist/patterns/adapters/pattern-store-adapter.js.map +1 -0
  223. package/dist/patterns/adapters/service-factory.d.ts +40 -0
  224. package/dist/patterns/adapters/service-factory.d.ts.map +1 -0
  225. package/dist/patterns/adapters/service-factory.js +144 -0
  226. package/dist/patterns/adapters/service-factory.js.map +1 -0
  227. package/dist/patterns/errors.d.ts +32 -0
  228. package/dist/patterns/errors.d.ts.map +1 -0
  229. package/dist/patterns/errors.js +45 -0
  230. package/dist/patterns/errors.js.map +1 -0
  231. package/dist/patterns/impl/cached-repository.d.ts +79 -0
  232. package/dist/patterns/impl/cached-repository.d.ts.map +1 -0
  233. package/dist/patterns/impl/cached-repository.js +296 -0
  234. package/dist/patterns/impl/cached-repository.js.map +1 -0
  235. package/dist/patterns/impl/file-repository.d.ts +75 -0
  236. package/dist/patterns/impl/file-repository.d.ts.map +1 -0
  237. package/dist/patterns/impl/file-repository.js +507 -0
  238. package/dist/patterns/impl/file-repository.js.map +1 -0
  239. package/dist/patterns/impl/index.d.ts +16 -0
  240. package/dist/patterns/impl/index.d.ts.map +1 -0
  241. package/dist/patterns/impl/index.js +21 -0
  242. package/dist/patterns/impl/index.js.map +1 -0
  243. package/dist/patterns/impl/memory-repository.d.ts +56 -0
  244. package/dist/patterns/impl/memory-repository.d.ts.map +1 -0
  245. package/dist/patterns/impl/memory-repository.js +323 -0
  246. package/dist/patterns/impl/memory-repository.js.map +1 -0
  247. package/dist/patterns/impl/pattern-service.d.ts +52 -0
  248. package/dist/patterns/impl/pattern-service.d.ts.map +1 -0
  249. package/dist/patterns/impl/pattern-service.js +382 -0
  250. package/dist/patterns/impl/pattern-service.js.map +1 -0
  251. package/dist/patterns/impl/repository-factory.d.ts +44 -0
  252. package/dist/patterns/impl/repository-factory.d.ts.map +1 -0
  253. package/dist/patterns/impl/repository-factory.js +140 -0
  254. package/dist/patterns/impl/repository-factory.js.map +1 -0
  255. package/dist/patterns/impl/unified-file-repository.d.ts +111 -0
  256. package/dist/patterns/impl/unified-file-repository.d.ts.map +1 -0
  257. package/dist/patterns/impl/unified-file-repository.js +677 -0
  258. package/dist/patterns/impl/unified-file-repository.js.map +1 -0
  259. package/dist/patterns/index.d.ts +23 -0
  260. package/dist/patterns/index.d.ts.map +1 -0
  261. package/dist/patterns/index.js +41 -0
  262. package/dist/patterns/index.js.map +1 -0
  263. package/dist/patterns/repository.d.ts +241 -0
  264. package/dist/patterns/repository.d.ts.map +1 -0
  265. package/dist/patterns/repository.js +23 -0
  266. package/dist/patterns/repository.js.map +1 -0
  267. package/dist/patterns/service.d.ts +245 -0
  268. package/dist/patterns/service.d.ts.map +1 -0
  269. package/dist/patterns/service.js +25 -0
  270. package/dist/patterns/service.js.map +1 -0
  271. package/dist/patterns/types.d.ts +227 -0
  272. package/dist/patterns/types.d.ts.map +1 -0
  273. package/dist/patterns/types.js +117 -0
  274. package/dist/patterns/types.js.map +1 -0
  275. package/dist/scanner/file-processor-worker.d.ts +66 -0
  276. package/dist/scanner/file-processor-worker.d.ts.map +1 -0
  277. package/dist/scanner/file-processor-worker.js +189 -0
  278. package/dist/scanner/file-processor-worker.js.map +1 -0
  279. package/dist/scanner/index.d.ts +2 -0
  280. package/dist/scanner/index.d.ts.map +1 -1
  281. package/dist/scanner/index.js +2 -0
  282. package/dist/scanner/index.js.map +1 -1
  283. package/dist/scanner/threaded-worker-pool.d.ts +182 -0
  284. package/dist/scanner/threaded-worker-pool.d.ts.map +1 -0
  285. package/dist/scanner/threaded-worker-pool.js +243 -0
  286. package/dist/scanner/threaded-worker-pool.js.map +1 -0
  287. package/dist/store/pattern-store.d.ts +6 -0
  288. package/dist/store/pattern-store.d.ts.map +1 -1
  289. package/dist/store/pattern-store.js +6 -0
  290. package/dist/store/pattern-store.js.map +1 -1
  291. package/dist/store/types.d.ts +6 -3
  292. package/dist/store/types.d.ts.map +1 -1
  293. package/dist/store/types.js.map +1 -1
  294. package/dist/test-topology/extractors/base-test-extractor.d.ts +89 -0
  295. package/dist/test-topology/extractors/base-test-extractor.d.ts.map +1 -0
  296. package/dist/test-topology/extractors/base-test-extractor.js +187 -0
  297. package/dist/test-topology/extractors/base-test-extractor.js.map +1 -0
  298. package/dist/test-topology/extractors/csharp-test-extractor.d.ts +23 -0
  299. package/dist/test-topology/extractors/csharp-test-extractor.d.ts.map +1 -0
  300. package/dist/test-topology/extractors/csharp-test-extractor.js +367 -0
  301. package/dist/test-topology/extractors/csharp-test-extractor.js.map +1 -0
  302. package/dist/test-topology/extractors/index.d.ts +12 -0
  303. package/dist/test-topology/extractors/index.d.ts.map +1 -0
  304. package/dist/test-topology/extractors/index.js +12 -0
  305. package/dist/test-topology/extractors/index.js.map +1 -0
  306. package/dist/test-topology/extractors/java-test-extractor.d.ts +20 -0
  307. package/dist/test-topology/extractors/java-test-extractor.d.ts.map +1 -0
  308. package/dist/test-topology/extractors/java-test-extractor.js +275 -0
  309. package/dist/test-topology/extractors/java-test-extractor.js.map +1 -0
  310. package/dist/test-topology/extractors/php-test-extractor.d.ts +24 -0
  311. package/dist/test-topology/extractors/php-test-extractor.d.ts.map +1 -0
  312. package/dist/test-topology/extractors/php-test-extractor.js +409 -0
  313. package/dist/test-topology/extractors/php-test-extractor.js.map +1 -0
  314. package/dist/test-topology/extractors/python-test-extractor.d.ts +23 -0
  315. package/dist/test-topology/extractors/python-test-extractor.d.ts.map +1 -0
  316. package/dist/test-topology/extractors/python-test-extractor.js +342 -0
  317. package/dist/test-topology/extractors/python-test-extractor.js.map +1 -0
  318. package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts +51 -0
  319. package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts.map +1 -0
  320. package/dist/test-topology/extractors/regex/csharp-test-regex.js +383 -0
  321. package/dist/test-topology/extractors/regex/csharp-test-regex.js.map +1 -0
  322. package/dist/test-topology/extractors/regex/index.d.ts +18 -0
  323. package/dist/test-topology/extractors/regex/index.d.ts.map +1 -0
  324. package/dist/test-topology/extractors/regex/index.js +43 -0
  325. package/dist/test-topology/extractors/regex/index.js.map +1 -0
  326. package/dist/test-topology/extractors/regex/java-test-regex.d.ts +50 -0
  327. package/dist/test-topology/extractors/regex/java-test-regex.d.ts.map +1 -0
  328. package/dist/test-topology/extractors/regex/java-test-regex.js +370 -0
  329. package/dist/test-topology/extractors/regex/java-test-regex.js.map +1 -0
  330. package/dist/test-topology/extractors/regex/php-test-regex.d.ts +56 -0
  331. package/dist/test-topology/extractors/regex/php-test-regex.d.ts.map +1 -0
  332. package/dist/test-topology/extractors/regex/php-test-regex.js +503 -0
  333. package/dist/test-topology/extractors/regex/php-test-regex.js.map +1 -0
  334. package/dist/test-topology/extractors/regex/python-test-regex.d.ts +57 -0
  335. package/dist/test-topology/extractors/regex/python-test-regex.d.ts.map +1 -0
  336. package/dist/test-topology/extractors/regex/python-test-regex.js +381 -0
  337. package/dist/test-topology/extractors/regex/python-test-regex.js.map +1 -0
  338. package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts +60 -0
  339. package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts.map +1 -0
  340. package/dist/test-topology/extractors/regex/typescript-test-regex.js +368 -0
  341. package/dist/test-topology/extractors/regex/typescript-test-regex.js.map +1 -0
  342. package/dist/test-topology/extractors/typescript-test-extractor.d.ts +24 -0
  343. package/dist/test-topology/extractors/typescript-test-extractor.d.ts.map +1 -0
  344. package/dist/test-topology/extractors/typescript-test-extractor.js +266 -0
  345. package/dist/test-topology/extractors/typescript-test-extractor.js.map +1 -0
  346. package/dist/test-topology/hybrid-test-topology-analyzer.d.ts +98 -0
  347. package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -0
  348. package/dist/test-topology/hybrid-test-topology-analyzer.js +555 -0
  349. package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -0
  350. package/dist/test-topology/index.d.ts +16 -0
  351. package/dist/test-topology/index.d.ts.map +1 -0
  352. package/dist/test-topology/index.js +19 -0
  353. package/dist/test-topology/index.js.map +1 -0
  354. package/dist/test-topology/test-topology-analyzer.d.ts +85 -0
  355. package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -0
  356. package/dist/test-topology/test-topology-analyzer.js +538 -0
  357. package/dist/test-topology/test-topology-analyzer.js.map +1 -0
  358. package/dist/test-topology/types.d.ts +300 -0
  359. package/dist/test-topology/types.d.ts.map +1 -0
  360. package/dist/test-topology/types.js +7 -0
  361. package/dist/test-topology/types.js.map +1 -0
  362. package/dist/unified-provider/compat/index.d.ts +11 -0
  363. package/dist/unified-provider/compat/index.d.ts.map +1 -0
  364. package/dist/unified-provider/compat/index.js +13 -0
  365. package/dist/unified-provider/compat/index.js.map +1 -0
  366. package/dist/unified-provider/compat/legacy-extractors.d.ts +63 -0
  367. package/dist/unified-provider/compat/legacy-extractors.d.ts.map +1 -0
  368. package/dist/unified-provider/compat/legacy-extractors.js +80 -0
  369. package/dist/unified-provider/compat/legacy-extractors.js.map +1 -0
  370. package/dist/unified-provider/compat/legacy-scanner.d.ts +28 -0
  371. package/dist/unified-provider/compat/legacy-scanner.d.ts.map +1 -0
  372. package/dist/unified-provider/compat/legacy-scanner.js +31 -0
  373. package/dist/unified-provider/compat/legacy-scanner.js.map +1 -0
  374. package/dist/unified-provider/index.d.ts +28 -0
  375. package/dist/unified-provider/index.d.ts.map +1 -0
  376. package/dist/unified-provider/index.js +47 -0
  377. package/dist/unified-provider/index.js.map +1 -0
  378. package/dist/unified-provider/integration/index.d.ts +9 -0
  379. package/dist/unified-provider/integration/index.d.ts.map +1 -0
  380. package/dist/unified-provider/integration/index.js +11 -0
  381. package/dist/unified-provider/integration/index.js.map +1 -0
  382. package/dist/unified-provider/integration/unified-data-access-adapter.d.ts +75 -0
  383. package/dist/unified-provider/integration/unified-data-access-adapter.d.ts.map +1 -0
  384. package/dist/unified-provider/integration/unified-data-access-adapter.js +210 -0
  385. package/dist/unified-provider/integration/unified-data-access-adapter.js.map +1 -0
  386. package/dist/unified-provider/integration/unified-scanner.d.ts +90 -0
  387. package/dist/unified-provider/integration/unified-scanner.d.ts.map +1 -0
  388. package/dist/unified-provider/integration/unified-scanner.js +369 -0
  389. package/dist/unified-provider/integration/unified-scanner.js.map +1 -0
  390. package/dist/unified-provider/matching/base-matcher.d.ts +80 -0
  391. package/dist/unified-provider/matching/base-matcher.d.ts.map +1 -0
  392. package/dist/unified-provider/matching/base-matcher.js +196 -0
  393. package/dist/unified-provider/matching/base-matcher.js.map +1 -0
  394. package/dist/unified-provider/matching/django-matcher.d.ts +32 -0
  395. package/dist/unified-provider/matching/django-matcher.d.ts.map +1 -0
  396. package/dist/unified-provider/matching/django-matcher.js +107 -0
  397. package/dist/unified-provider/matching/django-matcher.js.map +1 -0
  398. package/dist/unified-provider/matching/drizzle-matcher.d.ts +25 -0
  399. package/dist/unified-provider/matching/drizzle-matcher.d.ts.map +1 -0
  400. package/dist/unified-provider/matching/drizzle-matcher.js +123 -0
  401. package/dist/unified-provider/matching/drizzle-matcher.js.map +1 -0
  402. package/dist/unified-provider/matching/efcore-matcher.d.ts +27 -0
  403. package/dist/unified-provider/matching/efcore-matcher.d.ts.map +1 -0
  404. package/dist/unified-provider/matching/efcore-matcher.js +88 -0
  405. package/dist/unified-provider/matching/efcore-matcher.js.map +1 -0
  406. package/dist/unified-provider/matching/eloquent-matcher.d.ts +32 -0
  407. package/dist/unified-provider/matching/eloquent-matcher.d.ts.map +1 -0
  408. package/dist/unified-provider/matching/eloquent-matcher.js +162 -0
  409. package/dist/unified-provider/matching/eloquent-matcher.js.map +1 -0
  410. package/dist/unified-provider/matching/index.d.ts +19 -0
  411. package/dist/unified-provider/matching/index.d.ts.map +1 -0
  412. package/dist/unified-provider/matching/index.js +24 -0
  413. package/dist/unified-provider/matching/index.js.map +1 -0
  414. package/dist/unified-provider/matching/knex-matcher.d.ts +26 -0
  415. package/dist/unified-provider/matching/knex-matcher.d.ts.map +1 -0
  416. package/dist/unified-provider/matching/knex-matcher.js +109 -0
  417. package/dist/unified-provider/matching/knex-matcher.js.map +1 -0
  418. package/dist/unified-provider/matching/matcher-registry.d.ts +55 -0
  419. package/dist/unified-provider/matching/matcher-registry.d.ts.map +1 -0
  420. package/dist/unified-provider/matching/matcher-registry.js +130 -0
  421. package/dist/unified-provider/matching/matcher-registry.js.map +1 -0
  422. package/dist/unified-provider/matching/mongoose-matcher.d.ts +30 -0
  423. package/dist/unified-provider/matching/mongoose-matcher.d.ts.map +1 -0
  424. package/dist/unified-provider/matching/mongoose-matcher.js +132 -0
  425. package/dist/unified-provider/matching/mongoose-matcher.js.map +1 -0
  426. package/dist/unified-provider/matching/prisma-matcher.d.ts +31 -0
  427. package/dist/unified-provider/matching/prisma-matcher.d.ts.map +1 -0
  428. package/dist/unified-provider/matching/prisma-matcher.js +123 -0
  429. package/dist/unified-provider/matching/prisma-matcher.js.map +1 -0
  430. package/dist/unified-provider/matching/raw-sql-matcher.d.ts +31 -0
  431. package/dist/unified-provider/matching/raw-sql-matcher.d.ts.map +1 -0
  432. package/dist/unified-provider/matching/raw-sql-matcher.js +173 -0
  433. package/dist/unified-provider/matching/raw-sql-matcher.js.map +1 -0
  434. package/dist/unified-provider/matching/sequelize-matcher.d.ts +28 -0
  435. package/dist/unified-provider/matching/sequelize-matcher.d.ts.map +1 -0
  436. package/dist/unified-provider/matching/sequelize-matcher.js +132 -0
  437. package/dist/unified-provider/matching/sequelize-matcher.js.map +1 -0
  438. package/dist/unified-provider/matching/spring-data-matcher.d.ts +32 -0
  439. package/dist/unified-provider/matching/spring-data-matcher.d.ts.map +1 -0
  440. package/dist/unified-provider/matching/spring-data-matcher.js +112 -0
  441. package/dist/unified-provider/matching/spring-data-matcher.js.map +1 -0
  442. package/dist/unified-provider/matching/sqlalchemy-matcher.d.ts +32 -0
  443. package/dist/unified-provider/matching/sqlalchemy-matcher.d.ts.map +1 -0
  444. package/dist/unified-provider/matching/sqlalchemy-matcher.js +201 -0
  445. package/dist/unified-provider/matching/sqlalchemy-matcher.js.map +1 -0
  446. package/dist/unified-provider/matching/supabase-matcher.d.ts +27 -0
  447. package/dist/unified-provider/matching/supabase-matcher.d.ts.map +1 -0
  448. package/dist/unified-provider/matching/supabase-matcher.js +122 -0
  449. package/dist/unified-provider/matching/supabase-matcher.js.map +1 -0
  450. package/dist/unified-provider/matching/typeorm-matcher.d.ts +32 -0
  451. package/dist/unified-provider/matching/typeorm-matcher.d.ts.map +1 -0
  452. package/dist/unified-provider/matching/typeorm-matcher.js +169 -0
  453. package/dist/unified-provider/matching/typeorm-matcher.js.map +1 -0
  454. package/dist/unified-provider/migration/deprecated-extractors.d.ts +104 -0
  455. package/dist/unified-provider/migration/deprecated-extractors.d.ts.map +1 -0
  456. package/dist/unified-provider/migration/deprecated-extractors.js +129 -0
  457. package/dist/unified-provider/migration/deprecated-extractors.js.map +1 -0
  458. package/dist/unified-provider/migration/deprecated-scanner.d.ts +40 -0
  459. package/dist/unified-provider/migration/deprecated-scanner.d.ts.map +1 -0
  460. package/dist/unified-provider/migration/deprecated-scanner.js +49 -0
  461. package/dist/unified-provider/migration/deprecated-scanner.js.map +1 -0
  462. package/dist/unified-provider/migration/index.d.ts +41 -0
  463. package/dist/unified-provider/migration/index.d.ts.map +1 -0
  464. package/dist/unified-provider/migration/index.js +43 -0
  465. package/dist/unified-provider/migration/index.js.map +1 -0
  466. package/dist/unified-provider/normalization/base-normalizer.d.ts +188 -0
  467. package/dist/unified-provider/normalization/base-normalizer.d.ts.map +1 -0
  468. package/dist/unified-provider/normalization/base-normalizer.js +339 -0
  469. package/dist/unified-provider/normalization/base-normalizer.js.map +1 -0
  470. package/dist/unified-provider/normalization/csharp-normalizer.d.ts +58 -0
  471. package/dist/unified-provider/normalization/csharp-normalizer.d.ts.map +1 -0
  472. package/dist/unified-provider/normalization/csharp-normalizer.js +467 -0
  473. package/dist/unified-provider/normalization/csharp-normalizer.js.map +1 -0
  474. package/dist/unified-provider/normalization/index.d.ts +23 -0
  475. package/dist/unified-provider/normalization/index.d.ts.map +1 -0
  476. package/dist/unified-provider/normalization/index.js +62 -0
  477. package/dist/unified-provider/normalization/index.js.map +1 -0
  478. package/dist/unified-provider/normalization/java-normalizer.d.ts +54 -0
  479. package/dist/unified-provider/normalization/java-normalizer.d.ts.map +1 -0
  480. package/dist/unified-provider/normalization/java-normalizer.js +453 -0
  481. package/dist/unified-provider/normalization/java-normalizer.js.map +1 -0
  482. package/dist/unified-provider/normalization/php-normalizer.d.ts +54 -0
  483. package/dist/unified-provider/normalization/php-normalizer.d.ts.map +1 -0
  484. package/dist/unified-provider/normalization/php-normalizer.js +489 -0
  485. package/dist/unified-provider/normalization/php-normalizer.js.map +1 -0
  486. package/dist/unified-provider/normalization/python-normalizer.d.ts +61 -0
  487. package/dist/unified-provider/normalization/python-normalizer.d.ts.map +1 -0
  488. package/dist/unified-provider/normalization/python-normalizer.js +548 -0
  489. package/dist/unified-provider/normalization/python-normalizer.js.map +1 -0
  490. package/dist/unified-provider/normalization/typescript-normalizer.d.ts +60 -0
  491. package/dist/unified-provider/normalization/typescript-normalizer.d.ts.map +1 -0
  492. package/dist/unified-provider/normalization/typescript-normalizer.js +608 -0
  493. package/dist/unified-provider/normalization/typescript-normalizer.js.map +1 -0
  494. package/dist/unified-provider/parsing/index.d.ts +5 -0
  495. package/dist/unified-provider/parsing/index.d.ts.map +1 -0
  496. package/dist/unified-provider/parsing/index.js +5 -0
  497. package/dist/unified-provider/parsing/index.js.map +1 -0
  498. package/dist/unified-provider/parsing/parser-registry.d.ts +70 -0
  499. package/dist/unified-provider/parsing/parser-registry.d.ts.map +1 -0
  500. package/dist/unified-provider/parsing/parser-registry.js +260 -0
  501. package/dist/unified-provider/parsing/parser-registry.js.map +1 -0
  502. package/dist/unified-provider/provider/index.d.ts +5 -0
  503. package/dist/unified-provider/provider/index.d.ts.map +1 -0
  504. package/dist/unified-provider/provider/index.js +5 -0
  505. package/dist/unified-provider/provider/index.js.map +1 -0
  506. package/dist/unified-provider/provider/unified-language-provider.d.ts +56 -0
  507. package/dist/unified-provider/provider/unified-language-provider.d.ts.map +1 -0
  508. package/dist/unified-provider/provider/unified-language-provider.js +212 -0
  509. package/dist/unified-provider/provider/unified-language-provider.js.map +1 -0
  510. package/dist/unified-provider/types.d.ts +389 -0
  511. package/dist/unified-provider/types.d.ts.map +1 -0
  512. package/dist/unified-provider/types.js +9 -0
  513. package/dist/unified-provider/types.js.map +1 -0
  514. package/dist/wrappers/clustering/clusterer.d.ts +43 -0
  515. package/dist/wrappers/clustering/clusterer.d.ts.map +1 -0
  516. package/dist/wrappers/clustering/clusterer.js +374 -0
  517. package/dist/wrappers/clustering/clusterer.js.map +1 -0
  518. package/dist/wrappers/clustering/exclusions.d.ts +47 -0
  519. package/dist/wrappers/clustering/exclusions.d.ts.map +1 -0
  520. package/dist/wrappers/clustering/exclusions.js +318 -0
  521. package/dist/wrappers/clustering/exclusions.js.map +1 -0
  522. package/dist/wrappers/clustering/index.d.ts +6 -0
  523. package/dist/wrappers/clustering/index.d.ts.map +1 -0
  524. package/dist/wrappers/clustering/index.js +6 -0
  525. package/dist/wrappers/clustering/index.js.map +1 -0
  526. package/dist/wrappers/detection/detector.d.ts +69 -0
  527. package/dist/wrappers/detection/detector.d.ts.map +1 -0
  528. package/dist/wrappers/detection/detector.js +279 -0
  529. package/dist/wrappers/detection/detector.js.map +1 -0
  530. package/dist/wrappers/detection/index.d.ts +5 -0
  531. package/dist/wrappers/detection/index.d.ts.map +1 -0
  532. package/dist/wrappers/detection/index.js +5 -0
  533. package/dist/wrappers/detection/index.js.map +1 -0
  534. package/dist/wrappers/export/index.d.ts +5 -0
  535. package/dist/wrappers/export/index.d.ts.map +1 -0
  536. package/dist/wrappers/export/index.js +5 -0
  537. package/dist/wrappers/export/index.js.map +1 -0
  538. package/dist/wrappers/export/json.d.ts +127 -0
  539. package/dist/wrappers/export/json.d.ts.map +1 -0
  540. package/dist/wrappers/export/json.js +160 -0
  541. package/dist/wrappers/export/json.js.map +1 -0
  542. package/dist/wrappers/index.d.ts +56 -0
  543. package/dist/wrappers/index.d.ts.map +1 -0
  544. package/dist/wrappers/index.js +159 -0
  545. package/dist/wrappers/index.js.map +1 -0
  546. package/dist/wrappers/integration/adapter.d.ts +52 -0
  547. package/dist/wrappers/integration/adapter.d.ts.map +1 -0
  548. package/dist/wrappers/integration/adapter.js +209 -0
  549. package/dist/wrappers/integration/adapter.js.map +1 -0
  550. package/dist/wrappers/integration/index.d.ts +9 -0
  551. package/dist/wrappers/integration/index.d.ts.map +1 -0
  552. package/dist/wrappers/integration/index.js +12 -0
  553. package/dist/wrappers/integration/index.js.map +1 -0
  554. package/dist/wrappers/integration/pattern-adapter.d.ts +52 -0
  555. package/dist/wrappers/integration/pattern-adapter.d.ts.map +1 -0
  556. package/dist/wrappers/integration/pattern-adapter.js +192 -0
  557. package/dist/wrappers/integration/pattern-adapter.js.map +1 -0
  558. package/dist/wrappers/integration/scanner.d.ts +85 -0
  559. package/dist/wrappers/integration/scanner.d.ts.map +1 -0
  560. package/dist/wrappers/integration/scanner.js +367 -0
  561. package/dist/wrappers/integration/scanner.js.map +1 -0
  562. package/dist/wrappers/primitives/discovery.d.ts +57 -0
  563. package/dist/wrappers/primitives/discovery.d.ts.map +1 -0
  564. package/dist/wrappers/primitives/discovery.js +389 -0
  565. package/dist/wrappers/primitives/discovery.js.map +1 -0
  566. package/dist/wrappers/primitives/index.d.ts +6 -0
  567. package/dist/wrappers/primitives/index.d.ts.map +1 -0
  568. package/dist/wrappers/primitives/index.js +6 -0
  569. package/dist/wrappers/primitives/index.js.map +1 -0
  570. package/dist/wrappers/primitives/registry.d.ts +63 -0
  571. package/dist/wrappers/primitives/registry.d.ts.map +1 -0
  572. package/dist/wrappers/primitives/registry.js +447 -0
  573. package/dist/wrappers/primitives/registry.js.map +1 -0
  574. package/dist/wrappers/types.d.ts +137 -0
  575. package/dist/wrappers/types.d.ts.map +1 -0
  576. package/dist/wrappers/types.js +7 -0
  577. package/dist/wrappers/types.js.map +1 -0
  578. package/package.json +23 -18
@@ -0,0 +1,381 @@
1
+ /**
2
+ * Python Test Regex Extractor
3
+ *
4
+ * Regex-based fallback for extracting test information when tree-sitter is unavailable.
5
+ * Supports pytest, unittest, and nose frameworks.
6
+ */
7
+ // ============================================================================
8
+ // Extractor
9
+ // ============================================================================
10
+ export class PythonTestRegexExtractor {
11
+ language = 'python';
12
+ extensions = ['.py'];
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, framework);
19
+ const mocks = this.extractMocks(content);
20
+ const setupBlocks = this.extractSetupBlocks(content, framework);
21
+ const fixtures = framework === 'pytest' ? this.extractFixtures(content) : undefined;
22
+ // Enrich test cases with quality
23
+ for (const test of testCases) {
24
+ const testMocks = mocks.filter(m => m.line >= test.line && m.line <= test.line + 100);
25
+ test.quality = this.calculateQuality(test.assertions, testMocks, test.directCalls);
26
+ }
27
+ return {
28
+ file: filePath,
29
+ framework,
30
+ language: 'python',
31
+ testCases,
32
+ mocks,
33
+ setupBlocks,
34
+ fixtures,
35
+ };
36
+ }
37
+ /**
38
+ * Detect test framework
39
+ */
40
+ detectFramework(content) {
41
+ // Check imports
42
+ if (/import\s+pytest|from\s+pytest/.test(content))
43
+ return 'pytest';
44
+ if (/import\s+unittest|from\s+unittest/.test(content))
45
+ return 'unittest';
46
+ if (/import\s+nose|from\s+nose/.test(content))
47
+ return 'nose';
48
+ // Check for pytest fixtures
49
+ if (/@pytest\.fixture/.test(content))
50
+ return 'pytest';
51
+ // Check for unittest class
52
+ if (/class\s+\w+\s*\(\s*(?:unittest\.)?TestCase\s*\)/.test(content))
53
+ return 'unittest';
54
+ // Check for test_ functions (pytest style)
55
+ if (/^def\s+test_/m.test(content))
56
+ return 'pytest';
57
+ return 'unknown';
58
+ }
59
+ /**
60
+ * Extract test cases
61
+ */
62
+ extractTestCases(content, filePath, framework) {
63
+ const testCases = [];
64
+ const lines = content.split('\n');
65
+ // Track current class for unittest style
66
+ let currentClass;
67
+ let classIndent = 0;
68
+ for (let i = 0; i < lines.length; i++) {
69
+ const line = lines[i];
70
+ const lineNum = i + 1;
71
+ const indent = line.search(/\S/);
72
+ // Check for class definition
73
+ const classMatch = line.match(/^(\s*)class\s+(\w+)/);
74
+ if (classMatch) {
75
+ currentClass = classMatch[2];
76
+ classIndent = classMatch[1].length;
77
+ continue;
78
+ }
79
+ // Reset class if we're back at base indent
80
+ if (indent <= classIndent && currentClass && line.trim() && !line.trim().startsWith('#')) {
81
+ currentClass = undefined;
82
+ }
83
+ // Check for test function
84
+ const testMatch = line.match(/^(\s*)(?:async\s+)?def\s+(test_\w+)\s*\(/);
85
+ if (testMatch) {
86
+ const testName = testMatch[2];
87
+ const qualifiedName = currentClass
88
+ ? `${currentClass}.${testName}`
89
+ : testName;
90
+ // Extract test body
91
+ const testBody = this.extractFunctionBody(lines, i);
92
+ const directCalls = this.extractFunctionCalls(testBody);
93
+ const assertions = this.extractAssertions(testBody, lineNum, framework);
94
+ testCases.push({
95
+ id: `${filePath}:${testName}:${lineNum}`,
96
+ name: testName,
97
+ parentBlock: currentClass,
98
+ qualifiedName,
99
+ file: filePath,
100
+ line: lineNum,
101
+ directCalls,
102
+ transitiveCalls: [],
103
+ assertions,
104
+ quality: {
105
+ assertionCount: assertions.length,
106
+ hasErrorCases: false,
107
+ hasEdgeCases: false,
108
+ mockRatio: 0,
109
+ setupRatio: 0,
110
+ score: 50,
111
+ },
112
+ });
113
+ }
114
+ }
115
+ return testCases;
116
+ }
117
+ /**
118
+ * Extract function body based on indentation
119
+ */
120
+ extractFunctionBody(lines, startIndex) {
121
+ const bodyLines = [];
122
+ const defLine = lines[startIndex];
123
+ const defIndent = defLine.search(/\S/);
124
+ // Start from next line
125
+ for (let i = startIndex + 1; i < Math.min(startIndex + 100, lines.length); i++) {
126
+ const line = lines[i];
127
+ const lineIndent = line.search(/\S/);
128
+ // Empty lines are okay
129
+ if (line.trim() === '') {
130
+ bodyLines.push(line);
131
+ continue;
132
+ }
133
+ // If we're back to same or less indent, we're done
134
+ if (lineIndent <= defIndent) {
135
+ break;
136
+ }
137
+ bodyLines.push(line);
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 function 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
+ // Pattern for method calls
160
+ const methodPattern = /\.([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/g;
161
+ while ((match = methodPattern.exec(body)) !== null) {
162
+ const name = match[1];
163
+ if (this.isTestFrameworkCall(name))
164
+ continue;
165
+ if (!seen.has(name)) {
166
+ seen.add(name);
167
+ calls.push(name);
168
+ }
169
+ }
170
+ return calls;
171
+ }
172
+ /**
173
+ * Extract assertions
174
+ */
175
+ extractAssertions(body, baseLineNum, _framework) {
176
+ const assertions = [];
177
+ const lines = body.split('\n');
178
+ for (let i = 0; i < lines.length; i++) {
179
+ const line = lines[i];
180
+ const lineNum = baseLineNum + i + 1;
181
+ // pytest assert
182
+ if (/\bassert\s+/.test(line)) {
183
+ const isError = /raises|exception/i.test(line);
184
+ const isEdge = /None|is\s+None|==\s*None|==\s*\[\]|==\s*\{\}|==\s*''|==\s*0/.test(line);
185
+ assertions.push({
186
+ matcher: 'assert',
187
+ line: lineNum,
188
+ isErrorAssertion: isError,
189
+ isEdgeCaseAssertion: isEdge,
190
+ });
191
+ }
192
+ // unittest assertions
193
+ const unittestMatch = line.match(/self\.(assert\w+)/);
194
+ if (unittestMatch) {
195
+ const matcher = unittestMatch[1];
196
+ assertions.push({
197
+ matcher,
198
+ line: lineNum,
199
+ isErrorAssertion: this.isErrorMatcher(matcher),
200
+ isEdgeCaseAssertion: this.isEdgeCaseMatcher(matcher),
201
+ });
202
+ }
203
+ // pytest.raises
204
+ if (/pytest\.raises/.test(line)) {
205
+ assertions.push({
206
+ matcher: 'pytest.raises',
207
+ line: lineNum,
208
+ isErrorAssertion: true,
209
+ isEdgeCaseAssertion: false,
210
+ });
211
+ }
212
+ }
213
+ return assertions;
214
+ }
215
+ /**
216
+ * Extract mock statements
217
+ */
218
+ extractMocks(content) {
219
+ const mocks = [];
220
+ const lines = content.split('\n');
221
+ for (let i = 0; i < lines.length; i++) {
222
+ const line = lines[i];
223
+ const lineNum = i + 1;
224
+ // @patch decorator
225
+ const patchMatch = line.match(/@(?:mock\.)?patch\s*\(\s*['"]([^'"]+)['"]/);
226
+ if (patchMatch) {
227
+ mocks.push({
228
+ target: patchMatch[1],
229
+ mockType: '@patch',
230
+ line: lineNum,
231
+ isExternal: this.isExternalModule(patchMatch[1]),
232
+ });
233
+ }
234
+ // patch() context manager or function
235
+ const patchCallMatch = line.match(/(?:mock\.)?patch\s*\(\s*['"]([^'"]+)['"]/);
236
+ if (patchCallMatch && !line.includes('@')) {
237
+ mocks.push({
238
+ target: patchCallMatch[1],
239
+ mockType: 'patch()',
240
+ line: lineNum,
241
+ isExternal: this.isExternalModule(patchCallMatch[1]),
242
+ });
243
+ }
244
+ // MagicMock / Mock
245
+ const mockMatch = line.match(/(\w+)\s*=\s*(?:Mock|MagicMock)\s*\(/);
246
+ if (mockMatch) {
247
+ mocks.push({
248
+ target: mockMatch[1],
249
+ mockType: 'Mock',
250
+ line: lineNum,
251
+ isExternal: false,
252
+ });
253
+ }
254
+ // mocker.patch (pytest-mock)
255
+ const mockerMatch = line.match(/mocker\.patch\s*\(\s*['"]([^'"]+)['"]/);
256
+ if (mockerMatch) {
257
+ mocks.push({
258
+ target: mockerMatch[1],
259
+ mockType: 'mocker.patch',
260
+ line: lineNum,
261
+ isExternal: this.isExternalModule(mockerMatch[1]),
262
+ });
263
+ }
264
+ }
265
+ return mocks;
266
+ }
267
+ /**
268
+ * Extract setup blocks
269
+ */
270
+ extractSetupBlocks(content, framework) {
271
+ const blocks = [];
272
+ const lines = content.split('\n');
273
+ const setupFns = framework === 'unittest'
274
+ ? ['setUp', 'tearDown', 'setUpClass', 'tearDownClass']
275
+ : ['setup_method', 'teardown_method', 'setup_function', 'teardown_function'];
276
+ for (let i = 0; i < lines.length; i++) {
277
+ const line = lines[i];
278
+ const lineNum = i + 1;
279
+ for (const fn of setupFns) {
280
+ const pattern = new RegExp(`def\\s+${fn}\\s*\\(`);
281
+ if (pattern.test(line)) {
282
+ const body = this.extractFunctionBody(lines, i);
283
+ const calls = this.extractFunctionCalls(body);
284
+ const type = fn.toLowerCase().includes('setup') ? 'setUp' : 'tearDown';
285
+ blocks.push({
286
+ type: type,
287
+ line: lineNum,
288
+ calls,
289
+ });
290
+ break;
291
+ }
292
+ }
293
+ }
294
+ return blocks;
295
+ }
296
+ /**
297
+ * Extract pytest fixtures
298
+ */
299
+ extractFixtures(content) {
300
+ const fixtures = [];
301
+ const lines = content.split('\n');
302
+ for (let i = 0; i < lines.length; i++) {
303
+ const line = lines[i];
304
+ const lineNum = i + 1;
305
+ // @pytest.fixture
306
+ const fixtureMatch = line.match(/@pytest\.fixture(?:\s*\(\s*(?:scope\s*=\s*['"](\w+)['"])?\s*\))?/);
307
+ if (fixtureMatch) {
308
+ // Get the function name from next line
309
+ const nextLine = lines[i + 1];
310
+ if (nextLine) {
311
+ const fnMatch = nextLine.match(/def\s+(\w+)\s*\(/);
312
+ if (fnMatch) {
313
+ fixtures.push({
314
+ name: fnMatch[1],
315
+ scope: fixtureMatch[1] ?? 'function',
316
+ line: lineNum,
317
+ });
318
+ }
319
+ }
320
+ }
321
+ }
322
+ return fixtures;
323
+ }
324
+ isTestFrameworkCall(name) {
325
+ const frameworkCalls = [
326
+ 'assert', 'assertEqual', 'assertTrue', 'assertFalse', 'assertIsNone',
327
+ 'assertIsNotNone', 'assertRaises', 'assertIn', 'assertNotIn',
328
+ 'pytest', 'fixture', 'mark', 'parametrize', 'raises',
329
+ 'patch', 'Mock', 'MagicMock', 'mocker',
330
+ ];
331
+ return frameworkCalls.includes(name);
332
+ }
333
+ isErrorMatcher(matcher) {
334
+ return /raises|exception/i.test(matcher);
335
+ }
336
+ isEdgeCaseMatcher(matcher) {
337
+ return /none|null|empty|zero|false/i.test(matcher);
338
+ }
339
+ isExternalModule(modulePath) {
340
+ if (modulePath.startsWith('.'))
341
+ return false;
342
+ return true;
343
+ }
344
+ calculateQuality(assertions, mocks, directCalls) {
345
+ const assertionCount = assertions.length;
346
+ const hasErrorCases = assertions.some(a => a.isErrorAssertion);
347
+ const hasEdgeCases = assertions.some(a => a.isEdgeCaseAssertion);
348
+ const totalCalls = mocks.length + directCalls.length;
349
+ const mockRatio = totalCalls > 0 ? mocks.length / totalCalls : 0;
350
+ let score = 50;
351
+ if (assertionCount >= 1)
352
+ score += 10;
353
+ if (assertionCount >= 3)
354
+ score += 10;
355
+ if (hasErrorCases)
356
+ score += 15;
357
+ if (hasEdgeCases)
358
+ score += 10;
359
+ if (mockRatio > 0.7)
360
+ score -= 15;
361
+ else if (mockRatio > 0.5)
362
+ score -= 5;
363
+ if (assertionCount === 0)
364
+ score -= 20;
365
+ return {
366
+ assertionCount,
367
+ hasErrorCases,
368
+ hasEdgeCases,
369
+ mockRatio: Math.round(mockRatio * 100) / 100,
370
+ setupRatio: 0,
371
+ score: Math.max(0, Math.min(100, score)),
372
+ };
373
+ }
374
+ }
375
+ /**
376
+ * Factory function
377
+ */
378
+ export function createPythonTestRegexExtractor() {
379
+ return new PythonTestRegexExtractor();
380
+ }
381
+ //# sourceMappingURL=python-test-regex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-test-regex.js","sourceRoot":"","sources":["../../../../src/test-topology/extractors/regex/python-test-regex.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,OAAO,wBAAwB;IAC1B,QAAQ,GAAG,QAAiB,CAAC;IAC7B,UAAU,GAAG,CAAC,KAAK,CAAC,CAAC;IAE9B;;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,EAAE,SAAS,CAAC,CAAC;QACtE,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpF,iCAAiC;QACjC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;YAC7B,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACjC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,GAAG,GAAG,CACjD,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACrF,CAAC;QAED,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,SAAS;YACT,QAAQ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,MAAM,CAAC;QACrD,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjE,IAAI,KAAK,GAAG,EAAE,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,8BAA8B;IAC5C,OAAO,IAAI,wBAAwB,EAAE,CAAC;AACxC,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * TypeScript/JavaScript Test Regex Extractor
3
+ *
4
+ * Regex-based fallback for extracting test information when tree-sitter is unavailable.
5
+ * Supports Jest, Vitest, Mocha, and other JS test frameworks.
6
+ */
7
+ import type { TestExtraction, TestCase, MockStatement, SetupBlock, TestFramework } from '../../types.js';
8
+ export declare class TypeScriptTestRegexExtractor {
9
+ readonly language: "typescript";
10
+ readonly extensions: string[];
11
+ /**
12
+ * Extract test information using regex patterns
13
+ */
14
+ extract(content: string, filePath: string): TestExtraction;
15
+ private getLanguageFromPath;
16
+ /**
17
+ * Detect test framework from imports
18
+ */
19
+ detectFramework(content: string): TestFramework;
20
+ /**
21
+ * Extract test cases using regex
22
+ */
23
+ extractTestCases(content: string, filePath: string): TestCase[];
24
+ /**
25
+ * Extract the body of a test (rough approximation)
26
+ */
27
+ private extractTestBody;
28
+ /**
29
+ * Extract function calls from test body
30
+ */
31
+ private extractFunctionCalls;
32
+ /**
33
+ * Extract assertions from test body
34
+ */
35
+ private extractAssertions;
36
+ /**
37
+ * Extract mock statements
38
+ */
39
+ extractMocks(content: string, framework: TestFramework): MockStatement[];
40
+ /**
41
+ * Extract setup blocks
42
+ */
43
+ extractSetupBlocks(content: string): SetupBlock[];
44
+ /**
45
+ * Check if a call is a test framework call
46
+ */
47
+ private isTestFrameworkCall;
48
+ private isErrorMatcher;
49
+ private isEdgeCaseMatcher;
50
+ private isExternalModule;
51
+ /**
52
+ * Calculate test quality signals
53
+ */
54
+ private calculateQuality;
55
+ }
56
+ /**
57
+ * Factory function
58
+ */
59
+ export declare function createTypeScriptTestRegexExtractor(): TypeScriptTestRegexExtractor;
60
+ //# sourceMappingURL=typescript-test-regex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript-test-regex.d.ts","sourceRoot":"","sources":["../../../../src/test-topology/extractors/regex/typescript-test-regex.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,QAAQ,EACR,aAAa,EACb,UAAU,EAGV,aAAa,EACd,MAAM,gBAAgB,CAAC;AAoBxB,qBAAa,4BAA4B;IACvC,QAAQ,CAAC,QAAQ,EAAG,YAAY,CAAU;IAC1C,QAAQ,CAAC,UAAU,WAAkE;IAErF;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc;IAwB1D,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa;IA4B/C;;OAEG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE;IAiF/D;;OAEG;IACH,OAAO,CAAC,eAAe;IA2BvB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAkC5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAyBzB;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,aAAa,EAAE;IA2CxE;;OAEG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE;IA4BjD;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,gBAAgB;IAMxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CA8BzB;AAED;;GAEG;AACH,wBAAgB,kCAAkC,IAAI,4BAA4B,CAEjF"}