@eagleoutice/flowr 2.14.0 → 2.14.2

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 (461) hide show
  1. package/README.md +169 -91
  2. package/abstract-interpretation/absint-visitor.d.ts +91 -25
  3. package/abstract-interpretation/absint-visitor.js +235 -74
  4. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +1 -1
  5. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
  6. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
  7. package/abstract-interpretation/data-frame/mappers/arguments.js +1 -1
  8. package/abstract-interpretation/data-frame/mappers/function-mapper.js +107 -254
  9. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +5 -5
  10. package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -1
  11. package/abstract-interpretation/data-frame/resolve-args.js +6 -4
  12. package/abstract-interpretation/data-frame/shape-inference.d.ts +4 -9
  13. package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -0
  14. package/abstract-interpretation/domains/bounded-set-domain.js +1 -0
  15. package/abstract-interpretation/domains/partial-product-domain.js +1 -1
  16. package/abstract-interpretation/domains/set-range-domain.d.ts +3 -2
  17. package/abstract-interpretation/domains/set-range-domain.js +3 -2
  18. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +3 -2
  19. package/abstract-interpretation/domains/set-upper-bound-domain.js +3 -2
  20. package/benchmark/calibration.d.ts +18 -11
  21. package/benchmark/calibration.js +37 -27
  22. package/benchmark/slicer.d.ts +9 -2
  23. package/benchmark/slicer.js +44 -37
  24. package/benchmark/stats/count-comments.d.ts +16 -0
  25. package/benchmark/stats/count-comments.js +30 -0
  26. package/benchmark/stats/print.js +2 -0
  27. package/benchmark/stats/size-of.d.ts +7 -3
  28. package/benchmark/stats/size-of.js +7 -3
  29. package/benchmark/stats/stats.d.ts +7 -0
  30. package/benchmark/summarizer/first-phase/process.js +2 -19
  31. package/benchmark/summarizer/second-phase/graph.js +13 -3
  32. package/benchmark/summarizer/second-phase/process.js +2 -0
  33. package/cli/benchmark-app.js +4 -1
  34. package/cli/benchmark-helper-app.d.ts +1 -0
  35. package/cli/benchmark-helper-app.js +2 -2
  36. package/cli/common/options.d.ts +5 -0
  37. package/cli/common/options.js +1 -0
  38. package/cli/common/scripts-info.d.ts +5 -0
  39. package/cli/repl/commands/repl-dataflow.js +70 -27
  40. package/cli/repl/core.d.ts +1 -1
  41. package/cli/repl/core.js +1 -1
  42. package/cli/repl/execute.d.ts +2 -2
  43. package/cli/repl/execute.js +2 -2
  44. package/cli/repl/parser/slice-query-parser.js +2 -1
  45. package/cli/repl/server/connection.d.ts +4 -0
  46. package/cli/repl/server/connection.js +19 -16
  47. package/cli/repl/server/messages/message-analysis.d.ts +1 -1
  48. package/config.d.ts +6 -0
  49. package/config.js +12 -9
  50. package/control-flow/basic-cfg-guided-visitor.d.ts +7 -2
  51. package/control-flow/basic-cfg-guided-visitor.js +37 -24
  52. package/control-flow/cfg-dead-code.js +44 -33
  53. package/control-flow/cfg-properties.js +2 -2
  54. package/control-flow/cfg-simplification.js +6 -5
  55. package/control-flow/cfg-to-basic-blocks.js +11 -13
  56. package/control-flow/control-flow-graph.d.ts +179 -189
  57. package/control-flow/control-flow-graph.js +400 -263
  58. package/control-flow/dfg-cfg-guided-visitor.d.ts +21 -3
  59. package/control-flow/dfg-cfg-guided-visitor.js +17 -13
  60. package/control-flow/diff-cfg.js +6 -14
  61. package/control-flow/happens-before.js +5 -4
  62. package/control-flow/semantic-cfg-guided-visitor.d.ts +44 -101
  63. package/control-flow/semantic-cfg-guided-visitor.js +6 -26
  64. package/control-flow/simple-visitor.js +14 -15
  65. package/control-flow/syntax-cfg-guided-visitor.d.ts +2 -1
  66. package/control-flow/useless-loop.js +18 -14
  67. package/core/steps/all/core/20-dataflow.d.ts +1 -3
  68. package/core/steps/pipeline/default-pipelines.d.ts +141 -157
  69. package/dataflow/cluster.js +7 -0
  70. package/dataflow/environments/apply-kill.d.ts +6 -0
  71. package/dataflow/environments/apply-kill.js +64 -32
  72. package/dataflow/environments/built-in-props.d.ts +10 -2
  73. package/dataflow/environments/built-in-props.js +9 -1
  74. package/dataflow/environments/built-in.d.ts +6 -3
  75. package/dataflow/environments/built-in.js +8 -5
  76. package/dataflow/environments/clone.d.ts +3 -3
  77. package/dataflow/environments/clone.js +5 -5
  78. package/dataflow/environments/default-builtin-config.d.ts +188 -8
  79. package/dataflow/environments/default-builtin-config.js +112 -39
  80. package/dataflow/environments/environment.d.ts +9 -1
  81. package/dataflow/environments/environment.js +25 -7
  82. package/dataflow/environments/identifier.d.ts +12 -1
  83. package/dataflow/environments/identifier.js +4 -1
  84. package/dataflow/environments/query-fn-props.d.ts +6 -0
  85. package/dataflow/environments/query-fn-props.js +20 -0
  86. package/dataflow/environments/resolve-by-name.d.ts +7 -0
  87. package/dataflow/environments/resolve-by-name.js +26 -2
  88. package/dataflow/environments/resolve-helper.d.ts +3 -1
  89. package/dataflow/environments/resolve-helper.js +2 -0
  90. package/dataflow/eval/resolve/alias-tracking.d.ts +2 -2
  91. package/dataflow/eval/resolve/alias-tracking.js +2 -2
  92. package/dataflow/eval/resolve/match-arguments.js +7 -5
  93. package/dataflow/eval/resolve/node-value.d.ts +3 -1
  94. package/dataflow/eval/resolve/node-value.js +12 -0
  95. package/dataflow/eval/resolve/resolve-argument.js +5 -4
  96. package/dataflow/eval/resolve/resolve-operators.js +10 -7
  97. package/dataflow/eval/resolve/resolve-strings.js +2 -2
  98. package/dataflow/eval/resolve/resolve-working-directory.d.ts +1 -1
  99. package/dataflow/eval/resolve/resolve-working-directory.js +5 -5
  100. package/dataflow/eval/resolve/resolve.js +3 -2
  101. package/dataflow/eval/values/general.js +8 -5
  102. package/dataflow/extractor.d.ts +1 -4
  103. package/dataflow/extractor.js +11 -10
  104. package/dataflow/fn/exceptions-of-function.d.ts +6 -2
  105. package/dataflow/fn/exceptions-of-function.js +85 -38
  106. package/dataflow/fn/strict-function.d.ts +40 -0
  107. package/dataflow/fn/strict-function.js +339 -0
  108. package/dataflow/graph/call-graph.js +2 -2
  109. package/dataflow/graph/df-helper.d.ts +17 -2
  110. package/dataflow/graph/df-helper.js +19 -3
  111. package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
  112. package/dataflow/graph/diff-dataflow-graph.js +19 -2
  113. package/dataflow/graph/edge.d.ts +38 -2
  114. package/dataflow/graph/edge.js +32 -2
  115. package/dataflow/graph/graph.d.ts +32 -5
  116. package/dataflow/graph/graph.js +65 -4
  117. package/dataflow/graph/match-args.d.ts +69 -0
  118. package/dataflow/graph/match-args.js +167 -0
  119. package/dataflow/info.d.ts +40 -0
  120. package/dataflow/info.js +28 -1
  121. package/dataflow/internal/control-flow.d.ts +102 -0
  122. package/dataflow/internal/control-flow.js +200 -0
  123. package/dataflow/internal/linker.d.ts +6 -31
  124. package/dataflow/internal/linker.js +24 -81
  125. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
  126. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +3 -3
  127. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +2 -2
  128. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +9 -6
  129. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
  130. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +6 -4
  131. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -10
  132. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +18 -37
  133. package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -1
  134. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -3
  135. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +1 -1
  136. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +11 -7
  137. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
  138. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
  139. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +18 -14
  140. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +8 -1
  141. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +11 -0
  142. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
  143. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +27 -20
  144. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -2
  145. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -1
  146. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +35 -6
  147. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +1 -1
  148. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +20 -17
  149. package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +1 -1
  150. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +6 -4
  151. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +4 -3
  152. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +8 -3
  153. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +2 -2
  154. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +5 -5
  155. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.d.ts +1 -1
  156. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +5 -4
  157. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +7 -5
  158. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +1 -1
  159. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +15 -13
  160. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +2 -2
  161. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
  162. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +4 -3
  163. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +1 -1
  164. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +26 -4
  165. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
  166. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +17 -4
  167. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +3 -2
  168. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +97 -33
  169. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +6 -15
  170. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +12 -13
  171. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  172. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +15 -12
  173. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +15 -1
  174. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
  175. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +12 -8
  176. package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +6 -5
  177. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.d.ts +1 -1
  178. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +5 -4
  179. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
  180. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +45 -10
  181. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
  182. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +19 -3
  183. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +6 -2
  184. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +29 -8
  185. package/dataflow/internal/process/functions/call/common.js +5 -6
  186. package/dataflow/internal/process/functions/call/deferred.js +2 -2
  187. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +12 -2
  188. package/dataflow/internal/process/functions/call/known-call-handling.js +23 -1
  189. package/dataflow/internal/process/functions/call/named-call-handling.js +2 -0
  190. package/dataflow/internal/process/functions/call/nse.d.ts +1 -1
  191. package/dataflow/internal/process/functions/call/nse.js +6 -1
  192. package/dataflow/internal/process/functions/call/quoted.js +2 -2
  193. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +19 -6
  194. package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
  195. package/dataflow/internal/process/functions/process-argument.js +12 -4
  196. package/dataflow/internal/process/functions/process-parameter.js +13 -0
  197. package/dataflow/internal/process/process-named-call.d.ts +2 -2
  198. package/dataflow/internal/process/process-named-call.js +9 -7
  199. package/documentation/data/server/doc-data-server-messages.js +4 -4
  200. package/documentation/doc-readme.js +45 -0
  201. package/documentation/doc-util/doc-cfg.d.ts +8 -7
  202. package/documentation/doc-util/doc-cfg.js +10 -10
  203. package/documentation/doc-util/doc-playground.d.ts +12 -0
  204. package/documentation/doc-util/doc-playground.js +21 -0
  205. package/documentation/doc-util/doc-query.d.ts +4 -1
  206. package/documentation/doc-util/doc-query.js +4 -2
  207. package/documentation/wiki-absint.d.ts +3 -4
  208. package/documentation/wiki-absint.js +12 -5
  209. package/documentation/wiki-analyzer.js +2 -2
  210. package/documentation/wiki-cfg.js +101 -106
  211. package/documentation/wiki-core.js +1 -1
  212. package/documentation/wiki-dataflow-graph.js +85 -53
  213. package/documentation/wiki-linter.js +16 -1
  214. package/documentation/wiki-linting-and-testing.js +1 -16
  215. package/documentation/wiki-mk/doc-maker.js +6 -4
  216. package/documentation/wiki-query.js +67 -4
  217. package/documentation/wiki-signature-database.js +28 -2
  218. package/linter/linter-fix.d.ts +16 -0
  219. package/linter/linter-fix.js +104 -0
  220. package/linter/linter-format.d.ts +18 -1
  221. package/linter/linter-format.js +31 -1
  222. package/linter/linter-output.js +47 -11
  223. package/linter/linter-rules.d.ts +64 -9
  224. package/linter/linter-rules.js +5 -1
  225. package/linter/rules/absolute-path.js +4 -2
  226. package/linter/rules/dataframe-access-validation.js +6 -7
  227. package/linter/rules/deprecated-functions.d.ts +107 -10
  228. package/linter/rules/deprecated-functions.js +309 -23
  229. package/linter/rules/file-path-validity.js +5 -4
  230. package/linter/rules/function-finder-util.d.ts +6 -0
  231. package/linter/rules/function-finder-util.js +21 -13
  232. package/linter/rules/naming-convention.js +1 -1
  233. package/linter/rules/network-functions.d.ts +3 -3
  234. package/linter/rules/stop-with-call-arg.js +2 -2
  235. package/linter/rules/unclosed-connection.d.ts +44 -0
  236. package/linter/rules/unclosed-connection.js +200 -0
  237. package/linter/rules/undefined-symbol-util.js +6 -4
  238. package/linter/rules/undefined-symbol.js +2 -2
  239. package/linter/rules/unused-definition.js +8 -4
  240. package/linter/rules/unused-import.d.ts +60 -0
  241. package/linter/rules/unused-import.js +179 -0
  242. package/package.json +5 -8
  243. package/project/attached-packages.js +2 -1
  244. package/project/cache/flowr-analyzer-cache.d.ts +2 -5
  245. package/project/cache/flowr-analyzer-cache.js +4 -7
  246. package/project/cache/flowr-analyzer-controlflow-cache.d.ts +9 -8
  247. package/project/cache/flowr-analyzer-controlflow-cache.js +17 -34
  248. package/project/cache/flowr-cache.d.ts +9 -0
  249. package/project/cache/flowr-cache.js +19 -0
  250. package/project/context/flowr-analyzer-context.d.ts +7 -3
  251. package/project/context/flowr-analyzer-context.js +15 -9
  252. package/project/context/flowr-analyzer-dependencies-context.d.ts +24 -3
  253. package/project/context/flowr-analyzer-dependencies-context.js +9 -14
  254. package/project/context/flowr-analyzer-files-context.js +15 -17
  255. package/project/context/flowr-analyzer-meta-context.js +2 -12
  256. package/project/dependency-version-space.d.ts +3 -10
  257. package/project/dependency-version-space.js +10 -9
  258. package/project/flowr-analyzer.d.ts +4 -6
  259. package/project/flowr-analyzer.js +4 -5
  260. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +1 -1
  261. package/project/plugins/file-plugins/files/flowr-description-file.js +1 -1
  262. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +1 -1
  263. package/project/plugins/file-plugins/files/flowr-namespace-file.js +23 -35
  264. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +1 -1
  265. package/project/plugins/file-plugins/files/flowr-news-file.js +1 -1
  266. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +13 -13
  267. package/project/plugins/file-plugins/files/flowr-rda-file.js +131 -286
  268. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +1 -0
  269. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +1 -0
  270. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +2 -5
  271. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +2 -8
  272. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +32 -0
  273. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +43 -1
  274. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +4 -12
  275. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +3 -16
  276. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +5 -8
  277. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +4 -10
  278. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +3 -10
  279. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +1 -13
  280. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +3 -6
  281. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +2 -8
  282. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +2 -5
  283. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +2 -8
  284. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +2 -5
  285. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +2 -8
  286. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +3 -4
  287. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +3 -6
  288. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +4 -12
  289. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +3 -16
  290. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +4 -12
  291. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +3 -16
  292. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +4 -12
  293. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -16
  294. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +2 -5
  295. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +2 -8
  296. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.d.ts +2 -6
  297. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.js +1 -10
  298. package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.d.ts +2 -5
  299. package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.js +2 -8
  300. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-library-plugin.js +2 -1
  301. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +5 -5
  302. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +33 -6
  303. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +2 -2
  304. package/project/sigdb/build.d.ts +2 -2
  305. package/project/sigdb/decode.d.ts +0 -5
  306. package/project/sigdb/decode.js +0 -8
  307. package/project/sigdb/index-format.d.ts +4 -4
  308. package/project/sigdb/manifest.d.ts +5 -3
  309. package/project/sigdb/manifest.js +50 -9
  310. package/project/sigdb/reader.d.ts +48 -13
  311. package/project/sigdb/reader.js +3 -2
  312. package/project/sigdb/schema.d.ts +5 -3
  313. package/project/sigdb/schema.js +2 -2
  314. package/project/sigdb/signature-db.d.ts +69 -0
  315. package/project/sigdb/signature-db.js +54 -0
  316. package/project/sigdb/signature-match.d.ts +10 -5
  317. package/project/sigdb/signature-match.js +13 -8
  318. package/queries/catalog/absint-query/absint-query-executor.js +1 -2
  319. package/queries/catalog/call-context-query/call-context-query-executor.js +2 -4
  320. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
  321. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +33 -6
  322. package/queries/catalog/control-flow-query/control-flow-query-executor.js +1 -2
  323. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  324. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +8 -7
  325. package/queries/catalog/dependencies-query/dependencies-query-format.js +22 -35
  326. package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +13 -1
  327. package/queries/catalog/dependencies-query/function-info/library-functions.js +26 -22
  328. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +9 -0
  329. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +19 -0
  330. package/queries/catalog/dependencies-query/implicit-echo.d.ts +13 -0
  331. package/queries/catalog/dependencies-query/implicit-echo.js +133 -0
  332. package/queries/catalog/dependencies-query/link-devices.js +2 -8
  333. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
  334. package/queries/catalog/happens-before-query/happens-before-query-executor.js +1 -2
  335. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -1
  336. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
  337. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -0
  338. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +6 -0
  339. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +25 -0
  340. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +31 -0
  341. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +56 -0
  342. package/queries/catalog/signature-query/signature-query-executor.js +4 -3
  343. package/queries/catalog/slice-query-options.d.ts +1 -1
  344. package/queries/catalog/slice-query-options.js +1 -1
  345. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
  346. package/queries/query-function-filter.d.ts +8 -2
  347. package/queries/query-function-filter.js +11 -1
  348. package/queries/query.d.ts +11 -1
  349. package/queries/query.js +2 -0
  350. package/r-bridge/lang-4.x/ast/model/model.d.ts +4 -4
  351. package/r-bridge/lang-4.x/ast/model/model.js +4 -4
  352. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  353. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  354. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
  355. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
  356. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +4 -1
  357. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +5 -2
  358. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
  359. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
  360. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  361. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
  362. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  363. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
  364. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  365. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
  366. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  367. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
  368. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +6 -4
  369. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +6 -4
  370. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  371. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
  372. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  373. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
  374. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  375. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
  376. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  377. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
  378. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  379. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
  380. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +6 -0
  381. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +13 -0
  382. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
  383. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
  384. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  385. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
  386. package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +1 -0
  387. package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +1 -0
  388. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  389. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
  390. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
  391. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +1 -0
  392. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
  393. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
  394. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
  395. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
  396. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  397. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
  398. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
  399. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
  400. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +3 -2
  401. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then-else.js +2 -1
  402. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +2 -1
  403. package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
  404. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -1
  405. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.d.ts +2 -2
  406. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +6 -3
  407. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +2 -1
  408. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +2 -1
  409. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.js +5 -3
  410. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +2 -1
  411. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -1
  412. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
  413. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +5 -3
  414. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -1
  415. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.d.ts +1 -1
  416. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -1
  417. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +3 -1
  418. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +1 -1
  419. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +2 -1
  420. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +5 -3
  421. package/reconstruct/inline/source-inline-map.js +3 -3
  422. package/reconstruct/reconstruct.js +6 -4
  423. package/search/flowr-search-builder.d.ts +8 -8
  424. package/search/flowr-search-builder.js +4 -4
  425. package/search/flowr-search-filters.d.ts +2 -2
  426. package/search/flowr-search-filters.js +4 -15
  427. package/search/search-executor/search-enrichers.d.ts +6 -4
  428. package/search/search-executor/search-enrichers.js +44 -5
  429. package/slicing/criterion/filters/all-variables.js +2 -1
  430. package/slicing/criterion/parse.d.ts +2 -2
  431. package/slicing/criterion/parse.js +10 -8
  432. package/slicing/static/fingerprint.js +1 -1
  433. package/slicing/static/slice-call.js +2 -2
  434. package/util/arg-matching.d.ts +3 -0
  435. package/util/arg-matching.js +12 -1
  436. package/util/collections/arrays.d.ts +0 -4
  437. package/util/collections/arrays.js +4 -26
  438. package/util/diff-graph.d.ts +1 -1
  439. package/util/diff-graph.js +17 -3
  440. package/util/diff.d.ts +6 -0
  441. package/util/mermaid/ast.d.ts +1 -1
  442. package/util/mermaid/ast.js +5 -4
  443. package/util/mermaid/cfg.js +130 -24
  444. package/util/mermaid/dfg.js +31 -10
  445. package/util/mermaid/mermaid.js +2 -0
  446. package/util/objects.d.ts +21 -0
  447. package/util/objects.js +60 -0
  448. package/util/prefix.d.ts +1 -1
  449. package/util/simple-df/dfg-ascii.js +14 -3
  450. package/util/text/name-rank.d.ts +1 -1
  451. package/util/text/name-rank.js +1 -1
  452. package/util/text/playground-link.d.ts +131 -0
  453. package/util/text/playground-link.js +214 -0
  454. package/util/text/strings.js +7 -3
  455. package/util/version.js +1 -1
  456. package/control-flow/cfg-builder.d.ts +0 -30
  457. package/control-flow/cfg-builder.js +0 -79
  458. package/control-flow/extract-cfg.d.ts +0 -36
  459. package/control-flow/extract-cfg.js +0 -693
  460. package/project/cfg-kind.d.ts +0 -21
  461. package/project/cfg-kind.js +0 -26
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNCLOSED_CONNECTION = void 0;
4
+ const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
5
+ const graph_1 = require("../../dataflow/graph/graph");
6
+ const edge_1 = require("../../dataflow/graph/edge");
7
+ const vertex_1 = require("../../dataflow/graph/vertex");
8
+ const info_1 = require("../../dataflow/info");
9
+ const built_in_props_1 = require("../../dataflow/environments/built-in-props");
10
+ const query_fn_props_1 = require("../../dataflow/environments/query-fn-props");
11
+ const identifier_1 = require("../../dataflow/environments/identifier");
12
+ const flowr_search_builder_1 = require("../../search/flowr-search-builder");
13
+ const range_1 = require("../../util/range");
14
+ const assert_1 = require("../../util/assert");
15
+ const linter_format_1 = require("../linter-format");
16
+ const linter_tags_1 = require("../linter-tags");
17
+ const r_expression_list_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-expression-list");
18
+ /** the edges the connection flows along, from the call opening it to the argument of the call closing it */
19
+ const ConnectionFlow = edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall | edge_1.EdgeType.Returns | edge_1.EdgeType.Argument;
20
+ /** The arguments holding the handle the call acts on, all of them if it does not state which. */
21
+ function handleArguments(vertex, sig) {
22
+ const stated = sig && built_in_props_1.FnSig.posWith(built_in_props_1.FnSig.layout(sig), vertex.args.length, built_in_props_1.ArgProp.Handle);
23
+ return stated?.length ? stated.map(i => vertex.args[i]) : vertex.args;
24
+ }
25
+ /**
26
+ * Adds every opening call whose connection may reach `start`, an argument of a closing call, to `out`.
27
+ * Unlike {@link Dataflow.provenance} this stops at an opening call and follows no control dependency,
28
+ * so a close in a branch does not claim what that branch opens beside it.
29
+ */
30
+ function openCallsReaching(graph, start, opens, out) {
31
+ const visited = new Set([start]);
32
+ const pending = [start];
33
+ while (pending.length > 0) {
34
+ const current = pending.pop();
35
+ if (opens.has(current)) {
36
+ out.add(current);
37
+ continue;
38
+ }
39
+ for (const [target, edge] of graph.outgoingEdges(current) ?? graph_1.NoEdges) {
40
+ if (edge_1.DfEdge.includesType(edge, ConnectionFlow) && !visited.has(target)) {
41
+ visited.add(target);
42
+ pending.push(target);
43
+ }
44
+ }
45
+ }
46
+ }
47
+ /** The variable definition the opened connection is bound to, if it is bound to one. */
48
+ function bindingOf(graph, open) {
49
+ for (const [source, edge] of graph.ingoingEdges(open) ?? graph_1.NoEdges) {
50
+ if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedBy) && vertex_1.VariableDefinitionVertex.is(graph.getVertex(source))) {
51
+ return source;
52
+ }
53
+ }
54
+ return undefined;
55
+ }
56
+ /** The statement `id` belongs to, i.e. the ancestor that is an element of an expression list. */
57
+ function enclosingStatement(idMap, id) {
58
+ let node = idMap.get(id);
59
+ while (node !== undefined) {
60
+ const parent = node.info.parent === undefined ? undefined : idMap.get(node.info.parent);
61
+ if (parent === undefined || r_expression_list_1.RExpressionList.is(parent)) {
62
+ return node;
63
+ }
64
+ node = parent;
65
+ }
66
+ return undefined;
67
+ }
68
+ /** A fix closing the connection after the last statement using it, if it is bound to a name to close. */
69
+ function closeFix(graph, open) {
70
+ const idMap = graph.idMap;
71
+ const definition = bindingOf(graph, open);
72
+ const name = idMap && definition !== undefined ? (0, node_id_1.recoverName)(definition, idMap) : undefined;
73
+ if (idMap === undefined || definition === undefined || name === undefined) {
74
+ return undefined;
75
+ }
76
+ const reads = (graph.ingoingEdges(definition) ?? graph_1.NoEdges).entries()
77
+ .filter(([, edge]) => edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads)).map(([source]) => source);
78
+ const statements = [definition, ...reads]
79
+ .map(id => range_1.SourceLocation.fromNode(enclosingStatement(idMap, id)))
80
+ .filter(assert_1.isNotUndefined);
81
+ const last = statements.reduce((a, b) => a === undefined || range_1.SourceRange.compare(range_1.SourceLocation.getRange(a), range_1.SourceLocation.getRange(b)) < 0 ? b : a, undefined);
82
+ if (last === undefined) {
83
+ return undefined;
84
+ }
85
+ const [startLine, startColumn, endLine, endColumn] = last;
86
+ return [{
87
+ type: 'replace',
88
+ loc: range_1.SourceLocation.from([endLine, endColumn + 1, endLine, endColumn], range_1.SourceLocation.getFile(last)),
89
+ description: `Close the connection with \`close(${name})\``,
90
+ replacement: `\n${' '.repeat(startLine === endLine ? startColumn - 1 : 0)}close(${name})`
91
+ }];
92
+ }
93
+ /**
94
+ * How certain we are that the connection opened at `open` is left open,
95
+ * or `undefined` if the given closing calls close it in every run that opens it.
96
+ */
97
+ function unclosedCertainty(graph, open, closes) {
98
+ if (closes === undefined) {
99
+ return linter_format_1.LintingResultCertainty.Certain;
100
+ }
101
+ const openCds = graph.getVertex(open)?.cds ?? [];
102
+ const uncovered = new Set();
103
+ for (const close of closes) {
104
+ const closeCds = graph.getVertex(close)?.cds ?? [];
105
+ /* opening within a loop and closing outside of it closes the connection of the last iteration only */
106
+ if (info_1.ControlDependency.minus(openCds, closeCds).some(cd => info_1.ControlDependency.isIterated(cd, graph.idMap))) {
107
+ continue;
108
+ }
109
+ const only = info_1.ControlDependency.minus(closeCds, openCds);
110
+ if (only.length === 0) {
111
+ return undefined;
112
+ }
113
+ for (const cd of only) {
114
+ uncovered.add(cd);
115
+ }
116
+ }
117
+ /* the closes may still cover every branch between them, as in `if(p) close(c) else close(c)` */
118
+ return uncovered.size > 0 && info_1.ControlDependency.happensInEveryBranchSet(uncovered) ? undefined : linter_format_1.LintingResultCertainty.Uncertain;
119
+ }
120
+ /** The calls opening and the calls closing a connection, as the props state and the configuration adds. */
121
+ function connectionCalls(elements, dataflow, config) {
122
+ const opensByName = config.openFns.length > 0 ? identifier_1.Identifier.regex(...config.openFns) : undefined;
123
+ const closesByName = config.closeFns.length > 0 ? identifier_1.Identifier.regex(...config.closeFns) : undefined;
124
+ const opens = new Map();
125
+ const closes = [];
126
+ for (const { node } of elements) {
127
+ const stated = (0, query_fn_props_1.callFnProps)(node.info.id, dataflow);
128
+ if (stated === undefined) {
129
+ continue;
130
+ }
131
+ const props = stated.props ?? 0;
132
+ const name = identifier_1.Identifier.toString(stated.name);
133
+ const loc = range_1.SourceLocation.fromNode(node);
134
+ if (loc !== undefined && ((props & built_in_props_1.CallProp.Opens) !== 0 || opensByName?.test(name))) {
135
+ opens.set(node.info.id, loc);
136
+ }
137
+ else if ((props & built_in_props_1.CallProp.Closes) !== 0 || closesByName?.test(name)) {
138
+ const vertex = dataflow.graph.getVertex(node.info.id);
139
+ if (vertex_1.FunctionCallVertex.is(vertex)) {
140
+ closes.push([vertex, stated.sig]);
141
+ }
142
+ }
143
+ }
144
+ return { opens, closes };
145
+ }
146
+ exports.UNCLOSED_CONNECTION = {
147
+ createSearch: () => flowr_search_builder_1.Q.all().filter(vertex_1.VertexType.FunctionCall),
148
+ processSearchResult: async (elements, config, data) => {
149
+ const dataflow = await data.dataflow();
150
+ const graph = dataflow.graph;
151
+ const { opens, closes } = connectionCalls(elements.getElements(), dataflow, config);
152
+ const openIds = new Set(opens.keys());
153
+ const closedBy = new Map();
154
+ for (const [close, sig] of opens.size > 0 ? closes : []) {
155
+ const reached = new Set();
156
+ for (const arg of handleArguments(close, sig)) {
157
+ const ref = graph_1.FunctionArgument.getReference(arg);
158
+ if (ref !== undefined) {
159
+ openCallsReaching(graph, ref, openIds, reached);
160
+ }
161
+ }
162
+ for (const open of reached) {
163
+ const known = closedBy.get(open);
164
+ if (known) {
165
+ known.push(close.id);
166
+ }
167
+ else {
168
+ closedBy.set(open, [close.id]);
169
+ }
170
+ }
171
+ }
172
+ const results = [];
173
+ for (const [open, loc] of opens) {
174
+ const certainty = unclosedCertainty(graph, open, closedBy.get(open));
175
+ if (certainty === undefined) {
176
+ continue;
177
+ }
178
+ /* closing what another path closes as well errors in R, so only a connection nothing closes gets a fix */
179
+ const quickFix = certainty === linter_format_1.LintingResultCertainty.Certain ? closeFix(graph, open) : undefined;
180
+ results.push({ certainty, involvedId: open, loc, ...(quickFix ? { quickFix } : {}) });
181
+ }
182
+ return { results, '.meta': { totalOpened: opens.size, totalClosed: closes.length } };
183
+ },
184
+ prettyPrint: {
185
+ [linter_format_1.LintingPrettyPrintContext.Query]: result => `Unclosed connection at ${range_1.SourceLocation.format(result.loc)}`,
186
+ [linter_format_1.LintingPrettyPrintContext.Full]: result => `The connection opened at ${range_1.SourceLocation.format(result.loc)} is not closed on every path that opens it`
187
+ },
188
+ info: {
189
+ name: 'Unclosed Connection',
190
+ tags: [linter_tags_1.LintingRuleTag.Robustness, linter_tags_1.LintingRuleTag.Smell],
191
+ /* a connection handed to code flowR cannot resolve, as in `lapply(cons, close)`, is reported although it is closed */
192
+ certainty: linter_format_1.LintingRuleCertainty.BestEffort,
193
+ description: 'Flags connections that are opened but not closed on every path opening them.',
194
+ defaultConfig: {
195
+ openFns: [],
196
+ closeFns: []
197
+ }
198
+ }
199
+ };
200
+ //# sourceMappingURL=unclosed-connection.js.map
@@ -12,6 +12,8 @@ const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id"
12
12
  const vertex_1 = require("../../dataflow/graph/vertex");
