@eagleoutice/flowr 2.14.4 → 2.15.1

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 (384) hide show
  1. package/README.md +77 -64
  2. package/abstract-interpretation/absint-inference.d.ts +347 -0
  3. package/abstract-interpretation/{absint-visitor.js → absint-inference.js} +327 -97
  4. package/abstract-interpretation/abstract-semantics.d.ts +246 -0
  5. package/abstract-interpretation/abstract-semantics.js +3 -0
  6. package/abstract-interpretation/data-frame/{mappers/arguments.d.ts → arguments.d.ts} +18 -16
  7. package/abstract-interpretation/data-frame/{mappers/arguments.js → arguments.js} +20 -21
  8. package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +52 -0
  9. package/abstract-interpretation/data-frame/dataframe-semantics.js +1665 -0
  10. package/abstract-interpretation/data-frame/resolve-args.js +4 -4
  11. package/abstract-interpretation/data-frame/semantics.d.ts +15 -21
  12. package/abstract-interpretation/data-frame/semantics.js +27 -29
  13. package/abstract-interpretation/data-frame/shape-inference.d.ts +28 -24
  14. package/abstract-interpretation/data-frame/shape-inference.js +14 -79
  15. package/abstract-interpretation/domains/interval-domain.d.ts +5 -1
  16. package/abstract-interpretation/domains/interval-domain.js +25 -33
  17. package/abstract-interpretation/domains/multi-value-state-domain.d.ts +6 -3
  18. package/abstract-interpretation/domains/multi-value-state-domain.js +24 -4
  19. package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -6
  20. package/abstract-interpretation/domains/partial-product-domain.js +26 -43
  21. package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -6
  22. package/abstract-interpretation/domains/positive-interval-domain.js +3 -29
  23. package/abstract-interpretation/domains/product-domain.d.ts +1 -1
  24. package/abstract-interpretation/domains/set-range-domain.d.ts +6 -0
  25. package/abstract-interpretation/domains/set-range-domain.js +29 -62
  26. package/abstract-interpretation/domains/state-abstract-domain.d.ts +9 -2
  27. package/abstract-interpretation/domains/state-abstract-domain.js +26 -37
  28. package/abstract-interpretation/domains/{state-domain-like.d.ts → state-domain.d.ts} +10 -6
  29. package/abstract-interpretation/domains/{state-domain-like.js → state-domain.js} +1 -1
  30. package/abstract-interpretation/value-semantics.d.ts +113 -0
  31. package/abstract-interpretation/value-semantics.js +115 -0
  32. package/benchmark/slicer.js +12 -6
  33. package/benchmark/stats/feature-counts.d.ts +2 -1
  34. package/benchmark/stats/feature-counts.js +25 -1
  35. package/benchmark/stats/stats.d.ts +4 -0
  36. package/benchmark/summarizer/second-phase/graph.js +7 -0
  37. package/cli/repl/commands/repl-parse.js +11 -22
  38. package/cli/repl/parser/slice-query-parser.d.ts +2 -0
  39. package/cli/repl/parser/slice-query-parser.js +1 -0
  40. package/config.d.ts +30 -205
  41. package/config.js +37 -3
  42. package/control-flow/cfg-properties.d.ts +5 -0
  43. package/control-flow/cfg-properties.js +25 -7
  44. package/control-flow/control-flow-graph.d.ts +11 -37
  45. package/control-flow/control-flow-graph.js +33 -77
  46. package/control-flow/semantic-cfg-guided-visitor.d.ts +63 -320
  47. package/control-flow/semantic-cfg-guided-visitor.js +65 -320
  48. package/dataflow/environments/built-in-config.d.ts +2 -0
  49. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  50. package/dataflow/environments/built-in-proc-name.js +4 -0
  51. package/dataflow/environments/built-in-props.d.ts +192 -82
  52. package/dataflow/environments/built-in-props.js +336 -106
  53. package/dataflow/environments/built-in.d.ts +21 -9
  54. package/dataflow/environments/built-in.js +43 -12
  55. package/dataflow/environments/default-builtin-config.d.ts +3219 -313
  56. package/dataflow/environments/default-builtin-config.js +803 -1012
  57. package/dataflow/environments/environment.d.ts +26 -49
  58. package/dataflow/environments/environment.js +34 -47
  59. package/dataflow/environments/group-generics.d.ts +11 -2
  60. package/dataflow/environments/group-generics.js +22 -3
  61. package/dataflow/environments/identifier.d.ts +106 -6
  62. package/dataflow/environments/identifier.js +19 -1
  63. package/dataflow/environments/query-fn-props.d.ts +16 -8
  64. package/dataflow/environments/query-fn-props.js +45 -21
  65. package/dataflow/environments/resolve-by-name.js +9 -2
  66. package/dataflow/environments/scoping.d.ts +5 -0
  67. package/dataflow/environments/scoping.js +11 -0
  68. package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
  69. package/dataflow/eval/resolve/alias-tracking.js +24 -6
  70. package/dataflow/eval/resolve/resolve-numbers.d.ts +182 -7
  71. package/dataflow/eval/resolve/resolve-numbers.js +44 -9
  72. package/dataflow/eval/resolve/resolve-strings.d.ts +79 -2
  73. package/dataflow/eval/resolve/resolve-strings.js +16 -7
  74. package/dataflow/eval/resolve/resolve.d.ts +5 -22
  75. package/dataflow/eval/resolve/resolve.js +34 -34
  76. package/dataflow/eval/values/general.d.ts +9 -1
  77. package/dataflow/eval/values/general.js +22 -3
  78. package/dataflow/eval/values/sets/set-constants.d.ts +5 -0
  79. package/dataflow/eval/values/sets/set-constants.js +9 -1
  80. package/dataflow/eval/values/string/string-constants.d.ts +16 -15
  81. package/dataflow/eval/values/string/string-constants.js +59 -27
  82. package/dataflow/extractor.d.ts +2 -1
  83. package/dataflow/extractor.js +16 -4
  84. package/dataflow/fn/argument-roles.d.ts +35 -0
  85. package/dataflow/fn/argument-roles.js +252 -0
  86. package/dataflow/fn/class-declaration.d.ts +148 -0
  87. package/dataflow/fn/class-declaration.js +317 -0
  88. package/dataflow/fn/condition-handlers.d.ts +5 -0
  89. package/dataflow/fn/condition-handlers.js +13 -0
  90. package/dataflow/fn/exceptions-of-function.d.ts +21 -7
  91. package/dataflow/fn/exceptions-of-function.js +74 -43
  92. package/dataflow/fn/frame-reflection.d.ts +46 -0
  93. package/dataflow/fn/frame-reflection.js +169 -0
  94. package/dataflow/fn/function-props.d.ts +32 -0
  95. package/dataflow/fn/function-props.js +160 -0
  96. package/dataflow/fn/higher-order-function.d.ts +23 -5
  97. package/dataflow/fn/higher-order-function.js +64 -18
  98. package/dataflow/fn/strict-function.d.ts +24 -2
  99. package/dataflow/fn/strict-function.js +49 -19
  100. package/dataflow/graph/call-graph.js +10 -2
  101. package/dataflow/graph/df-helper.d.ts +1 -12
  102. package/dataflow/graph/df-helper.js +2 -19
  103. package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
  104. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  105. package/dataflow/graph/graph.d.ts +39 -188
  106. package/dataflow/graph/graph.js +46 -163
  107. package/dataflow/graph/match-args.d.ts +34 -2
  108. package/dataflow/graph/match-args.js +45 -12
  109. package/dataflow/graph/vertex.d.ts +8 -0
  110. package/dataflow/info.d.ts +7 -5
  111. package/dataflow/info.js +1 -5
  112. package/dataflow/internal/control-flow.js +20 -17
  113. package/dataflow/internal/linker.d.ts +8 -37
  114. package/dataflow/internal/linker.js +22 -55
  115. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -2
  116. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -8
  117. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -4
  118. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +8 -14
  119. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +43 -50
  120. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +4 -1
  121. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +5 -2
  122. package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.d.ts +23 -0
  123. package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.js +24 -0
  124. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -2
  125. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
  126. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +0 -4
  127. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +73 -27
  128. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -11
  129. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +131 -92
  130. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +17 -12
  131. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +187 -99
  132. package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +4 -0
  133. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -0
  134. package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +2 -3
  135. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +4 -3
  136. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
  137. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -2
  138. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +0 -1
  139. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -1
  140. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +31 -0
  141. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +101 -0
  142. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +2 -1
  143. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +7 -0
  144. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +23 -21
  145. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +1 -2
  146. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -2
  147. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +2 -1
  148. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +22 -1
  149. package/dataflow/internal/process/functions/call/common.d.ts +4 -6
  150. package/dataflow/internal/process/functions/call/common.js +2 -2
  151. package/dataflow/internal/process/functions/call/deferred.d.ts +1 -1
  152. package/dataflow/internal/process/functions/call/deferred.js +2 -2
  153. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +5 -3
  154. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -4
  155. package/dataflow/internal/process/functions/call/named-call-handling.js +19 -13
  156. package/dataflow/internal/process/functions/call/quoted.d.ts +2 -2
  157. package/dataflow/internal/process/functions/call/quoted.js +144 -28
  158. package/dataflow/origin/dfg-get-origin.js +23 -10
  159. package/dataflow/processor.d.ts +2 -1
  160. package/dataflow/processor.js +6 -0
  161. package/documentation/data/interface/doc-writing-code.js +2 -0
  162. package/documentation/doc-util/doc-search.js +1 -1
  163. package/documentation/wiki-absint.d.ts +11 -14
  164. package/documentation/wiki-absint.js +73 -59
  165. package/documentation/wiki-core.js +64 -24
  166. package/documentation/wiki-linter.js +1 -0
  167. package/documentation/wiki-query.js +82 -264
  168. package/documentation/wiki-signature-database.js +17 -5
  169. package/gas.d.ts +91 -47
  170. package/gas.js +97 -13
  171. package/index.d.ts +31 -0
  172. package/index.js +52 -0
  173. package/linter/linter-rules.d.ts +87 -23
  174. package/linter/linter-rules.js +3 -1
  175. package/linter/rules/absolute-path.d.ts +1 -1
  176. package/linter/rules/dataframe-access-validation.d.ts +1 -1
  177. package/linter/rules/dataframe-access-validation.js +10 -8
  178. package/linter/rules/dead-code.d.ts +1 -1
  179. package/linter/rules/deprecated-functions.js +14 -5
  180. package/linter/rules/file-path-validity.d.ts +1 -1
  181. package/linter/rules/naming-convention.d.ts +1 -1
  182. package/linter/rules/naming-convention.js +13 -2
  183. package/linter/rules/network-functions.d.ts +10 -5
  184. package/linter/rules/network-functions.js +48 -36
  185. package/linter/rules/no-leaked-credentials.d.ts +1 -1
  186. package/linter/rules/problematic-inputs.d.ts +1 -1
  187. package/linter/rules/problematic-inputs.js +1 -1
  188. package/linter/rules/seeded-randomness.d.ts +3 -2
  189. package/linter/rules/seeded-randomness.js +7 -3
  190. package/linter/rules/software-has-license.d.ts +1 -1
  191. package/linter/rules/software-has-tests.d.ts +1 -1
  192. package/linter/rules/stop-with-call-arg.d.ts +1 -1
  193. package/linter/rules/syntactically-valid.d.ts +1 -1
  194. package/linter/rules/unclosed-connection.d.ts +3 -3
  195. package/linter/rules/unclosed-connection.js +3 -4
  196. package/linter/rules/undefined-symbol.d.ts +1 -1
  197. package/linter/rules/unescaped-arguments.d.ts +161 -0
  198. package/linter/rules/unescaped-arguments.js +293 -0
  199. package/linter/rules/unused-definition.d.ts +1 -1
  200. package/linter/rules/unused-definition.js +49 -4
  201. package/linter/rules/unused-import.d.ts +1 -1
  202. package/linter/rules/useless-loop.d.ts +1 -1
  203. package/package.json +3 -198
  204. package/project/context/flowr-analyzer-environment-context.d.ts +12 -1
  205. package/project/context/flowr-analyzer-environment-context.js +33 -1
  206. package/project/context/flowr-analyzer-files-context.d.ts +24 -1
  207. package/project/context/flowr-analyzer-files-context.js +42 -21
  208. package/project/context/flowr-analyzer-functions-context.d.ts +8 -0
  209. package/project/context/flowr-analyzer-functions-context.js +2 -0
  210. package/project/context/flowr-analyzer-gas-context.d.ts +9 -1
  211. package/project/context/flowr-analyzer-gas-context.js +21 -0
  212. package/project/context/flowr-file.d.ts +16 -1
  213. package/project/context/flowr-file.js +26 -2
  214. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +19 -20
  215. package/project/plugins/file-plugins/files/flowr-description-file.js +55 -41
  216. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +9 -4
  217. package/project/plugins/file-plugins/files/flowr-jupyter-file.js +11 -3
  218. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +6 -9
  219. package/project/plugins/file-plugins/files/flowr-manifest-files.js +5 -21
  220. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +11 -12
  221. package/project/plugins/file-plugins/files/flowr-namespace-file.js +48 -61
  222. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +3 -12
  223. package/project/plugins/file-plugins/files/flowr-news-file.js +2 -19
  224. package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +145 -0
  225. package/project/plugins/file-plugins/files/flowr-rd-file.js +676 -0
  226. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +122 -422
  227. package/project/plugins/file-plugins/files/flowr-rda-file.js +517 -1005
  228. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +8 -2
  229. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +10 -1
  230. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +7 -2
  231. package/project/plugins/file-plugins/files/flowr-sweave-file.js +9 -1
  232. package/project/plugins/file-plugins/files/flowr-sysdata-file.d.ts +17 -0
  233. package/project/plugins/file-plugins/files/flowr-sysdata-file.js +40 -0
  234. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +2 -0
  235. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +3 -1
  236. package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.d.ts +58 -0
  237. package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.js +95 -0
  238. package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.d.ts +23 -0
  239. package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.js +33 -0
  240. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +33 -72
  241. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +17 -15
  242. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +20 -37
  243. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +29 -53
  244. package/project/plugins/package-version-plugins/package.js +2 -1
  245. package/project/plugins/plugin-registry.d.ts +3 -1
  246. package/project/plugins/plugin-registry.js +11 -0
  247. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +20 -4
  248. package/project/sigdb/build.d.ts +9 -15
  249. package/project/sigdb/build.js +101 -42
  250. package/project/sigdb/decode.d.ts +10 -4
  251. package/project/sigdb/decode.js +60 -21
  252. package/project/sigdb/memory-source.d.ts +4 -0
  253. package/project/sigdb/memory-source.js +8 -0
  254. package/project/sigdb/reader.d.ts +57 -100
  255. package/project/sigdb/reader.js +157 -108
  256. package/project/sigdb/schema.d.ts +90 -26
  257. package/project/sigdb/schema.js +12 -6
  258. package/queries/base-query-format.d.ts +7 -0
  259. package/queries/base-query-format.js +29 -0
  260. package/queries/catalog/absint-query/absint-query-executor.js +8 -6
  261. package/queries/catalog/absint-query/absint-query-format.d.ts +20 -9
  262. package/queries/catalog/absint-query/absint-query-format.js +32 -19
  263. package/queries/catalog/call-context-query/call-context-query-executor.js +3 -3
  264. package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
  265. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
  266. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
  267. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
  268. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
  269. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
  270. package/queries/catalog/dependencies-query/dependencies-query-executor.js +33 -7
  271. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
  272. package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +2 -2
  273. package/queries/catalog/dependencies-query/function-info/derived-functions.js +14 -4
  274. package/queries/catalog/dependencies-query/function-info/read-functions.js +7 -121
  275. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +1 -1
  276. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +2 -2
  277. package/queries/catalog/dependencies-query/function-info/visualize-functions.js +4 -46
  278. package/queries/catalog/dependencies-query/function-info/write-functions.js +3 -76
  279. package/queries/catalog/dependencies-query/implicit-echo.js +2 -2
  280. package/queries/catalog/dependencies-query/link-devices.d.ts +2 -2
  281. package/queries/catalog/dependencies-query/link-devices.js +6 -7
  282. package/queries/catalog/dice-query/dice-query-executor.js +1 -1
  283. package/queries/catalog/dice-query/dice-query-format.d.ts +1 -1
  284. package/queries/catalog/does-call-query/does-call-query-executor.js +4 -0
  285. package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -1
  286. package/queries/catalog/files-query/files-query-format.d.ts +1 -1
  287. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +1 -1
  288. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
  289. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
  290. package/queries/catalog/input-sources-query/input-source-functions.d.ts +1 -1
  291. package/queries/catalog/input-sources-query/input-source-functions.js +2 -2
  292. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -17
  293. package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -27
  294. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
  295. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +3 -8
  296. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -11
  297. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +4 -0
  298. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +60 -0
  299. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +35 -0
  300. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +63 -0
  301. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -6
  302. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +3 -8
  303. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -11
  304. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +3 -8
  305. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -12
  306. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
  307. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
  308. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  309. package/queries/catalog/project-query/project-query-format.d.ts +1 -1
  310. package/queries/catalog/provenance-query/provenance-query-format.d.ts +3 -8
  311. package/queries/catalog/provenance-query/provenance-query-format.js +2 -14
  312. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  313. package/queries/catalog/search-query/search-query-format.d.ts +1 -1
  314. package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -10
  315. package/queries/catalog/signature-query/signature-query-executor.js +87 -93
  316. package/queries/catalog/signature-query/signature-query-format.d.ts +20 -5
  317. package/queries/catalog/signature-query/signature-query-format.js +16 -4
  318. package/queries/catalog/signature-query/signature-query-render.js +18 -4
  319. package/queries/catalog/slice-query-options.d.ts +14 -0
  320. package/queries/catalog/slice-query-options.js +15 -0
  321. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +2 -1
  322. package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -2
  323. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -3
  324. package/queries/catalog/static-slice-query/static-slice-query-format.js +7 -5
  325. package/queries/query-function-filter.d.ts +8 -3
  326. package/queries/query-function-filter.js +16 -6
  327. package/queries/query.d.ts +38 -38
  328. package/queries/query.js +30 -4
  329. package/r-bridge/lang-4.x/ast/model/model.d.ts +5 -0
  330. package/r-bridge/lang-4.x/ast/model/model.js +14 -0
  331. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
  332. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +1 -0
  333. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
  334. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  335. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  336. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  337. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  338. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
  339. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  340. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  341. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  342. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  343. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  344. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
  345. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
  346. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  347. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  348. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
  349. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
  350. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
  351. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  352. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +17 -9
  353. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +35 -27
  354. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -22
  355. package/reconstruct/reconstruct.d.ts +9 -20
  356. package/reconstruct/reconstruct.js +66 -28
  357. package/search/flowr-search-filters.d.ts +7 -6
  358. package/search/flowr-search-filters.js +6 -4
  359. package/search/search-executor/search-enrichers.d.ts +10 -10
  360. package/search/search-executor/search-enrichers.js +32 -3
  361. package/search/search-executor/search-transformer.js +15 -23
  362. package/slicing/criterion/parse.js +2 -12
  363. package/slicing/static/slice-call.js +1 -8
  364. package/slicing/static/static-slicer.js +1 -1
  365. package/util/collections/bimap.js +14 -6
  366. package/util/objects.js +16 -17
  367. package/util/r-value.d.ts +5 -4
  368. package/util/record.d.ts +38 -3
  369. package/util/record.js +48 -1
  370. package/util/simple-df/dfg-ascii.js +1 -1
  371. package/util/text/strings.d.ts +5 -0
  372. package/util/text/strings.js +10 -0
  373. package/util/version.js +2 -2
  374. package/abstract-interpretation/absint-visitor.d.ts +0 -223
  375. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +0 -19
  376. package/abstract-interpretation/data-frame/mappers/access-mapper.js +0 -151
  377. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +0 -287
  378. package/abstract-interpretation/data-frame/mappers/function-mapper.js +0 -1096
  379. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +0 -15
  380. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +0 -207
  381. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +0 -6
  382. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +0 -25
  383. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +0 -31
  384. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +0 -56