13
13
  const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
14
14
  const graph_1 = require("../../dataflow/graph/graph");
15
+ const r_access_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-access");
16
+ const r_function_definition_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
15
17
  /**
16
18
  * Path heuristic for an R package `inst/` resource (installed verbatim, not namespace source). Fallback for
17
19
  * the authoritative `FileRole.Install`, covering requests that bypass the file-role plugins.
@@ -60,10 +62,10 @@ function isInSubscript(graph, id) {
60
62
  let parentId = idMap.get(id)?.info.parent;
61
63
  for (let guard = 0; parentId !== undefined && guard < 64; guard++) {
62
64
  const parent = idMap.get(parentId);
63
- if (parent === undefined || parent.type === type_1.RType.FunctionDefinition) {
65
+ if (parent === undefined || r_function_definition_1.RFunctionDefinition.is(parent)) {
64
66
  return false;
65
67
  }
66
- if (parent.type === type_1.RType.Access && (parent.operator === '[' || parent.operator === '[[') && parent.accessed.info.id !== childId) {
68
+ if (r_access_1.RAccess.is(parent) && (parent.operator === '[' || parent.operator === '[[') && parent.accessed.info.id !== childId) {
67
69
  return true; // reached from a subscript, not the accessed object
68
70
  }
69
71
  childId = parentId;
@@ -87,7 +89,7 @@ function enclosingScope(idMap, startParent) {
87
89
  if (node === undefined) {
88
90
  break;
89
91
  }
90
- if (node.type === type_1.RType.FunctionDefinition) {
92
+ if (r_function_definition_1.RFunctionDefinition.is(node)) {
91
93
  return { scope: cur, unconditional };
92
94
  }
93
95
  if (ConditionalNodeTypes.has(node.type)) {
@@ -145,7 +147,7 @@ function isDefinedInEnclosingScope(graph, defined, useId, name) {
145
147
  if (node === undefined) {
146
148
  break;
147
149
  }
148
- if (node.type === type_1.RType.FunctionDefinition && defined.get(cur)?.has(name)) {
150
+ if (r_function_definition_1.RFunctionDefinition.is(node) && defined.get(cur)?.has(name)) {
149
151
  return true;
150
152
  }
151
153
  cur = node.info.parent;
@@ -9,12 +9,12 @@ const flowr_search_filters_1 = require("../../search/flowr-search-filters");
9
9
  const assert_1 = require("../../util/assert");
10
10
  const range_1 = require("../../util/range");
11
11
  const flowr_file_1 = require("../../project/context/flowr-file");
12
- const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
13
12
  const r_base_packages_1 = require("../../util/r-base-packages");
14
13
  const linter_format_1 = require("../linter-format");
15
14
  const linter_tags_1 = require("../linter-tags");
16
15
  const undefined_symbol_util_1 = require("./undefined-symbol-util");
17
16
  const df_helper_1 = require("../../dataflow/graph/df-helper");
17
+ const r_symbol_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
18
18
  /** calls that load a package; an unresolved one means we cannot enumerate all exports in scope */
19
19
  const LibraryLoadFunctions = new Set(['library', 'require', 'requireNamespace', 'loadNamespace', 'attachNamespace', 'load_all', 'use', 'p_load']);
20
20
  // standard packages attached by default; exports are in scope without library()
@@ -108,7 +108,7 @@ exports.UNDEFINED_SYMBOL = {
108
108
  // variable use: only plain symbols (not argument names, `...`, or empty)
109
109
  if (vertex_1.UseVertex.is(vtx) && config.checkVariables) {
110
110
  const node = element.node;
111
- if (node.type !== type_1.RType.Symbol || node.lexeme === '...' || node.lexeme === undefined) {
111
+ if (!r_symbol_1.RSymbol.is(node) || node.lexeme === '...' || node.lexeme === undefined) {
112
112
  return undefined;
113
113
  }
114
114
  meta.totalVariableUses++;
@@ -12,7 +12,6 @@ const flowr_search_filters_1 = require("../../search/flowr-search-filters");
12
12
  const flowr_file_1 = require("../../project/context/flowr-file");
13
13
  const flowr_namespace_file_1 = require("../../project/plugins/file-plugins/files/flowr-namespace-file");
14
14
  const identifier_1 = require("../../dataflow/environments/identifier");
15
- const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
16
15
  const retriever_1 = require("../../r-bridge/retriever");
17
16
  const query_fn_props_1 = require("../../dataflow/environments/query-fn-props");
18
17
  const built_in_props_1 = require("../../dataflow/environments/built-in-props");
@@ -20,6 +19,7 @@ const default_builtin_config_1 = require("../../dataflow/environments/default-bu
20
19
  const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
21
20
  const r_function_definition_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
22
21
  const graph_1 = require("../../dataflow/graph/graph");
22
+ const r_parameter_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-parameter");
23
23
  /**
24
24
  * The dots parameter is a special parameter and must never be reported as an unused definition.
25
25
  */
@@ -167,9 +167,13 @@ function buildQuickFix(variable, dfg, ast) {
167
167
  return vertex ? range_1.SourceLocation.fromNode(vertex) : undefined;
168
168
  }),
169
169
  variable.info.fullRange ?? variable.location]);
170
+ if (totalRangeToRemove === undefined) {
171
+ /* a fix that names no place cannot be carried out, so none is offered */
172
+ return undefined;
173
+ }
170
174
  return [{
171
175
  type: 'remove',
172
- loc: totalRangeToRemove ?? range_1.SourceLocation.invalid(),
176
+ loc: totalRangeToRemove,
173
177
  description: `Remove unused definition of \`${variable.lexeme}\``
174
178
  }];
175
179
  }