package/config.d.ts CHANGED
@@ -55,51 +55,18 @@ export declare enum DropPathsOption {
55
55
  /** try to drop every folder of the path */
56
56
  All = "all"
57
57
  }
58
+ /** see {@link FlowrConfig.Schema}'s `resolveSource` for the per-field descriptions (kept there once, as that is what generates the published config docs) */
58
59
  export interface FlowrLaxSourcingOptions extends MergeableRecord {
59
- /**
60
- * search for filenames matching in the lowercase
61
- */
62
60
  readonly ignoreCapitalization: boolean;
63
- /**
64
- * try to infer the working directory from the main or any script to analyze.
65
- */
66
61
  readonly inferWorkingDirectory: InferWorkingDirectory;
67
- /**
68
- * Additionally search in these paths
69
- */
70
62
  readonly searchPath: string[];
71
- /**
72
- * Allow to drop the first or all parts of the sourced path,
73
- * if it is relative.
74
- */
75
63
  readonly dropPaths: DropPathsOption;
76
- /**
77
- * How often the same file can be sourced within a single run?
78
- * Please be aware: in case of cyclic sources this may not reach a fixpoint so give this a sensible limit.
79
- */
80
64
  readonly repeatedSourceLimit?: number;
81
65
  /**
82
- * sometimes files may have a different name in the source call (e.g., due to later replacements),
83
- * with this setting you can provide a list of replacements to apply for each sourced file.
84
- * Every replacement consists of a record that maps a regex to a replacement string.
85
- * @example
86
- * ```ts
87
- * [
88
- * { }, // no replacement -> still try the original name/path
89
- * { '.*\\.R$': 'main.R' }, // replace all .R files with main.R
90
- * { '\s' : '_' }, // replace all spaces with underscores
91
- * { '\s' : '-', 'oo': 'aa' }, // replace all spaces with dashes and oo with aa
92
- * ]
93
- * ```
94
- *
95
- * Given a `source("foo bar.R")` this configuration will search for (in this order):
96
- * - `foo bar.R` (original name)
97
- * - `main.R` (replaced with main.R)
98
- * - `foo_bar.R` (replaced spaces)
99
- * - `faa-bar.R` (replaced spaces and oo)
66
+ * Regex replacements to try against a sourced file's candidate name, tried in order alongside the original
67
+ * name, e.g. `{ '.*\\.R$': 'main.R' }` makes `source("foo bar.R")` also try `main.R`.
100
68
  */
101
69
  readonly applyReplacements?: Record<string, string>[];
102
- /** Assume a sourced file is always there, making what it defines certain instead of conditional on the `source` call. */
103
70
  readonly assumeFilesExist?: boolean;
104
71
  }