@@ -195,10 +199,10 @@ function isWithinPromise(node, idMap) {
195
199
  if (parent === undefined) {
196
200
  return false;
197
201
  }
198
- if (parent.type === type_1.RType.Parameter && parent.defaultValue?.info.id === child.info.id) {
202
+ if (r_parameter_1.RParameter.is(parent) && parent.defaultValue?.info.id === child.info.id) {
199
203
  return true;
200
204
  }
201
- if (parent.type === type_1.RType.FunctionCall && parent.named && identifier_1.Identifier.getName(parent.functionName.content) === 'delayedAssign') {
205
+ if (r_function_call_1.RFunctionCall.isNamed(parent) && identifier_1.Identifier.getName(parent.functionName.content) === 'delayedAssign') {
202
206
  return true;
203
207
  }
204
208
  child = parent;
@@ -0,0 +1,60 @@
1
+ import { type LintingResult, LintingResultCertainty, LintingRuleCertainty, type LintQuickFix } from '../linter-format';
2
+ import type { MergeableRecord } from '../../util/objects';
3
+ import { LintingRuleTag } from '../linter-tags';
4
+ import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
5
+ import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
6
+ export interface UnusedImportResult extends LintingResult {
7
+ /** the package the flagged call attaches */
8
+ readonly package: string;
9
+ /** the version whose exports the finding was checked against, as the signature database resolved it */
10
+ readonly version: string;
11
+ }
12
+ export interface UnusedImportConfig extends MergeableRecord {
13
+ /** packages that do their work on load and hence should never be reported, however unused they look */
14
+ whitelist: string[];
15
+ }
16
+ export interface UnusedImportMetadata extends MergeableRecord {
17
+ /** attaching calls the rule looked at */
18
+ totalConsidered: number;
19
+ /** skipped because the database could not resolve the package the call names */
20
+ totalUnresolved: number;
21
+ /** skipped because one call attaches several packages at once */
22
+ totalMultiPackage: number;
23
+ /** the attaches reported as unused */
24
+ totalUnused: number;
25
+ }
26
+ /**
27
+ * Flags packages that are attached but never used, so dropping the `library`/`require` call would leave the code running
28
+ * just the same. A package counts as used as soon as any call resolves into it or anything reads one of its exports.
29
+ *
30
+ * Needs a signature database to know what a package exports; without one the rule reports nothing. Packages the database
31
+ * does not know, packages whose namespace loads with side effects, and those in the
32
+ * {@link UnusedImportConfig#whitelist|whitelist} are skipped. Every step errs towards keeping an import.
33
+ */
34
+ export declare const UNUSED_IMPORT: {
35
+ readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from-query", [], ParentInformation, import("../../search/flowr-search").FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>>;
36
+ readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>, config: UnusedImportConfig, data: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>) => Promise<{
37
+ results: {
38
+ certainty: LintingResultCertainty;
39
+ involvedId: NodeId;
40
+ loc: [startLine: number, startColumn: number, endLine: number, endColumn: number, f?: string | undefined];
41
+ package: string;
42
+ version: string;
43
+ quickFix: LintQuickFix[] | undefined;
44
+ }[];
45
+ '.meta': UnusedImportMetadata;
46
+ }>;
47
+ readonly prettyPrint: {
48
+ readonly query: (result: UnusedImportResult) => string;
49
+ readonly full: (result: UnusedImportResult) => string;
50
+ };
51
+ readonly info: {
52
+ readonly name: "Unused Import";
53
+ readonly tags: readonly [LintingRuleTag.Smell, LintingRuleTag.Readability, LintingRuleTag.QuickFix];
54
+ readonly certainty: LintingRuleCertainty.BestEffort;
55
+ readonly description: "Highlights packages that are attached but never used, so the code runs just the same without them. Requires a signature database, and packages that only do their work on load should be whitelisted in the configuration.";
56
+ readonly defaultConfig: {
57
+ readonly whitelist: readonly [];
58
+ };
59
+ };
60
+ };
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNUSED_IMPORT = void 0;
4
+ const linter_format_1 = require("../linter-format");
5
+ const range_1 = require("../../util/range");
6
+ const flowr_search_builder_1 = require("../../search/flowr-search-builder");
7
+ const linter_tags_1 = require("../linter-tags");
8
+ const df_helper_1 = require("../../dataflow/graph/df-helper");
9
+ const graph_1 = require("../../dataflow/graph/graph");
10
+ const edge_1 = require("../../dataflow/graph/edge");
11
+ const vertex_1 = require("../../dataflow/graph/vertex");
12
+ const identifier_1 = require("../../dataflow/environments/identifier");
13
+ const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
14
+ const dependencies_query_format_1 = require("../../queries/catalog/dependencies-query/dependencies-query-format");
15
+ const library_functions_1 = require("../../queries/catalog/dependencies-query/function-info/library-functions");
16
+ const r_expression_list_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-expression-list");
17
+ /**
18
+ * Whether the loader a `library`-category finding came from attaches the package, taken from the one place that
19
+ * says so. A call this does not know attaches nothing either: `pkg::fn` is reported as a loader of `pkg` and is no
20
+ * import of its own, and neither is whatever else may come to be reported here. Matching ignores the loader's own
21
+ * namespace, so `base::require` is caught just as well as a bare `require`.
22
+ */
23
+ function attachesPackage(info) {
24
+ return library_functions_1.LibraryFunctions.some(loader => loader.attaches && identifier_1.Identifier.matches(loader.name, info.functionName));
25
+ }
26
+ /** whether the call reaches no definition of the analyzed code itself */
27
+ function isUnbound(graph, id) {
28
+ const origins = df_helper_1.Dataflow.origin(graph, id);
29
+ return origins === undefined || origins.every(o => o.type === 3 /* OriginType.BuiltInFunctionOrigin */);
30
+ }
31
+ /** whether removing the call would empty a slot the syntax requires, as in an unbraced `if(c) library(x)` */
32
+ function removalWouldBreakSyntax(node, idMap) {
33
+ const parent = node.info.parent === undefined ? undefined : idMap.get(node.info.parent);
34
+ return r_expression_list_1.RExpressionList.isImplicit(parent) && parent.children.length === 1 && parent.info.role !== "root" /* RoleInParent.Root */;
35
+ }
36
+ /** whether anything reads out of the attach itself */
37
+ function isReadFrom(graph, id) {
38
+ for (const edge of (graph.ingoingEdges(id) ?? graph_1.NoEdges).values()) {
39
+ if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads)) {
40
+ return true;
41
+ }
42
+ }
43
+ return false;
44
+ }
45
+ /**
46
+ * Which of the `attachments` the program never makes use of. A call that resolves names its package outright;
47
+ * one that does not bind yet (a call in a function body) keeps every attached package exporting its name.
48
+ */
49
+ function unusedPackages(attachments, graph) {
50
+ const pending = new Set(attachments.map(a => a.name));
51
+ const unbound = new Set();
52
+ for (const [id, qualified] of df_helper_1.Dataflow.qualifyAll(graph)) {
53
+ const namespace = qualified === undefined ? undefined : identifier_1.Identifier.getNamespace(qualified);
54
+ if (namespace !== undefined) {
55
+ pending.delete(namespace);
56
+ if (pending.size === 0) {
57
+ return pending;
58
+ }
59
+ continue;
60
+ }
61
+ const vertex = graph.getVertex(id);
62
+ if (vertex_1.FunctionCallVertex.is(vertex) && isUnbound(graph, id)) {
63
+ unbound.add(identifier_1.Identifier.getName(vertex.name));
64
+ }
65
+ }
66
+ for (const { name, callable } of attachments) {
67
+ if (!pending.has(name)) {
68
+ continue;
69
+ }
70
+ for (const call of unbound) {
71
+ if (callable.has(call)) {
72
+ pending.delete(name);
73
+ break;
74
+ }
75
+ }
76
+ }
77
+ return pending;
78
+ }
79
+ /**
80
+ * Flags packages that are attached but never used, so dropping the `library`/`require` call would leave the code running
81
+ * just the same. A package counts as used as soon as any call resolves into it or anything reads one of its exports.
82
+ *
83
+ * Needs a signature database to know what a package exports; without one the rule reports nothing. Packages the database
84
+ * does not know, packages whose namespace loads with side effects, and those in the
85
+ * {@link UnusedImportConfig#whitelist|whitelist} are skipped. Every step errs towards keeping an import.
86
+ */
87
+ exports.UNUSED_IMPORT = {
88
+ createSearch: () => flowr_search_builder_1.Q.fromQuery({ type: 'dependencies', enabledCategories: ['library'] }),
89
+ processSearchResult: async (elements, config, data) => {
90
+ const metadata = { totalConsidered: 0, totalUnresolved: 0, totalMultiPackage: 0, totalUnused: 0 };
91
+ const deps = data.inspectContext().deps;
92
+ if (!deps.hasSignatureDatabase()) {
93
+ return { results: [], '.meta': metadata };
94
+ }
95
+ const whitelist = new Set(config.whitelist);
96
+ // one call may name more than one package, so the query can report it several times under the same id
97
+ const attachedBy = new Map();
98
+ for (const info of elements.enrichmentContent(search_enrichers_1.Enrichment.QueryData).queries['dependencies'].library) {
99
+ const known = attachedBy.get(info.nodeId);
100
+ if (known === undefined) {
101
+ attachedBy.set(info.nodeId, [info]);
102
+ }
103
+ else {
104
+ known.push(info);
105
+ }
106
+ }
107
+ const attachments = [];
108
+ const seen = new Set();
109
+ for (const { node } of elements.getElements()) {
110
+ const infos = attachedBy.get(node.info.id);
111
+ if (infos === undefined || seen.has(node.info.id) || !attachesPackage(infos[0])) {
112
+ continue;
113
+ }
114
+ seen.add(node.info.id);
115
+ metadata.totalConsidered++;
116
+ if (infos.length > 1) {
117
+ // a dynamic attach, e.g. `for(p in pkgs) library(p, character.only = TRUE)`; naming one of them would be a guess
118
+ metadata.totalMultiPackage++;
119
+ continue;
120
+ }
121
+ const name = infos[0].value;
122
+ if (name === undefined || name === dependencies_query_format_1.Unknown) {
123
+ metadata.totalUnresolved++;
124
+ continue;
125
+ }
126
+ if (whitelist.has(name)) {
127
+ continue;
128
+ }
129
+ const pkg = deps.getDependency(name);
130
+ const loc = range_1.SourceLocation.fromNode(node);
131
+ if (pkg?.resolvedVersion === undefined || loc === undefined) {
132
+ metadata.totalUnresolved++;
133
+ continue;
134
+ }
135
+ if (pkg.namespaceInfo?.loadsWithSideEffects) {
136
+ continue;
137
+ }
138
+ attachments.push({
139
+ id: node.info.id,
140
+ node,
141
+ loc,
142
+ name,
143
+ version: pkg.resolvedVersion,
144
+ callable: new Set(pkg.namespaceInfo?.callable)
145
+ });
146
+ }
147
+ if (attachments.length === 0) {
148
+ return { results: [], '.meta': metadata };
149
+ }
150
+ const { graph } = await data.dataflow();
151
+ const idMap = (await data.normalize()).idMap;
152
+ const unused = unusedPackages(attachments, graph);
153
+ const results = attachments.filter(({ id, name }) => unused.has(name) && !isReadFrom(graph, id)).map(({ id, node, loc, name, version }) => ({
154
+ certainty: linter_format_1.LintingResultCertainty.Uncertain,
155
+ involvedId: id,
156
+ loc,
157
+ package: name,
158
+ version,
159
+ quickFix: removalWouldBreakSyntax(node, idMap) ? undefined
160
+ : [{ type: 'remove', description: `Remove the unused import of ${name}`, loc }]
161
+ }));
162
+ metadata.totalUnused = results.length;
163
+ return { results, '.meta': metadata };
164
+ },
165
+ prettyPrint: {
166
+ [linter_format_1.LintingPrettyPrintContext.Query]: result => `Import of ${result.package} at ${range_1.SourceLocation.format(result.loc)}`,
167
+ [linter_format_1.LintingPrettyPrintContext.Full]: result => `Import of ${result.package} at ${range_1.SourceLocation.format(result.loc)} is unused (checked v${result.version}).`
168
+ },
169
+ info: {
170
+ name: 'Unused Import',
171
+ tags: [linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Readability, linter_tags_1.LintingRuleTag.QuickFix],
172
+ certainty: linter_format_1.LintingRuleCertainty.BestEffort,
173
+ description: 'Highlights packages that are attached but never used, so the code runs just the same without them. Requires a signature database, and packages that only do their work on load should be whitelisted in the configuration.',
174
+ defaultConfig: {
175
+ whitelist: []
176
+ }
177
+ }
178
+ };
179
+ //# sourceMappingURL=unused-import.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.14.0",
3
+ "version": "2.14.2",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -186,8 +186,8 @@
186
186
  "@codemirror/legacy-modes": "^6.5.3",
187
187
  "@commitlint/cli": "^20.5.0",
188
188
  "@commitlint/config-angular": "^20.5.0",
189
- "@eagleoutice/eslint-config-flowr": "^2.1.1",
190
- "@j-ulrich/release-it-regex-bumper": "^5.4.0",
189
+ "@eagleoutice/eslint-config-flowr": "^2.1.3",
190
+ "@j-ulrich/release-it-regex-bumper": "^5.6.0",
191
191
  "@types/command-line-args": "^5.2.3",
192
192
  "@types/command-line-usage": "^5.0.4",
193
193
  "@types/commonmark": "^0.27.10",
@@ -195,7 +195,6 @@
195
195
  "@types/n-readlines": "^1.0.6",
196
196
  "@types/n3": "^1.26.0",
197
197
  "@types/object-hash": "^3.0.6",
198
- "@types/object-path": "^0.11.4",
199
198
  "@types/seedrandom": "^3.0.8",
200
199
  "@types/semver": "^7.7.0",
201
200
  "@types/tmp": "^0.2.6",
@@ -205,7 +204,7 @@
205
204
  "esbuild": "^0.28.1",
206
205
  "eslint": "^10.8.0",
207
206
  "license-checker-rseidelsohn": "^4.4.2",
208
- "release-it": "^20.0.0",
207
+ "release-it": "^21.0.2",
209
208
  "seedrandom": "^3.0.5",