105
72
  export type ConfigPlugin<T extends BuiltInFlowrPluginName | string> = T | string | (T extends BuiltInFlowrPluginName ? [T, BuiltInFlowrPluginArgs<T>] : [string, unknown[]]);
@@ -114,38 +81,22 @@ export type SpecializeConfigEntry = DeepPartial<FlowrConfig> & {
114
81
  */
115
82
  export interface FlowrConfig {
116
83
  readonly logLevel?: LogLevelName;
117
- /**
118
- * Whether source calls should be ignored, causing {@link processSourceCall}'s behavior to be skipped
119
- */
120
84
  readonly ignoreSourceCalls: boolean;
121
- /**
122
- * Whether load calls should be ignored, causing {@link processLoadCall}'s behavior to be skipped
123
- */
124
85
  readonly ignoreLoadCalls: boolean;
125
- /** Configure language semantics and how flowR handles them */
126
86
  readonly semantics: {
127
- /** Semantics regarding the handling of the environment */
128
87
  readonly environment: {
129
- /** Do you want to overwrite (parts) of the builtin definition? */
130
88
  readonly overwriteBuiltIns: {
131
- /** Should the default configuration still be loaded? */
132
89
  readonly loadDefaults?: boolean;
133
- /** The definitions to load */
134
90
  readonly definitions: BuiltInDefinitions;
135
91
  };
136
92
  };
137
93
  };
138
- /** Plugins to load by default when creating a new FlowrAnalyzer */
139
94
  readonly defaultPlugins: ConfigPlugin<string>[];
140
- /** Configuration options for the REPL */
141
95
  readonly repl: {
142
- /** Whether to show quick stats in the REPL after each evaluation */
143
96
  quickStats: boolean;
144
- /** This instruments the dataflow processors to count how often each processor is called */
145
97
  dfProcessorHeat: boolean;
146
98
  /** Whether to show dim inline hints (e.g. `:help`) on the empty prompt; automatically disabled on non-interactive terminals */
147
99
  hints: boolean;
148
- /** Plugins to load in REPL mode */
149
100
  plugins: (ConfigPlugin<string> | 'flowr:default')[];
150
101
  /** Automatically use the file protocol for inputs that look like paths (default `true`) */
151
102
  autoUseFileProtocol?: boolean;
@@ -155,111 +106,61 @@ export interface FlowrConfig {
155
106
  showPlugins?: boolean;
156
107
  };
157
108
  readonly project: {
158
- /** Whether to resolve unknown paths loaded by the r project disk when trying to source/analyze files */
159
109
  resolveUnknownPathsOnDisk: boolean;
160
- /** Whether a directory that cannot be traversed during file discovery (e.g. due to permissions) aborts the analysis; when `false` (the default) such paths are logged and skipped. */
161
110
  failOnInaccessiblePath?: boolean;
162
- /** Overwrite the {@link ProjectKind} flowR would otherwise infer from the analyzed files, e.g. when auto-detection guesses wrong. */
163
111
  useProjectType?: ProjectKind;
164
- /**
165
- * Whether the top level of the analyzed code is echoed, so that every visible result printed there counts as an
166
- * output (the `print` category of the dependencies query). Defaults to `true` and is set to `false` for a
167
- * {@link ProjectKind.Package}, whose top-level code runs at install time.
168
- */
112
+ /** Whether the top level's visible results count as an output (the `print` category); off by default for a {@link ProjectKind.Package}, whose top level runs at install time. */
169
113
  assumeImplicitEcho?: boolean;
170
- /**
171
- * The packages considered part of R itself, used e.g. by the project query to classify dependencies. If
172
- * unset, flowR derives them (for the assumed R version) from the signature database via `baseRPackages`.
173
- */
114
+ /** The packages considered part of R itself; if unset, flowR derives them (for the assumed R version) from the signature database via `baseRPackages`. */
174
115
  basePackages?: string[];
175
- /**
176
- * Files a framework loads on its own, without any `source()` call (e.g. `global.R` in a shiny app), in load
177
- * order. Entries are case-insensitive globs (`R/*.R`) matched against the path, a plain name matches any file
178
- * with that name; entries matching nothing are warned about. Usually set per {@link ProjectKind} via
179
- * {@link FlowrConfig.specializeConfig}.
180
- */
181
116
  implicitSources?: string[];
182
- /** Scoping options for the default project discovery. */
183
117
  discovery?: {
184
- /** Collect every file below the project root (greedy) instead of only the files the detected {@link ProjectKind} needs (default `false`). */
185
118
  full?: boolean;
186
- /** Per-{@link ProjectKind} include/exclude glob overrides layered on the default scoping. */
187
119
  perKind?: Partial<Record<ProjectKind, {
188
120
  include?: string[];
189
121
  exclude?: string[];
190
122
  }>>;
191
- /** Case-insensitive globs that drop matching files from the intelligent discovery, regardless of kind (e.g. `.Renviron` to ignore environment files). */
192
123
  ignore?: string[];
193
124
  };
194
- /** Overrides for the signals flowR uses to classify the {@link ProjectKind}; unset fields keep the built-in defaults. */
195
125
  classification?: {
196
126
  /** DESCRIPTION `Type:` values that mark a shiny app (default `shiny`, `shiny-app`, `shinyapp`). */
197
127
  shinyDescriptionTypes?: string[];
198
128
  /** File names a shiny app is assembled from (default `app.R`, `ui.R`, `server.R`, `global.R`). */
199
129
  shinyEntryFiles?: string[];
200
- /** Regex source evidencing shiny usage in an entry file. */
201
130
  shinyUsagePattern?: string;
202
131
  /** File extensions marking a notebook (default `ipynb`, `rmd`, `rmarkdown`, `qmd`, `rnw`). */
203
132
  notebookExtensions?: string[];
204
133
  };
205
134
  };
206
- /** Linter configuration, usually specialized per {@link ProjectKind} via {@link FlowrConfig.specializeConfig}. */
207
135
  readonly linter: {
208
- /** Rule names excluded from the *default* rule set (a rule requested explicitly still runs). */
209
136
  readonly disabledRules: string[];
210
137
  };
211
138
  /**
212
- * Teaches the {@link InputSourcesQuery|input-sources} analysis (and with it the `problematic-inputs` linter)
213
- * about further frameworks. Everything here is *added* to what flowR already knows, so a shiny app keeps its
214
- * `input` even when you declare your own. Usually set per {@link ProjectKind} via {@link specializeConfig}.
215
- * @see {@link InputClassifierConfig} - for what the entries mean
139
+ * Teaches the {@link InputSourcesQuery|input-sources} analysis further frameworks; entries are *added* to what
140
+ * flowR knows already. Usually set per {@link ProjectKind} via {@link specializeConfig}. See {@link InputClassifierConfig}.
216
141
  */
217
142
  readonly inputSources?: DeepWritable<InputClassifierConfig<string[]>>;
218
143
  /**
219
- * Overwrite (parts of) this configuration depending on the {@link ProjectKind} flowR detects for the project,
220
- * e.g. to give a shiny app its implicit sources. An entry may `inherit` another kind's overwrite (merged first,
221
- * with the entry's own keys winning) to avoid repeating it. Resolve it with {@link FlowrConfig.forKind}.
144
+ * Overwrite (parts of) this configuration per {@link ProjectKind}; an entry may `inherit` another kind's
145
+ * overwrite first (own keys win). Resolve with {@link FlowrConfig.forKind}.
222
146
  */
223
147
  readonly specializeConfig?: Partial<Record<ProjectKind, SpecializeConfigEntry>>;
224
- /**
225
- * The engines to use for interacting with R code. Currently, supports {@link TreeSitterEngineConfig} and {@link RShellEngineConfig}.
226
- * An empty array means all available engines will be used.
227
- */
148
+ /** Engines to use for interacting with R code ({@link TreeSitterEngineConfig}, {@link RShellEngineConfig}); empty means all available engines. */
228
149
  readonly engines: EngineConfig[];
229
- /**
230
- * The default engine to use for interacting with R code. If this is undefined, an arbitrary engine from {@link engines} will be used.
231
- */
150
+ /** The default engine to use. If undefined, an arbitrary one from {@link engines} is used. */
232
151
  readonly defaultEngine?: EngineConfig['type'];
233
- /** How to resolve constants, constraints, cells, … */
234
152
  readonly solver: {
235
- /**
236
- * How to resolve variables and their values
237
- */
238
153
  readonly variables: VariableResolve;
239
- /**
240
- * Should we include eval(parse(text="...")) calls in the dataflow graph?
241
- */
242
154
  readonly evalStrings: boolean;
243
- /**
244
- * Track user-created environments (`new.env()`, `assign(..., envir=e)`, `get(..., envir=e)`,
245
- * `local({}, envir=e)`, `e$x <- v`, `attach(e)`) with precise per-variable envState.
246
- * When disabled all envir-style calls fall through to the conservative global treatment.
247
- */
248
155
  readonly trackEnvironments: boolean;
249
- /** Resolving `library()`/`use()` exports from a signature database (e.g. the bundled `flowr-sigdb`). */
250
156
  readonly sigdb: {
251
- /** Resolve library exports from a signature database (default `true`); when `false` no database is consulted. */
252
157
  readonly enabled: boolean;
253
- /** Load the project's declared dependencies from its metadata files (`DESCRIPTION` Imports/Depends, `rproject.toml`, `uvr.toml`, `renv.lock`, `rv.lock`, `uvr.lock`) into the dependency context (default `true`); when `false` these files are not read, so neither the undefined-symbol linter nor {@link linkDescriptionDependencies} sees any project-declared dependency. */
254
158
  readonly loadProjectDependencies: boolean;
255
- /** Parse the database up front rather than on the first package load (default `false`, ignored if disabled). */
256
159
  readonly eagerlyLoad: boolean;
257
- /** Add a vertex for every export on load rather than on demand (default `false`); keeps the graph small. */
258
160
  readonly eagerlyLoadExports: boolean;
259
161
  /**
260
- * The R version analysis assumes when resolving versioned (base-R) package exports: a pin like `"4.5"`,
261
- * or `"auto"` to detect the locally installed R (falling back to {@link DefaultAssumedRVersion} when the
262
- * engine reports none, e.g. the tree-sitter engine). Resolve it with {@link resolveAssumedRVersion}.
162
+ * R version assumed when resolving versioned (base-R) exports: a pin, or `"auto"` to detect the installed R
163
+ * (falling back to {@link DefaultAssumedRVersion} if none, e.g. tree-sitter). See {@link resolveAssumedRVersion}.
263
164
  */
264
165
  readonly assumedRVersion?: string;
265
166
  /** Eagerly attach base-R namespaces (from a signature database) so bare base calls resolve without `library()` (default `false`; changes every analysis; needs a base-R signature database). */
@@ -272,144 +173,71 @@ export interface FlowrConfig {
272
173
  readonly linkPackageCalls?: boolean;
273
174
  /** Decompress the hot shards (base + most-downloaded) in a background task on startup, so the first `library()` lookup is warm (default `false`; useful for long-running servers/REPLs, not one-shot runs). */
274
175
  readonly warmInBackground?: boolean;
275
- /** Extra directories (or bundle/manifest files) searched for signature databases, alongside the shipped default and `$FLOWR_SIGDB_DIR`. A downloaded full-history bundle placed here is mounted automatically. */
276
176
  readonly additionalPaths?: string[];
277
- /** GitHub `owner/repo` the full-history bundle is downloaded from (`:signature download`); default `flowr-analysis/flowr`, release tag `sigdb-v<flowR-version>`. */
278
177
  readonly downloadRepo?: string;
279
- /** On startup, compare the cache against the committed `sigdb.remote.json` link file and re-download changed shards in the background (default `false`; needs network, so opt-in — a `git pull` that updates the pointer then re-syncs automatically). */
280
178
  readonly autoSync?: boolean;
281
- /** When a project constrains a dependency, resolve to the `newest` (default) or `oldest` version satisfying the constraint, or the `system`-installed version (needs R; falls back to `newest` when unavailable). Base-R packages always resolve against the assumed R version. */
282
179
  readonly versionSelection?: VersionSelection;
283
180
  /** Force an exact version for specific packages (mapping a package name to a version), overriding both the project constraint and the {@link versionSelection} policy; a version missing from the database falls back with a warning (default `{}`). */
284
181
  readonly versionOverrides?: Record<string, string>;
285
182
  /**
286
- * Recovering a package no signature database knows (a CRAN-archived one like `maptools`) from the copy
287
- * installed on this machine: its `DESCRIPTION` states the version, its `NAMESPACE` the exports. Opt-in,
288
- * as it reads directories outside the analyzed project and ties the analysis to what is installed here.
183
+ * Recovering a package no signature database knows (e.g. `maptools`) from its local install: `DESCRIPTION`
184
+ * states the version, `NAMESPACE` the exports. Opt-in, since it reads outside the analyzed project.
289
185
  */
290
186
  readonly installedLibrary?: {
291
- /** Consult installed packages at all (default `false`). */
292
187
  readonly enabled: boolean;
293
- /** The library directories to search; when empty they are discovered as configured below (default `[]`). */
294
188
  readonly paths?: string[];
295
- /** Search the libraries `R_LIBS_USER`/`R_LIBS`/`R_LIBS_SITE` name (default `true`, ignored when {@link paths} is given). */
296
189
  readonly useEnvironment?: boolean;
297
- /** Search a project-local `renv`/`packrat` library (default `true`, ignored when {@link paths} is given). */
298
190
  readonly useProjectLibrary?: boolean;
299
- /** How far to descend into the nested layout of a project-local library (default `3`). */
300
191
  readonly maxDepth?: number;
301
- /** Only recover packages whose name matches one of these regular expressions; empty means any (default `[]`). */
302
192
  readonly packages?: string[];
303
193
  };
304
194
  };
305
- /** Policies for reasoning about dependency versions (independent of how the signature database is loaded). */
306
195
  readonly versionManagement?: {
307
- /** Groups of packages that must resolve to the same version (like the base packages, which share the R version); version guessing intersects each group so its members stay mutually compatible (default `[]`). */
308
196
  readonly linkedVersionGroups?: string[][];
309
197
  };
310
- /** These keys are only intended for use within code, allowing to instrument the dataflow analyzer! */
198
+ readonly transitiveSideEffectRounds?: number;
199
+ readonly assumeAttachedPackages?: string[];
311
200
  readonly instrument: {
312
201
  /**
313
- * Modify the dataflow processors used during dataflow analysis.
314
- * Make sure that all processors required for correct analysis are still present!
315
- * This may have arbitrary consequences on the analysis precision and performance, consider focusing on decorating existing processors instead of replacing them.
202
+ * Modify the dataflow processors used during analysis; keep every processor correctness requires present.
203
+ * May affect precision/performance arbitrarily -- prefer decorating existing processors over replacing them.
316
204
  */
317
205
  dataflowExtractors?: (extractor: DataflowProcessors<ParentInformation>, ctx: FlowrAnalyzerContext) => DataflowProcessors<ParentInformation>;
318
206
  };
319
- /**
320
- * If lax source calls are active, flowR searches for sourced files much more freely,
321
- * based on the configurations you give it.
322
- * This option is only in effect if {@link ignoreSourceCalls} is set to false.
323
- */
324
207
  readonly resolveSource?: FlowrLaxSourcingOptions;
325
- /**
326
- * The configuration for flowR's slicer
327
- */
328
208
  slicer?: {
329
- /**
330
- * The maximum number of iterations to perform on a single function call during slicing
331
- */
332
209
  readonly threshold?: number;
333
- /**
334
- * If set, the slicer will gain an additional post-pass
335
- */
336
210
  readonly autoExtend?: boolean;
337
211
  };
338
212
  };
339
- /**
340
- * Configuration options for abstract interpretation
341
- */
342
213
  readonly abstractInterpretation: {
343
- /**
344
- * The threshold for the number of visitations of a node at which widening should be performed to ensure the termination of the fixpoint iteration
345
- */
346
214
  readonly wideningThreshold: number;
347
- /**
348
- * Whether the abstract interpretation is interprocedural, i.e. whether it steps into the functions a call
349
- * may dispatch to instead of describing the call by its result alone
350
- */
351
215
  readonly followCalls: boolean;
352
- /**
353
- * The configuration of the shape inference for data frames
354
- */
355
216
  readonly dataFrame: {
356
- /**
357
- * The maximum number of columns names to infer for data frames before over-approximating the column names to top
358
- */
359
217
  readonly maxColNames: number;
360
- /**
361
- * Configuration options for reading data frame shapes from loaded external data files, such as CSV files
362
- */
363
218
  readonly readLoadedData: {
364
- /**
365
- * Whether data frame shapes should be extracted from loaded external data files, such as CSV files
366
- */
367
219
  readonly readExternalFiles: boolean;
368
- /**
369
- * The maximum number of lines to read when extracting data frame shapes from loaded files, such as CSV files
370
- */
371
220
  readonly maxReadLines: number;
372
221
  };
373
222
  };
374
223
  };
375
224
  readonly incremental: {
376
- /**
377
- * Always take the incremental path, regardless of heuristics
378
- */
379
225
  readonly alwaysIncremental: boolean;
380
226
  readonly parsing: {
381
227
  readonly activated: boolean;
382
228
  readonly heuristics: {
383
229
  readonly activated: boolean;
384
- /**
385
- * Skip reparsing entirely if the file's modification time is unchanged since the last parse
386
- */
387
230
  readonly mtime: boolean;
388
- /**
389
- * Only consider incremental parsing for files with at least this many lines
390
- */
391
231
  readonly linesFrom: number;
392
- /**
393
- * Only consider incremental parsing for files with at least this many bytes
394
- */
395
232
  readonly bytesFrom: number;
396
- /**
397
- * Always take the incremental path whenever there is a computed edit region, regardless of the other thresholds
398
- */
399
233
  readonly alwaysWithEdits: boolean;
400
- /**
401
- * Only apply these heuristics once the project has at least this many files loaded
402
- */
403
234
  readonly minFiles: number;
404
235
  };
405
236
  };
406
237
  };
407
238
  /**
408
- * Resource-usage guard (gas) configuration.
409
- * Gas checks are disabled by default (all feature factors are `0`).
410
- * Set a `feature factor > 0` to enable checking for that feature.
411
- * @see {@link FlowrGasConfig}
412
- * @see {@link ReadOnlyFlowrAnalyzerGasContext}
239
+ * Resource-usage guard (gas) configuration; disabled by default (every feature factor `0`), enable by setting a
240
+ * feature's factor `> 0`. See {@link FlowrGasConfig}, {@link ReadOnlyFlowrAnalyzerGasContext}.
413
241
  */
414
242
  readonly gas: FlowrGasConfig;
415
243
  }
@@ -420,6 +248,13 @@ export interface FlowrConfig {
420
248
  export type ValidFlowrConfigPaths = AutocompletablePaths<FlowrConfig>;
421
249
  /** Whether library exports should be resolved from a signature database (`solver.sigdb.enabled`). */
422
250
  export declare function isSigDbEnabled(config: FlowrConfig | undefined): boolean;
251
+ /**
252
+ * Default of `gas.countedCheckEvery`: how many calls one accounting of an armed dataflow budget covers.
253
+ * A budget only has to catch work that has run away, so the sampling is deliberately coarse.
254
+ */
255
+ export declare const DefaultCountedCheckEvery = 64;
256
+ /** Default of `solver.transitiveSideEffectRounds`: round cap for the transitive side-effect fixpoint in {@link produceDataFlowGraph}, which stops on its own once a round adds nothing. */
257
+ export declare const DefaultTransitiveSideEffectRounds = 32;
423
258
  /**
424
259
  * R version assumed for analysis when `solver.sigdb.assumedRVersion` is `"auto"` and none could be detected.
425
260
  * Kept in step with the newest base-R release in the bundled sigdb (see `newestRVersion` in the generated
@@ -434,24 +269,14 @@ export declare const DefaultAssumedRVersion = "4.5.3";
434
269
  export declare function resolveAssumedRVersion(config: FlowrConfig | undefined, detected?: string): string;
435
270
  export interface TreeSitterEngineConfig extends MergeableRecord {
436
271
  readonly type: 'tree-sitter';
437
- /**
438
- * The path to the tree-sitter-r WASM binary to use. If this is undefined, {@link DEFAULT_TREE_SITTER_R_WASM_PATH} will be used.
439
- */
272
+ /** The path to the tree-sitter-r WASM binary to use; defaults to {@link DEFAULT_TREE_SITTER_R_WASM_PATH}. */
440
273
  readonly wasmPath?: string;
441
- /**
442
- * The path to the tree-sitter WASM binary to use. If this is undefined, the path specified by the tree-sitter package will be used.
443
- */
444
274
  readonly treeSitterWasmPath?: string;
445
- /**
446
- * Whether to use the lax parser for parsing R code (allowing for syntax errors). If this is undefined, the strict parser will be used.
447
- */
448
275
  readonly lax?: boolean;
449
276
  }
450
277
  export interface RShellEngineConfig extends MergeableRecord {
451
278
  readonly type: 'r-shell';
452
- /**
453
- * The path to the R executable to use. If this is undefined, {@link DEFAULT_R_PATH} will be used.
454
- */
279
+ /** The path to the R executable to use; defaults to {@link DEFAULT_R_PATH}. */
455
280
  readonly rPath?: string;
456
281
  }
457
282
  export type EngineConfig = TreeSitterEngineConfig | RShellEngineConfig;
package/config.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FlowrConfig = exports.FlowrDefaultPlugins = exports.DefaultAssumedRVersion = exports.DropPathsOption = exports.InferWorkingDirectory = exports.VersionSelection = exports.VariableResolve = void 0;
6
+ exports.FlowrConfig = exports.FlowrDefaultPlugins = exports.DefaultAssumedRVersion = exports.DefaultTransitiveSideEffectRounds = exports.DefaultCountedCheckEvery = exports.DropPathsOption = exports.InferWorkingDirectory = exports.VersionSelection = exports.VariableResolve = void 0;
7
7
  exports.isSigDbEnabled = isSigDbEnabled;
8
8
  exports.resolveAssumedRVersion = resolveAssumedRVersion;
9
9
  exports.globalConfigFilePath = globalConfigFilePath;
@@ -71,6 +71,13 @@ var DropPathsOption;
71
71
  function isSigDbEnabled(config) {
72
72
  return config?.solver.sigdb.enabled === true;
73
73
  }
74
+ /**
75
+ * Default of `gas.countedCheckEvery`: how many calls one accounting of an armed dataflow budget covers.
76
+ * A budget only has to catch work that has run away, so the sampling is deliberately coarse.
77
+ */
78
+ exports.DefaultCountedCheckEvery = 64;
79
+ /** Default of `solver.transitiveSideEffectRounds`: round cap for the transitive side-effect fixpoint in {@link produceDataFlowGraph}, which stops on its own once a round adds nothing. */
80
+ exports.DefaultTransitiveSideEffectRounds = 32;
74
81
  /**
75
82
  * R version assumed for analysis when `solver.sigdb.assumedRVersion` is `"auto"` and none could be detected.
76
83
  * Kept in step with the newest base-R release in the bundled sigdb (see `newestRVersion` in the generated
@@ -123,6 +130,15 @@ exports.FlowrDefaultPlugins = [
123
130
  'file:ipynb',
124
131
  'file:namespace',
125
132
  'file:news',
133
+ /* the macro plugin before the page one, so `man/macros/` never reads as a page */
134
+ 'file:rd-macros',
135
+ 'file:rd',
136
+ 'file:rd-index',
137
+ 'file:rd-topics',
138
+ 'file:rd-meta',
139
+ 'file:datalist',
140
+ /* the sysdata plugin before the rda one, so `R/sysdata.rda` never reads as a plain workspace */
141
+ 'file:sysdata',
126
142
  'file:rda',
127
143
  'file:license',
128
144
  'file:virtualenv',
@@ -286,6 +302,7 @@ exports.FlowrConfig = {
286
302
  repeatedSourceLimit: 2,
287
303
  assumeFilesExist: false
288
304
  },
305
+ transitiveSideEffectRounds: exports.DefaultTransitiveSideEffectRounds,
289
306
  instrument: {
290
307
  dataflowExtractors: undefined
291
308
  },
@@ -430,6 +447,8 @@ exports.FlowrConfig = {
430
447
  versionManagement: joi_1.default.object({
431
448
  linkedVersionGroups: joi_1.default.array().items(joi_1.default.array().items(joi_1.default.string())).optional().description('Groups of packages that must resolve to the same version; version guessing intersects each group so its members stay mutually compatible (default []).')
432
449
  }).description('Policies for reasoning about dependency versions.'),
450
+ assumeAttachedPackages: joi_1.default.array().items(joi_1.default.string()).optional().description('Packages to treat as attached without a `library()` call, so what the built-in configuration states about them applies to the analyzed code.'),
451
+ transitiveSideEffectRounds: joi_1.default.number().min(1).optional().description(`How many rounds the transitive side-effect fixpoint may run before it is cut off (default ${exports.DefaultTransitiveSideEffectRounds}); the propagation stops on its own as soon as a round adds nothing.`),
433
452
  instrument: joi_1.default.object({
434
453
  dataflowExtractors: joi_1.default.any().optional().description('These keys are only intended for use within code, allowing to instrument the dataflow analyzer!')
435
454
  }),
@@ -487,9 +506,24 @@ exports.FlowrConfig = {
487
506
  }).pattern(joi_1.default.string(), joi_1.default.object({
488
507
  problematic: joi_1.default.number().min(0).optional().description('Elapsed ms above which Problematic is returned for this feature.'),
489
508
  critical: joi_1.default.number().min(0).optional().description('Elapsed ms above which Critical is returned for this feature.')
490
- })).optional().description('Elapsed analysis time thresholds in milliseconds, either shared or given per feature key (with `default` covering the rest).')
509
+ })).optional().description('Elapsed analysis time thresholds in milliseconds, either shared or given per feature key (with `default` covering the rest).'),
510
+ steps: joi_1.default.object({
511
+ problematic: joi_1.default.number().min(0).optional().description('Processed AST nodes above which Problematic is returned, for every feature without an entry of its own.'),
512
+ critical: joi_1.default.number().min(0).optional().description('Processed AST nodes above which the extraction is cut short, for every feature without an entry of its own.')
513
+ }).pattern(joi_1.default.string(), joi_1.default.object({
514
+ problematic: joi_1.default.number().min(0).optional().description('Processed AST nodes above which Problematic is returned for this feature.'),
515
+ critical: joi_1.default.number().min(0).optional().description('Processed AST nodes above which the extraction is cut short for this feature.')
516
+ })).optional().description('Processed-AST-node thresholds, counted rather than sampled; only a key that arms a budget (`dataflow`) reads them.'),
517
+ vertices: joi_1.default.object({
518
+ problematic: joi_1.default.number().min(0).optional().description('Created dataflow vertices above which Problematic is returned, for every feature without an entry of its own.'),
519
+ critical: joi_1.default.number().min(0).optional().description('Created dataflow vertices above which the extraction is cut short, for every feature without an entry of its own.')
520
+ }).pattern(joi_1.default.string(), joi_1.default.object({
521
+ problematic: joi_1.default.number().min(0).optional().description('Created dataflow vertices above which Problematic is returned for this feature.'),
522
+ critical: joi_1.default.number().min(0).optional().description('Created dataflow vertices above which the extraction is cut short for this feature.')
523
+ })).optional().description('Created-dataflow-vertex thresholds, counted like `steps`.')
491
524
  }).optional().description('Thresholds for all gas checks (scaled by per-feature factor), boundable per feature.'),