210
209
  "ts-node": "^10.9.2",
211
210
  "typedoc": "^0.28.17",
@@ -217,19 +216,16 @@
217
216
  "dependencies": {
218
217
  "@davisvaughan/tree-sitter-r": "^1.2.0",
219
218
  "@jupyterlab/nbformat": "^4.5.4",
220
- "@xmldom/xmldom": "^0.9.7",
221
219
  "bzip2": "^0.1.1",
222
220
  "command-line-args": "^6.0.1",
223
221
  "command-line-usage": "^7.0.3",
224
222
  "commonmark": "^0.31.2",
225
- "dagre": "^0.8.5",
226
223
  "gray-matter": "^4.0.3",
227
224
  "ignore": "^5.3.2",
228
225
  "joi": "^18.0.1",
229
226
  "lz-string": "^1.5.0",
230
227
  "n-readlines": "^3.4.1",
231
228
  "object-hash": "^3.0.0",
232
- "object-path": "^0.11.8",
233
229
  "object-sizeof": "^2.6.5",
234
230
  "semver": "^7.7.4",
235
231
  "smol-toml": "^1.7.0",
@@ -248,6 +244,7 @@
248
244
  },
249
245
  "optionalDependencies": {
250
246
  "clipboardy": "^4.0.0",
247
+ "dagre": "^0.8.5",
251
248
  "n3": "^1.26.0",
252
249
  "rotating-file-stream": "^3.2.8"
253
250
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MetaPackageCores = void 0;
4
4
  exports.attachedAlongside = attachedAlongside;
5
+ const arrays_1 = require("../util/collections/arrays");
5
6
  /**
6
7
  * Packages that attach further packages from their `.onAttach` hook, which no package metadata records: their core
7
8
  * set sits in `Imports`, indistinguishable from the packages they merely use. Whoever loads one of them gets the
@@ -25,6 +26,6 @@ function attachedAlongside(pack, sources, version) {
25
26
  .flatMap(src => src.dependencies(pack, version) ?? [])
26
27
  .filter(d => d.type === 0 /* DepType.Depends */ && d.name !== 'R')
27
28
  .map(d => d.name);
28
- return [...new Set([...depends, ...exports.MetaPackageCores.get(pack) ?? []])];
29
+ return (0, arrays_1.uniqueArray)([...depends, ...exports.MetaPackageCores.get(pack) ?? []]);
29
30
  }
30
31
  //# sourceMappingURL=attached-packages.js.map
@@ -7,7 +7,6 @@ import type { TreeSitterExecutor } from '../../r-bridge/lang-4.x/tree-sitter/tre
7
7
  import type { PipelineOutput } from '../../core/steps/pipeline/pipeline';
8
8
  import type { CfgSimplificationPassName } from '../../control-flow/cfg-simplification';
9
9
  import type { ControlFlowInformation } from '../../control-flow/control-flow-graph';
10
- import type { CfgKind } from '../cfg-kind';
11
10
  import type { FlowrAnalyzerContext } from '../context/flowr-analyzer-context';
12
11
  import { CallGraph } from '../../dataflow/graph/call-graph';
13
12
  interface FlowrAnalyzerCacheOptions<Parser extends KnownParser> {
@@ -75,17 +74,15 @@ export declare class FlowrAnalyzerCache<Parser extends KnownParser> extends Flow
75
74
  /**
76
75
  * Get the control flow graph (CFG) for the request, computing if necessary.
77
76
  * @param force - Do not use the cache, instead force new analyses.
78
- * @param kind - The kind of CFG that is requested.
79
77
  * @param simplifications - Simplification passes to be applied to the CFG.
80
78
  */
81
- controlflow(force: boolean | undefined, kind: CfgKind, simplifications?: readonly CfgSimplificationPassName[]): Promise<ControlFlowInformation>;
79
+ controlflow(force: boolean | undefined, simplifications?: readonly CfgSimplificationPassName[]): Promise<ControlFlowInformation>;
82
80
  /**
83
81
  * Get the control flow graph (CFG) for the request if already available, otherwise return `undefined`.
84
- * @param kind - The kind of CFG that is requested.
85
82
  * @param simplifications - Simplification passes to be applied to the CFG.
86
83
  * @see {@link FlowrAnalyzerCache#controlflow} - to get the control flow graph, computing if necessary.
87
84
  */
88
- peekControlflow(kind: CfgKind, simplifications: readonly CfgSimplificationPassName[] | undefined): ControlFlowInformation | undefined;
85
+ peekControlflow(simplifications: readonly CfgSimplificationPassName[] | undefined): ControlFlowInformation | undefined;
89
86
  /**
90
87
  * Get the call graph for the request, computing if necessary.
91
88
  * @param force - Do not use the cache, instead force new analyses.