492
- features: joi_1.default.object().pattern(joi_1.default.string(), joi_1.default.number().min(0).optional()).optional().description('Per-feature sensitivity factors. 0 or absent disables gas checking for that feature. A factor of 2 makes the feature twice as sensitive. Recognised keys: `source`, `side-effect-linking`, `linter`, `slicer`.'),
525
+ features: joi_1.default.object().pattern(joi_1.default.string(), joi_1.default.number().min(0).optional()).optional().description('Per-feature sensitivity factors. 0 or absent disables gas checking for that feature. A factor of 2 makes the feature twice as sensitive. Recognised keys: `source`, `side-effect-linking`, `linter`, `slicer`, `dataflow`.'),
526
+ countedCheckEvery: joi_1.default.number().min(1).optional().description(`How many counted steps pass between two clock reads while an armed budget also carries a timeMs bound (default ${exports.DefaultCountedCheckEvery}); trades overshoot against the cost of reading the clock.`),
493
527
  heapProvider: joi_1.default.function().optional().description('Custom heap statistics source (programmatic configs only), overriding the built-in v8/performance.memory detection.')
494
528
  }).optional().description(`Resource-usage guard (gas) configuration. All feature factors default to 0 (disabled). See ${gas_1.GasWikiRef}.`)
495
529
  }).description('The configuration file format for flowR.'),
@@ -13,6 +13,11 @@ declare const CfgProperties: {
13
13
  export type CfgProperty = keyof typeof CfgProperties;
14
14
  declare function checkSingleEntryAndExit(cfg: ControlFlowInformation): boolean;
15
15
  declare function hasEntryAndExit(cfg: ControlFlowInformation): boolean;
16
+ /**
17
+ * Every vertex reaches somewhere control stops, so the walk back starts at all of those: the exits the analysis
18
+ * names, and every vertex control reaches and never leaves again. An argument after one that raises ends at such
19
+ * a vertex, since a call whose parameter is never forced carries on to the call itself.
20
+ */
16
21
  declare function checkExitIsReachedByAll(cfg: ControlFlowInformation): boolean;
17
22
  declare function checkEntryReachesAll(cfg: ControlFlowInformation): boolean;
18
23
  /** either returns true or the name of the property that is not satisfied */
@@ -29,16 +29,21 @@ function checkSingleEntryAndExit(cfg) {
29
29
  function hasEntryAndExit(cfg) {
30
30
  return cfg.entryPoints.every(e => cfg.graph.hasVertex(e)) && cfg.exitPoints.every(e => cfg.graph.hasVertex(e));
31
31
  }
32
- function checkReachFrom(label, cfg, start, collect) {
33
- if (start === undefined) {
32
+ function checkReachFrom(label, cfg, starts, collect) {
33
+ // we only require the roots to be there
34
+ const allVertices = cfg.graph.rootIds();
35
+ if (allVertices.size === 0) {
36
+ /* an empty file, one holding nothing but comments, and one that does not parse all yield an empty graph,
37
+ for which every vertex trivially satisfies the property */
38
+ return true;
39
+ }
40
+ if (starts.length === 0) {
34
41
  return false;
35
42
  }
36
43
  const collected = new Set();
37
- collect(cfg.graph, [start], node => {
44
+ collect(cfg.graph, [...starts], node => {
38
45
  collected.add(node);
39
46
  });
40
- // we only require the roots to be there
41
- const allVertices = cfg.graph.rootIds();
42
47
  const diff = (0, set_1.setMinus)(allVertices, collected);
43
48
  if (diff.size > 0) {
44
49
  log_1.log.error(`Unreachable vertices from ${label}:`, diff);
@@ -46,11 +51,24 @@ function checkReachFrom(label, cfg, start, collect) {
46
51
  }
47
52
  return true;
48
53
  }
54
+ /**
55
+ * Every vertex reaches somewhere control stops, so the walk back starts at all of those: the exits the analysis
56
+ * names, and every vertex control reaches and never leaves again. An argument after one that raises ends at such
57
+ * a vertex, since a call whose parameter is never forced carries on to the call itself.
58
+ */
49
59
  function checkExitIsReachedByAll(cfg) {
50
- return checkReachFrom('exit', cfg, cfg.exitPoints[0], simple_visitor_1.visitCfgInReverseOrder);
60
+ const ends = new Set(cfg.exitPoints);
61
+ if (cfg.entryPoints.length > 0) {
62
+ (0, simple_visitor_1.visitCfgInOrder)(cfg.graph, [...cfg.entryPoints], node => {
63
+ if ((cfg.graph.outgoingEdges(node)?.size ?? 0) === 0) {
64
+ ends.add(node);
65
+ }
66
+ });
67
+ }
68
+ return checkReachFrom('exit', cfg, [...ends], simple_visitor_1.visitCfgInReverseOrder);
51
69
  }
52
70
  function checkEntryReachesAll(cfg) {
53
- return checkReachFrom('entry', cfg, cfg.entryPoints[0], simple_visitor_1.visitCfgInOrder);
71
+ return checkReachFrom('entry', cfg, cfg.entryPoints, simple_visitor_1.visitCfgInOrder);
54
72
  }
55
73
  function _checkFdIOCount(cfg, dir, type, limit) {
56
74
  const counts = new Map();