@eagleoutice/flowr 2.13.16 → 2.14.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 (253) hide show
  1. package/README.md +36 -25
  2. package/abstract-interpretation/absint-visitor.js +1 -1
  3. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
  4. package/abstract-interpretation/data-frame/mappers/arguments.js +7 -4
  5. package/abstract-interpretation/data-frame/mappers/function-mapper.js +18 -17
  6. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +6 -6
  7. package/abstract-interpretation/data-frame/resolve-args.d.ts +9 -4
  8. package/abstract-interpretation/data-frame/resolve-args.js +10 -5
  9. package/benchmark/calibration.d.ts +16 -7
  10. package/benchmark/calibration.js +44 -17
  11. package/benchmark/slicer.d.ts +3 -2
  12. package/benchmark/slicer.js +9 -5
  13. package/benchmark/stats/size-of.js +1 -1
  14. package/benchmark/summarizer/first-phase/process.d.ts +2 -0
  15. package/benchmark/summarizer/first-phase/process.js +2 -0
  16. package/cli/benchmark-app.js +4 -1
  17. package/cli/benchmark-helper-app.d.ts +1 -0
  18. package/cli/benchmark-helper-app.js +2 -2
  19. package/cli/common/options.d.ts +5 -31
  20. package/cli/common/options.js +2 -8
  21. package/cli/common/scripts-info.d.ts +5 -38
  22. package/cli/common/scripts-info.js +0 -8
  23. package/cli/repl/core.js +1 -1
  24. package/cli/repl/execute.d.ts +2 -2
  25. package/cli/repl/execute.js +2 -2
  26. package/cli/repl/parser/slice-query-parser.js +1 -1
  27. package/cli/repl/print-version.js +2 -2
  28. package/config.d.ts +16 -0
  29. package/config.js +83 -5
  30. package/control-flow/extract-cfg.js +1 -1
  31. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  32. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  33. package/control-flow/useless-loop.js +1 -1
  34. package/core/print/slice-diff-ansi.js +1 -1
  35. package/core/steps/pipeline/create-pipeline.js +1 -1
  36. package/dataflow/cluster.js +2 -2
  37. package/dataflow/environments/apply-kill.js +1 -1
  38. package/dataflow/environments/built-in-props.d.ts +13 -2
  39. package/dataflow/environments/built-in-props.js +23 -1
  40. package/dataflow/environments/built-in.d.ts +7 -1
  41. package/dataflow/environments/built-in.js +42 -3
  42. package/dataflow/environments/default-builtin-config.d.ts +518 -11
  43. package/dataflow/environments/default-builtin-config.js +218 -23
  44. package/dataflow/environments/environment.d.ts +10 -2
  45. package/dataflow/environments/environment.js +25 -7
  46. package/dataflow/environments/identifier.d.ts +8 -2
  47. package/dataflow/environments/identifier.js +6 -1
  48. package/dataflow/environments/query-fn-props.d.ts +6 -0
  49. package/dataflow/environments/query-fn-props.js +22 -2
  50. package/dataflow/environments/reference-to-maybe.js +5 -5
  51. package/dataflow/environments/resolve-by-name.d.ts +3 -0
  52. package/dataflow/environments/resolve-by-name.js +44 -7
  53. package/dataflow/environments/resolve-helper.d.ts +6 -0
  54. package/dataflow/environments/resolve-helper.js +6 -0
  55. package/dataflow/eval/resolve/alias-tracking.d.ts +5 -0
  56. package/dataflow/eval/resolve/alias-tracking.js +21 -14
  57. package/dataflow/eval/resolve/node-value.d.ts +6 -0
  58. package/dataflow/eval/resolve/node-value.js +15 -9
  59. package/dataflow/eval/resolve/resolve-argument.js +2 -2
  60. package/dataflow/eval/resolve/resolve-numbers.js +2 -2
  61. package/dataflow/eval/resolve/resolve-operators.js +5 -4
  62. package/dataflow/eval/resolve/resolve-strings.js +3 -3
  63. package/dataflow/eval/resolve/resolve-working-directory.d.ts +1 -1
  64. package/dataflow/eval/resolve/resolve-working-directory.js +3 -3
  65. package/dataflow/eval/resolve/resolve.d.ts +5 -5
  66. package/dataflow/eval/resolve/resolve.js +10 -11
  67. package/dataflow/eval/values/general.d.ts +4 -1
  68. package/dataflow/eval/values/general.js +1 -1
  69. package/dataflow/extractor.js +2 -1
  70. package/dataflow/fn/exceptions-of-function.d.ts +3 -1
  71. package/dataflow/fn/exceptions-of-function.js +87 -39
  72. package/dataflow/fn/higher-order-function.js +5 -4
  73. package/dataflow/fn/strict-function.d.ts +40 -0
  74. package/dataflow/fn/strict-function.js +337 -0
  75. package/dataflow/graph/call-graph.js +14 -14
  76. package/dataflow/graph/df-helper.d.ts +24 -1
  77. package/dataflow/graph/df-helper.js +29 -7
  78. package/dataflow/graph/diff-dataflow-graph.js +6 -6
  79. package/dataflow/graph/edge.d.ts +27 -0
  80. package/dataflow/graph/edge.js +33 -0
  81. package/dataflow/graph/graph-helper.d.ts +3 -4
  82. package/dataflow/graph/graph-helper.js +4 -5
  83. package/dataflow/graph/graph.d.ts +39 -3
  84. package/dataflow/graph/graph.js +75 -7
  85. package/dataflow/graph/vertex.d.ts +42 -6
  86. package/dataflow/graph/vertex.js +42 -6
  87. package/dataflow/info.d.ts +26 -0
  88. package/dataflow/info.js +28 -1
  89. package/dataflow/internal/linker.d.ts +1 -0
  90. package/dataflow/internal/linker.js +11 -9
  91. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -2
  92. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
  93. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -5
  94. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +2 -2
  95. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -7
  96. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -6
  97. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -0
  98. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +19 -18
  99. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -1
  100. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  101. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +2 -2
  102. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
  103. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -5
  104. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
  105. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -3
  106. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
  107. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -0
  108. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +29 -3
  109. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
  110. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
  111. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -3
  112. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +3 -1
  113. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +44 -20
  114. package/dataflow/internal/process/functions/call/common.d.ts +9 -1
  115. package/dataflow/internal/process/functions/call/common.js +17 -6
  116. package/dataflow/internal/process/functions/call/deferred.js +2 -1
  117. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -1
  118. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -3
  119. package/dataflow/internal/process/functions/call/named-call-handling.js +44 -12
  120. package/dataflow/internal/process/functions/call/nse.d.ts +33 -5
  121. package/dataflow/internal/process/functions/call/nse.js +113 -6
  122. package/dataflow/internal/process/functions/call/quoted.d.ts +5 -0
  123. package/dataflow/internal/process/functions/call/quoted.js +21 -9
  124. package/dataflow/origin/dfg-get-origin.d.ts +1 -0
  125. package/dataflow/origin/dfg-get-origin.js +9 -6
  126. package/documentation/data/faq/faqs.js +88 -88
  127. package/documentation/data/faq/recommended-configs.js +1 -1
  128. package/documentation/data/faq/wiki-faq-store.js +1 -1
  129. package/documentation/doc-capabilities.js +1 -1
  130. package/documentation/doc-readme.js +1 -1
  131. package/documentation/doc-util/doc-auto-gen.js +6 -2
  132. package/documentation/doc-util/doc-functions.js +1 -1
  133. package/documentation/wiki-cfg.js +2 -2
  134. package/documentation/wiki-core.js +1 -1
  135. package/documentation/wiki-create-linting-rules.js +45 -45
  136. package/documentation/wiki-dataflow-graph.js +18 -18
  137. package/documentation/wiki-linter.js +1 -0
  138. package/documentation/wiki-linting-and-testing.js +93 -5
  139. package/documentation/wiki-mk/doc-maker.js +1 -1
  140. package/documentation/wiki-overview.js +12 -1
  141. package/documentation/wiki-query.js +53 -0
  142. package/documentation/wiki-signature-database.js +3 -0
  143. package/linter/linter-output.js +1 -1
  144. package/linter/linter-rules.d.ts +24 -0
  145. package/linter/linter-rules.js +3 -1
  146. package/linter/rules/file-path-validity.js +1 -1
  147. package/linter/rules/function-finder-util.js +1 -1
  148. package/linter/rules/naming-convention.js +1 -1
  149. package/linter/rules/network-functions.d.ts +1 -1
  150. package/linter/rules/no-leaked-credentials.js +2 -1
  151. package/linter/rules/stop-with-call-arg.js +4 -4
  152. package/linter/rules/unclosed-connection.d.ts +44 -0
  153. package/linter/rules/unclosed-connection.js +200 -0
  154. package/linter/rules/undefined-symbol-util.d.ts +1 -1
  155. package/linter/rules/undefined-symbol-util.js +5 -4
  156. package/linter/rules/undefined-symbol.js +3 -3
  157. package/linter/rules/unused-definition.js +2 -1
  158. package/package.json +38 -51
  159. package/project/context/flowr-analyzer-environment-context.d.ts +23 -0
  160. package/project/context/flowr-analyzer-environment-context.js +25 -0
  161. package/project/dependency-version-space.d.ts +3 -3
  162. package/project/dependency-version-space.js +3 -4
  163. package/project/flowr-analyzer.js +1 -1
  164. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +1 -1
  165. package/project/plugins/file-plugins/files/flowr-description-file.js +1 -1
  166. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +1 -1
  167. package/project/plugins/file-plugins/files/flowr-namespace-file.js +1 -1
  168. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +1 -1
  169. package/project/plugins/file-plugins/files/flowr-news-file.js +1 -1
  170. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +1 -1
  171. package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -4
  172. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
  173. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +5 -5
  174. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +36 -7
  175. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +2 -2
  176. package/project/sigdb/build.js +16 -16
  177. package/project/sigdb/codec.d.ts +1 -1
  178. package/project/sigdb/codec.js +13 -13
  179. package/project/sigdb/decompress.d.ts +1 -1
  180. package/project/sigdb/decompress.js +33 -33
  181. package/project/sigdb/index-format.js +2 -2
  182. package/project/sigdb/manifest.d.ts +3 -1
  183. package/project/sigdb/manifest.js +68 -27
  184. package/project/sigdb/memory-source.d.ts +64 -0
  185. package/project/sigdb/memory-source.js +133 -0
  186. package/project/sigdb/reader.js +14 -14
  187. package/project/sigdb/schema.d.ts +2 -2
  188. package/project/sigdb/schema.js +2 -2
  189. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  190. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -2
  191. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  192. package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
  193. package/queries/catalog/dependencies-query/link-devices.js +3 -9
  194. package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
  195. package/queries/catalog/input-sources-query/simple-input-classifier.js +4 -4
  196. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -1
  197. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -0
  198. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +6 -0
  199. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +25 -0
  200. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +31 -0
  201. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +56 -0
  202. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  203. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
  204. package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -0
  205. package/queries/catalog/signature-query/signature-query-executor.js +3 -2
  206. package/queries/catalog/slice-query-options.d.ts +1 -1
  207. package/queries/catalog/slice-query-options.js +1 -1
  208. package/queries/query-function-filter.d.ts +8 -2
  209. package/queries/query-function-filter.js +11 -1
  210. package/queries/query.d.ts +11 -1
  211. package/queries/query.js +2 -0
  212. package/r-bridge/lang-4.x/ast/model/model.d.ts +4 -4
  213. package/r-bridge/lang-4.x/ast/model/model.js +4 -4
  214. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +3 -3
  215. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
  216. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
  217. package/r-bridge/retriever.d.ts +2 -1
  218. package/r-bridge/retriever.js +3 -2
  219. package/r-bridge/roxygen2/documentation-provider.d.ts +1 -0
  220. package/r-bridge/roxygen2/documentation-provider.js +1 -0
  221. package/r-bridge/roxygen2/roxygen-parse.d.ts +1 -1
  222. package/r-bridge/roxygen2/roxygen-parse.js +1 -1
  223. package/search/flowr-search-filters.d.ts +1 -1
  224. package/search/flowr-search-filters.js +2 -14
  225. package/search/search-executor/search-enrichers.js +4 -4
  226. package/search/search-executor/search-generators.js +1 -1
  227. package/slicing/criterion/parse.d.ts +2 -2
  228. package/slicing/criterion/parse.js +5 -5
  229. package/slicing/static/fingerprint.js +1 -1
  230. package/slicing/static/slice-call.d.ts +1 -1
  231. package/slicing/static/slice-call.js +2 -2
  232. package/slicing/static/static-slicer.js +4 -3
  233. package/util/assert.js +1 -1
  234. package/util/log.d.ts +4 -1
  235. package/util/log.js +15 -2
  236. package/util/logic.js +2 -2
  237. package/util/mermaid/cfg.js +1 -1
  238. package/util/mermaid/dfg.js +6 -6
  239. package/util/mermaid/mermaid.js +3 -1
  240. package/util/objects.d.ts +12 -0
  241. package/util/objects.js +48 -0
  242. package/util/quads.js +19 -6
  243. package/util/schema.js +2 -2
  244. package/util/simple-df/dfg-ascii.js +14 -3
  245. package/util/text/ansi.d.ts +2 -0
  246. package/util/text/ansi.js +8 -0
  247. package/util/text/name-rank.d.ts +29 -0
  248. package/util/text/name-rank.js +39 -0
  249. package/util/text/url-encoding.d.ts +15 -0
  250. package/util/text/url-encoding.js +59 -0
  251. package/util/version.js +1 -1
  252. package/cli/export-quads-app.d.ts +0 -7
  253. package/cli/export-quads-app.js +0 -44
@@ -15,119 +15,119 @@ const log_2 = require("../../../util/log");
15
15
  function registerFaqs(ctx) {
16
16
  const wikiFaq = new wiki_faq_store_1.FaqStore();
17
17
  wikiFaq.withTopic('flowr.development')
18
- .addFaq('What are *test labels*?', `
19
- Tests are labeled based on the *flowR* capabilities that they test for.
20
- The list of supported capabilities can be found on the ${ctx.linkPage('wiki/Capabilities', 'Capabilities')} wiki page.
21
- For more extensive information on test labels, see the ${ctx.linkPage('wiki/Linting and Testing', 'test labels wiki section', 'test-labels')}.
18
+ .addFaq('What are *test labels*?', `
19
+ Tests are labeled based on the *flowR* capabilities that they test for.
20
+ The list of supported capabilities can be found on the ${ctx.linkPage('wiki/Capabilities', 'Capabilities')} wiki page.
21
+ For more extensive information on test labels, see the ${ctx.linkPage('wiki/Linting and Testing', 'test labels wiki section', 'test-labels')}.
22
22
  `)
23
- .addFaq('How do I run *all checks* before pushing?', `
24
- Run \`npm run checkup\`: it runs the linter, the functionality and system tests, the wiki generation, and the docker image build + smoke test concurrently, then prints one pass/fail summary.
25
- Run a subset with the job ids (e.g. \`npm run checkup -- lint tests\`) or skip the container build with \`npm run checkup -- --no-docker\`.
23
+ .addFaq('How do I run *all checks* before pushing?', `
24
+ Run \`npm run checkup\`: it runs the linter, the functionality and system tests, the wiki generation, and the docker image build + smoke test concurrently, then prints one pass/fail summary.
25
+ Run a subset with the job ids (e.g. \`npm run checkup -- lint tests\`) or skip the container build with \`npm run checkup -- --no-docker\`.
26
26
  `)
27
- .addFaq('How to get a REPL with debug-info/*hot-reload*?', `
28
- To enter the development repl, execute \`npm run main-dev\` in contrast to \`npm run flowr\`
29
- this will use an unminified build (keeping debug info) and also watches the source files for changes.
30
- In case of a change, this mode automatically recompiles.
31
- Please note, that this may have negative performance implications (so do not use this for e.g., benchmarking).
27
+ .addFaq('How to get a REPL with debug-info/*hot-reload*?', `
28
+ To enter the development repl, execute \`npm run main-dev\` in contrast to \`npm run flowr\`
29
+ this will use an unminified build (keeping debug info) and also watches the source files for changes.
30
+ In case of a change, this mode automatically recompiles.
31
+ Please note, that this may have negative performance implications (so do not use this for e.g., benchmarking).
32
32
  `)
33
- .addFaq('How to generate *mermaid diagrams*?', `
34
- There are several ways to generate mermaid diagrams based on the input data that you want to use.
35
- - From the AST (abstract syntax tree): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/ast.ts')}
36
- - From the CFG (control flow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/cfg.ts')}
37
- - From the DFG (dataflow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/dfg.ts')}
33
+ .addFaq('How to generate *mermaid diagrams*?', `
34
+ There are several ways to generate mermaid diagrams based on the input data that you want to use.
35
+ - From the AST (abstract syntax tree): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/ast.ts')}
36
+ - From the CFG (control flow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/cfg.ts')}
37
+ - From the DFG (dataflow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/dfg.ts')}
38
38
  `)
39
- .addFaq('How to create *new wiki* pages?', `
40
- To create an automatically generated wiki page, you can follow these steps:
41
- - Create a new file in \`src/documentation\` with a name like \`wiki-thename.ts\`.
42
- - Register your new wiki page in the \`src/cli/wiki.ts\` file to have it executed by the wiki generation tool.
43
-
44
- You can test your page by piping the wiki generation script to a file. For example, you can run the following command:
45
- ${(0, doc_code_1.codeBlock)('shell', 'npm run wiki')}
46
- Alternatively use the following to generate a specific wiki page:
47
- ${(0, doc_code_1.codeBlock)('shell', 'npm run wiki -- --filter=Dataflow')}
48
- Or, activate the watch mode to automatically regenerate the wiki on changes:
49
- ${(0, doc_code_1.codeBlock)('shell', 'npm run wiki:watch')}
50
-
39
+ .addFaq('How to create *new wiki* pages?', `
40
+ To create an automatically generated wiki page, you can follow these steps:
41
+ - Create a new file in \`src/documentation\` with a name like \`wiki-thename.ts\`.
42
+ - Register your new wiki page in the \`src/cli/wiki.ts\` file to have it executed by the wiki generation tool.
43
+
44
+ You can test your page by piping the wiki generation script to a file. For example, you can run the following command:
45
+ ${(0, doc_code_1.codeBlock)('shell', 'npm run wiki')}
46
+ Alternatively use the following to generate a specific wiki page:
47
+ ${(0, doc_code_1.codeBlock)('shell', 'npm run wiki -- --filter=Dataflow')}
48
+ Or, activate the watch mode to automatically regenerate the wiki on changes:
49
+ ${(0, doc_code_1.codeBlock)('shell', 'npm run wiki:watch')}
50
+
51
51
  `)
52
- .addFaq('Why can\'t I pass *arguments* when running flowR *with npm*?', `
53
- With \`npm\` you have to pass arguments in a specific way. The \`--\` operator is used to separate the \`npm\` arguments from the script arguments. For example, if you want to run \`flowR\` with the \`--help\` argument, you can use the following command:
54
- ${(0, doc_code_1.codeBlock)('shell', 'npm run flowr -- --help')}
52
+ .addFaq('Why can\'t I pass *arguments* when running flowR *with npm*?', `
53
+ With \`npm\` you have to pass arguments in a specific way. The \`--\` operator is used to separate the \`npm\` arguments from the script arguments. For example, if you want to run \`flowR\` with the \`--help\` argument, you can use the following command:
54
+ ${(0, doc_code_1.codeBlock)('shell', 'npm run flowr -- --help')}
55
55
  `)
56
- .addFaq('How to do *logging* in flowR?', `
57
- Check out the ${ctx.linkPage('wiki/Linting and Testing', 'Logging Section in the Linting and Testing wiki page', 'logging')} for more information on how to do logging in *flowR*.
56
+ .addFaq('How to do *logging* in flowR?', `
57
+ Check out the ${ctx.linkPage('wiki/Linting and Testing', 'Logging Section in the Linting and Testing wiki page', 'logging')} for more information on how to do logging in *flowR*.
58
58
  `)
59
- .addFaq('How to get flowR to *talk*?', `
60
- When using flowR from the CLI, you can use the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'verbose')} option to get more information about what flowR is doing.
61
- While coding, however, you can use the ${ctx.link(log_1.setMinLevelOfAllLogs)} function to set the minimum level of logs to be displayed (this works with the ${ctx.link(log_2.FlowrLogger)} abstraction).
62
- In general, you can configure the levels of individual logs, such as the general \`log\` (obtained with ${ctx.link('getActiveLog')}) or the ${ctx.link('parseLog')}.
63
- Please note that flowR makes no guarantees that log outputs are persistent across versions, and it is up to the implementors to provide sensible logging.
64
- If you are an implementor and want to add logging, please make sure there are no larger runtime implications when logging is disabled.
65
- Have a look at the ${ctx.link(log_2.expensiveTrace)} function for example, which uses a function to generate the log message only when the log level is reached.
59
+ .addFaq('How to get flowR to *talk*?', `
60
+ When using flowR from the CLI, you can use the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'verbose')} option to get more information about what flowR is doing.
61
+ While coding, however, you can use the ${ctx.link(log_1.setMinLevelOfAllLogs)} function to set the minimum level of logs to be displayed (this works with the ${ctx.link(log_2.FlowrLogger)} abstraction).
62
+ In general, you can configure the levels of individual logs, such as the general \`log\` (obtained with ${ctx.link('getActiveLog')}) or the ${ctx.link('parseLog')}.
63
+ Please note that flowR makes no guarantees that log outputs are persistent across versions, and it is up to the implementors to provide sensible logging.
64
+ If you are an implementor and want to add logging, please make sure there are no larger runtime implications when logging is disabled.
65
+ Have a look at the ${ctx.link(log_2.expensiveTrace)} function for example, which uses a function to generate the log message only when the log level is reached.
66
66
  `)
67
- .addFaq('How to run *tests* with *verbose* logging?', `
68
- Use the dedicated npm script to run all tests with trace-level log output:
69
- ${(0, doc_code_1.codeBlock)('shell', 'npm run test:verbose')}
70
- Alternatively, set the \`FLOWR_VERBOSE\` environment variable directly:
71
- ${(0, doc_code_1.codeBlock)('shell', 'FLOWR_VERBOSE=true npm run test')}
72
- Both forms accept the usual vitest filters (e.g. \`npm run test:verbose -- cli/server\`).
67
+ .addFaq('How to run *tests* with *verbose* logging?', `
68
+ Use the dedicated npm script to run all tests with trace-level log output:
69
+ ${(0, doc_code_1.codeBlock)('shell', 'npm run test:verbose')}
70
+ Alternatively, set the \`FLOWR_VERBOSE\` environment variable directly:
71
+ ${(0, doc_code_1.codeBlock)('shell', 'FLOWR_VERBOSE=true npm run test')}
72
+ Both forms accept the usual vitest filters (e.g. \`npm run test:verbose -- cli/server\`).
73
73
  `)
74
- .addFaq('How to add a *linting rule*?', `
75
- To add a new linting rule, see ${ctx.linkPage('wiki/Create Linting Rules')}.
74
+ .addFaq('How to add a *linting rule*?', `
75
+ To add a new linting rule, see ${ctx.linkPage('wiki/Create Linting Rules')}.
76
76
  `);
77
77
  wikiFaq.withTopic('flowr.use')
78
- .addFaq('How to *watch* a file for changes in the REPL?', `
79
- Replace the \`file://\` prefix with \`watch://\` when passing a path to any REPL command.
80
- flowR will run the command immediately and then re-run it every time the file (or any file inside the specified folder) changes.
81
- Press Ctrl+C or enter any other command to leave watch mode.
82
- ${(0, doc_code_1.codeBlock)('shell', ':df watch://path/to/analysis.R')}
83
- For a folder, flowR uses the same project discovery as with \`file://\`:
84
- ${(0, doc_code_1.codeBlock)('shell', ':query @linter watch://path/to/project')}
78
+ .addFaq('How to *watch* a file for changes in the REPL?', `
79
+ Replace the \`file://\` prefix with \`watch://\` when passing a path to any REPL command.
80
+ flowR will run the command immediately and then re-run it every time the file (or any file inside the specified folder) changes.
81
+ Press Ctrl+C or enter any other command to leave watch mode.
82
+ ${(0, doc_code_1.codeBlock)('shell', ':df watch://path/to/analysis.R')}
83
+ For a folder, flowR uses the same project discovery as with \`file://\`:
84
+ ${(0, doc_code_1.codeBlock)('shell', ':query @linter watch://path/to/project')}
85
85
  `)
86
- .addFaq('How to *query* an R project?', `
87
- For this you can use flowR's ${ctx.linkPage('wiki/Query API', 'Query API')}.
88
- If you want to create your own project using flowR as a library, check out the
89
- [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-project-query](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-project-query) repository for an example project setup.
86
+ .addFaq('How to *query* an R project?', `
87
+ For this you can use flowR's ${ctx.linkPage('wiki/Query API', 'Query API')}.
88
+ If you want to create your own project using flowR as a library, check out the
89
+ [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-project-query](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-project-query) repository for an example project setup.
90
90
  `)
91
- .addFaq('How to configure flowR *per kind of project*?', `
92
- Use ${ctx.linkConfig('specializeConfig')}: it overwrites (parts of) the configuration depending on the kind of project flowR detects (e.g. \`${project_kind_1.ProjectKind.ShinyApp}\`).
93
- This is how a shiny app gets its ${ctx.linkConfig('project.implicitSources')} out of the box, as shiny loads these files without any \`source()\` call:
91
+ .addFaq('How to configure flowR *per kind of project*?', `
92
+ Use ${ctx.linkConfig('specializeConfig')}: it overwrites (parts of) the configuration depending on the kind of project flowR detects (e.g. \`${project_kind_1.ProjectKind.ShinyApp}\`).
93
+ This is how a shiny app gets its ${ctx.linkConfig('project.implicitSources')} out of the box, as shiny loads these files without any \`source()\` call:
94
94
  ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
95
95
  specializeConfig: {
96
96
  [project_kind_1.ProjectKind.ShinyApp]: { project: { implicitSources: ['global.R', 'ui.R', 'server.R', 'app.R'] } }
97
97
  }
98
- }, null, 2))}
99
- Anything you configure directly wins over the value the project kind defaults to, so setting \`project.implicitSources\` yourself overrides the list above.
98
+ }, null, 2))}
99
+ Anything you configure directly wins over the value the project kind defaults to, so setting \`project.implicitSources\` yourself overrides the list above.
100
100
  `);
101
101
  wikiFaq.withTopic('r.packages')
102
- .addFaq('What is the R *prelude* and R *base* package?', `
103
- The base package contains lots of base functions like \`source\` for example.
104
- The R prelude includes the base package along with several other packages.
105
- Packages that were loaded by the prelude can be called without prefixing the
106
- function call with the package name and the \`::\` operator.
107
-
108
- The packages loaded by the R prelude can be seen in the \`attached base packages\`
109
- sections in the output of \`sessionInfo()\`.
102
+ .addFaq('What is the R *prelude* and R *base* package?', `
103
+ The base package contains lots of base functions like \`source\` for example.
104
+ The R prelude includes the base package along with several other packages.
105
+ Packages that were loaded by the prelude can be called without prefixing the
106
+ function call with the package name and the \`::\` operator.
107
+
108
+ The packages loaded by the R prelude can be seen in the \`attached base packages\`
109
+ sections in the output of \`sessionInfo()\`.
110
110
  `)
111
- .addFaq('How to get *documentation* for a function or package?', `
112
- There are a couple of ways to get documentation for a function or package.
113
-
114
- 🖥️ Firstly, if you have already installed the package the function originated from you can simply run \`?<package name>::<function name>\` in an R session to print the
115
- relevant documentation. If you don't know the origin of the package, you can use
116
- \`??<function name>\` in an R shell to fuzzy find all documentations containing
117
- \`<function name>\` or something similar.
118
-
119
- 🌐 Secondly, if you don't have or don't want to install the package you can simply google the fully qualified name of the function. Good sources include [rdrr.io](https://rdrr.io/)
120
- or [rdocumentation.org](https://rdocumentation.org/). Additionally, the package documentation PDF can also
121
- be downloaded directly from [cran](https://cran.r-project.org/).
111
+ .addFaq('How to get *documentation* for a function or package?', `
112
+ There are a couple of ways to get documentation for a function or package.
113
+
114
+ 🖥️ Firstly, if you have already installed the package the function originated from you can simply run \`?<package name>::<function name>\` in an R session to print the
115
+ relevant documentation. If you don't know the origin of the package, you can use
116
+ \`??<function name>\` in an R shell to fuzzy find all documentations containing
117
+ \`<function name>\` or something similar.
118
+
119
+ 🌐 Secondly, if you don't have or don't want to install the package you can simply google the fully qualified name of the function. Good sources include [rdrr.io](https://rdrr.io/)
120
+ or [rdocumentation.org](https://rdocumentation.org/). Additionally, the package documentation PDF can also
121
+ be downloaded directly from [cran](https://cran.r-project.org/).
122
122
  `)
123
- .addFaq('How does flowR know a *package\'s exports*?', `
124
- See the ${ctx.linkPage('wiki/Signature Database', 'Signature Database')} wiki page.
123
+ .addFaq('How does flowR know a *package\'s exports*?', `
124
+ See the ${ctx.linkPage('wiki/Signature Database', 'Signature Database')} wiki page.
125
125
  `);
126
126
  wikiFaq.withTopic('editor.configs')
127
- .addFaq('How can I make eslint and ZED work together?', `Use this project config (\`.zed/settings.json\`) to disable all formatters except eslint:
127
+ .addFaq('How can I make eslint and ZED work together?', `Use this project config (\`.zed/settings.json\`) to disable all formatters except eslint:
128
128
  ${(0, doc_code_1.codeBlock)('json', JSON.stringify(recommended_configs_1.recommendedZedConfig, null, 2))}`);
129
129
  wikiFaq.withTopic('editor.configs')
130
- .addFaq('How can I launch the flowr repl form vs code?', `You can use the following launch task (\`.vscode/launch.json\`):
130
+ .addFaq('How can I launch the flowr repl form vs code?', `You can use the following launch task (\`.vscode/launch.json\`):
131
131
  ${(0, doc_code_1.codeBlock)('json', JSON.stringify(recommended_configs_1.recommendedVsCodeTask, null, 2))}`);
132
132
  return wikiFaq;
133
133
  }
@@ -26,7 +26,7 @@ exports.recommendedVsCodeTask = {
26
26
  'node_modules/**'
27
27
  ],
28
28
  'program': '${workspaceFolder}/src/cli/flowr.ts',
29
- 'preLaunchTask': 'npm: build-dev',
29
+ 'preLaunchTask': 'npm: build:dev',
30
30
  'console': 'integratedTerminal',
31
31
  },
32
32
  {
@@ -25,7 +25,7 @@ class FaqStore {
25
25
  (0, assert_1.guard)(this.currTopic !== undefined, 'Current topic is not set use withTopic first');
26
26
  question = question.replace(/\*([^*]+)\*/g, '<b>$1</b>');
27
27
  const store = this.faqs.get(this.currTopic);
28
- if (store.find(([q]) => q === question)) {
28
+ if (store.some(([q]) => q === question)) {
29
29
  throw new Error(`FAQ for question "${question}" in topic "${this.currTopic}" already exists`);
30
30
  }
31
31
  store.push([question, answer]);
@@ -162,7 +162,7 @@ class DocCapabilities extends doc_maker_1.DocMaker {
162
162
  async text({ treeSitter }) {
163
163
  /* check if the detailed test data is available */
164
164
  if (!fs_1.default.existsSync(detailedInfoFile)) {
165
- console.warn('\x1b[31mNo detailed test data available. Run the full tests (npm run test-full) to generate it.\x1b[m');
165
+ console.warn('\x1b[31mNo detailed test data available. Run the full tests (npm run test:full) to generate it.\x1b[m');
166
166
  }
167
167
  return getPreamble() + await printAsMarkdown({ parser: treeSitter, info: obtainDetailedInfos() }, data_1.flowrCapabilities.capabilities);
168
168
  }
@@ -133,7 +133,7 @@ class DocReadme extends doc_maker_1.DocMaker {
133
133
  async text({ treeSitter, ctx }) {
134
134
  const dateOptions = { year: 'numeric', month: 'short', day: 'numeric' };
135
135
  return `
136
- [![flowR logo](https://raw.githubusercontent.com/wiki/flowr-analysis/flowr/img/flowR.png)](${doc_files_1.FlowrGithubBaseRef}/flowr/wiki)\\
136
+ [![flowR logo](https://raw.githubusercontent.com/wiki/flowr-analysis/flowr/img/flowR.png)](${doc_files_1.FlowrSiteBaseRef}/)\\
137
137
  [![QA (and potentially deploy)](${doc_files_1.FlowrGithubBaseRef}/flowr/actions/workflows/qa.yaml/badge.svg)](${doc_files_1.FlowrGithubBaseRef}/flowr/actions/workflows/qa.yaml)
138
138
  [![codecov](https://codecov.io/gh/flowr-analysis/flowr/graph/badge.svg)](https://codecov.io/gh/flowr-analysis/flowr)
139
139
  [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/eagleoutice/flowr?logo=docker&logoColor=white&label=dockerhub)](${doc_files_1.FlowrDockerRef})
@@ -8,13 +8,17 @@ const doc_files_1 = require("./doc-files");
8
8
  *
9
9
  */
10
10
  function autoGenHeader({ rVersion, filename, purpose, currentDateAndTime = new Date().toISOString().replace('T', ', ').replace(/\.\d+Z$/, ' UTC') }) {
11
- return `_This document was generated from '${fileNameForGenHeader(filename)}' on ${currentDateAndTime} presenting an overview of flowR's ${purpose} (v${(0, version_1.flowrVersion)().format()}${rVersion ? ', using R v' + rVersion : ''}). Please do not edit this file/wiki page directly._`;
11
+ /* what the page is about only shows on hover: the line above every page should be short */
12
+ return `_<span title="an overview of flowR's ${purpose}">Generated</span> from`
13
+ + ` '${fileNameForGenHeader(filename)}' on ${currentDateAndTime} (v${(0, version_1.flowrVersion)().format()}${rVersion ? ', R v' + rVersion : ''}),`
14
+ + ' please do not edit directly._';
12
15
  }
13
16
  /**
14
17
  *
15
18
  */
16
19
  function fileNameForGenHeader(filename) {
17
20
  const shortenFilename = filename.replace(/^.*src\//, 'src/');
18
- return (0, doc_files_1.linkFlowRSourceFile)(shortenFilename);
21
+ /* the line above every page stays short: only the file name shows, the path waits in the tooltip */
22
+ return `[${shortenFilename.split('/').pop() ?? shortenFilename}](${(0, doc_files_1.flowrSourceFileUrl)(shortenFilename)} "${shortenFilename}")`;
19
23
  }
20
24
  //# sourceMappingURL=doc-auto-gen.js.map
@@ -19,7 +19,7 @@ function collectHierarchyInformation(sourceFiles, options, fname) {
19
19
  const name = node.expression.getText(sourceFile);
20
20
  if (!fname || fname.test(name)) {
21
21
  const comments = typescript_1.default.getLeadingCommentRanges(sourceFile.getText(sourceFile), node.getFullStart())?.map(c => {
22
- return (0, doc_types_1.removeCommentSymbolsFromTypeScriptComment)(sourceFile.getText(sourceFile).substring(c.pos, c.end).trim());
22
+ return (0, doc_types_1.removeCommentSymbolsFromTypeScriptComment)(sourceFile.getText(sourceFile).slice(c.pos, c.end).trim());
23
23
  });
24
24
  hierarchyList.push({
25
25
  name: (0, doc_types_1.dropGenericsFromTypeName)(name),
@@ -18,7 +18,6 @@ const basic_cfg_guided_visitor_1 = require("../control-flow/basic-cfg-guided-vis
18
18
  const syntax_cfg_guided_visitor_1 = require("../control-flow/syntax-cfg-guided-visitor");
19
19
  const diff_cfg_1 = require("../control-flow/diff-cfg");
20
20
  const node_id_1 = require("../r-bridge/lang-4.x/ast/model/processing/node-id");
21
- const dfg_get_origin_1 = require("../dataflow/origin/dfg-get-origin");
22
21
  const dfg_cfg_guided_visitor_1 = require("../control-flow/dfg-cfg-guided-visitor");
23
22
  const semantic_cfg_guided_visitor_1 = require("../control-flow/semantic-cfg-guided-visitor");
24
23
  const doc_issue_1 = require("./doc-util/doc-issue");
@@ -28,6 +27,7 @@ const flowr_analyzer_context_1 = require("../project/context/flowr-analyzer-cont
28
27
  const doc_maker_1 = require("./wiki-mk/doc-maker");
29
28
  const doc_general_1 = require("./doc-util/doc-general");
30
29
  const doc_code_1 = require("./doc-util/doc-code");
30
+ const df_helper_1 = require("../dataflow/graph/df-helper");
31
31
  const CfgLongExample = `f <- function(a, b = 3) {
32
32
  if(a > b) {
33
33
  return(a * b);
@@ -466,7 +466,7 @@ ${(0, doc_structure_1.section)('Dataflow-Aware CFG Visitor', 4, 'cfg-traversal-d
466
466
 
467
467
  There is a lot of benefit in incorporating the ${ctx.linkPage('wiki/Dataflow Graph', 'dataflow information')} into the CFG traversal, as it contains
468
468
  information about overwritten function calls, definition targets, and so on.
469
- Our best friend is the ${ctx.link(dfg_get_origin_1.getOriginInDfg)} function which provides the important information about the origin of a vertex in the dataflow graph.
469
+ Our best friend is the ${ctx.link(df_helper_1.Dataflow.origin)} function which provides the important information about the origin of a vertex in the dataflow graph.
470
470
  The ${ctx.link(dfg_cfg_guided_visitor_1.DataflowAwareCfgGuidedVisitor)} class does some of the basic lifting for us.
471
471
  While it is not ideal for our goal of collecting all numbers, it shines in other areas such as collecting all used variables,&nbsp;...
472
472
 
@@ -476,7 +476,7 @@ to produce a new dataflow information to pass upwards in the fold. The ${ctx.lin
476
476
  * the ${ctx.link(graph_1.DataflowGraph)} of the current subtree
477
477
  * the currently active ${ctx.link('REnvironmentInformation')} as an abstraction of all active definitions linking to potential definition locations (see [Advanced R::Environments](https://adv-r.hadley.nz/environments.html))
478
478
  * control flow information in ${ctx.link('DataflowCfgInformation')} which is used to enrich the dataflow information with control flow information
479
- * sets of currently ingoing (read), outgoing (write) and unknown ${ctx.link('IdentifierReference')}s.
479
+ * sets of currently ingoing (read), outgoing (write), and unknown ${ctx.link('IdentifierReference')}s.
480
480
  * and a set of ${ctx.link('KillReference')}s which tracks variables that go out of scope within the current subtree (e.g., due to \`rm\`). Just like the reference sets above, kills are carried upwards in the fold so that the enclosing scope (expression list, branch, loop, or function body) can apply the removal (via ${ctx.link('applyKills')}) at the correct location, even when the \`rm\` happens nested within a branch or block. This also covers clearing the whole environment with \`rm(list=ls())\` and conservatively handling removals whose target cannot be resolved statically.
481
481
 
482
482
  While all of them are essentially empty when processing an “uninteresting leaf”, handling a constant is slightly more interesting with ${ctx.link(process_value_1.processValue)}:
@@ -43,51 +43,51 @@ class WikiCreateLintingRules extends doc_maker_1.DocMaker {
43
43
  super('wiki/Create Linting Rules.md', module.filename, 'creating linting rules');
44
44
  }
45
45
  text({ ctx }) {
46
- return `
47
- # Create Linting Rules
48
-
49
- This page explains how to add a new linting rule to flowR. For an overview of the linter and the existing linting rules, see ${ctx.linkPage('wiki/Linter')}.
50
-
51
- ## Step 1: Create the new rule file
52
-
53
- To add a new linting rule, create a dedicated rule file next to the existing rule implementations. The file name should correspond to the exported linting rule object, for example \`my-new-rule.ts\` for a rule object named \`MY_NEW_RULE\`.
54
- Existing rules such as ${ctx.link('DEPRECATED_FUNCTIONS')} can be used as references.
55
- Before implementing a new linting rule, open a corresponding [linting rule issue](${doc_files_1.FlowrGithubRef}/issues/new?template=linting-rule.yaml) using the accompanying issue template.
56
-
57
- ## Step 2: Define the types for the rule
58
-
59
- For new rules, the central interface is ${ctx.link('LintingRule')}. Its type parameters are documented directly as part of the interface.
60
-
61
- ## Step 3: Define the rule itself
62
-
63
- A new linting rule must implement the ${ctx.link('LintingRule')} interface. It consists of the following main parts:
64
-
65
- ${lintingRuleFields(ctx)}
66
-
67
- The ${ctx.link('LintingRule::info')} field has type ${ctx.link('LinterRuleInformation')} and contains:
68
-
69
- ${lintingRuleInfoFields(ctx)}
70
-
71
- The following example shows the basic structure of a linting rule:
72
-
73
- ${ctx.code(defineRule, { dropLinesStart: 8, dropLinesEnd: 2 })}
74
-
75
-
76
- ## Step 4: Register the rule
77
-
78
- After implementing the rule, register it by adding it to ${ctx.link('LintingRules')}.
79
-
80
-
81
- ## Step 5: Add the rule to the linter wiki generation
82
-
83
- After registering the rule, add a corresponding \`rule\` entry to the linter wiki generation in ${ctx.link('WikiLinter')}. These entries are used to generate the linter overview and the individual wiki pages for linting rules, which can then be inspected through ${ctx.linkPage('wiki/Linter')}.
84
-
85
- ## Step 6: Add tests for the rule
86
-
87
- New linting rules should be covered by tests following the existing linter test pattern. The test file should be named \`lint-<my-new-rule>.test.ts\`. Existing linter tests can be used as references for the expected structure.
88
-
89
- The linter wiki automatically extracts additional examples from these tests by reading \`assertLinter\` calls. If a test should not appear as a generated wiki example, add \`/* @ignore-in-wiki */\` to the test.
90
- For general information on creating and regenerating wiki pages, see ${ctx.linkPage('wiki/FAQ')}, especially the FAQ entry on creating new wiki pages. The linter overview and the generated rule documentation can then be inspected through ${ctx.linkPage('wiki/Linter')}.
46
+ return `
47
+ # Create Linting Rules
48
+
49
+ This page explains how to add a new linting rule to flowR. For an overview of the linter and the existing linting rules, see ${ctx.linkPage('wiki/Linter')}.
50
+
51
+ ## Step 1: Create the new rule file
52
+
53
+ To add a new linting rule, create a dedicated rule file next to the existing rule implementations. The file name should correspond to the exported linting rule object, for example \`my-new-rule.ts\` for a rule object named \`MY_NEW_RULE\`.
54
+ Existing rules such as ${ctx.link('DEPRECATED_FUNCTIONS')} can be used as references.
55
+ Before implementing a new linting rule, open a corresponding [linting rule issue](${doc_files_1.FlowrGithubRef}/issues/new?template=linting-rule.yaml) using the accompanying issue template.
56
+
57
+ ## Step 2: Define the types for the rule
58
+
59
+ For new rules, the central interface is ${ctx.link('LintingRule')}. Its type parameters are documented directly as part of the interface.
60
+
61
+ ## Step 3: Define the rule itself
62
+
63
+ A new linting rule must implement the ${ctx.link('LintingRule')} interface. It consists of the following main parts:
64
+
65
+ ${lintingRuleFields(ctx)}
66
+
67
+ The ${ctx.link('LintingRule::info')} field has type ${ctx.link('LinterRuleInformation')} and contains:
68
+
69
+ ${lintingRuleInfoFields(ctx)}
70
+
71
+ The following example shows the basic structure of a linting rule:
72
+
73
+ ${ctx.code(defineRule, { dropLinesStart: 8, dropLinesEnd: 2 })}
74
+
75
+
76
+ ## Step 4: Register the rule
77
+
78
+ After implementing the rule, register it by adding it to ${ctx.link('LintingRules')}.
79
+
80
+
81
+ ## Step 5: Add the rule to the linter wiki generation
82
+
83
+ After registering the rule, add a corresponding \`rule\` entry to the linter wiki generation in ${ctx.link('WikiLinter')}. These entries are used to generate the linter overview and the individual wiki pages for linting rules, which can then be inspected through ${ctx.linkPage('wiki/Linter')}.
84
+
85
+ ## Step 6: Add tests for the rule
86
+
87
+ New linting rules should be covered by tests following the existing linter test pattern. The test file should be named \`lint-<my-new-rule>.test.ts\`. Existing linter tests can be used as references for the expected structure.
88
+
89
+ The linter wiki automatically extracts additional examples from these tests by reading \`assertLinter\` calls. If a test should not appear as a generated wiki example, add \`/* @ignore-in-wiki */\` to the test.
90
+ For general information on creating and regenerating wiki pages, see ${ctx.linkPage('wiki/FAQ')}, especially the FAQ entry on creating new wiki pages. The linter overview and the generated rule documentation can then be inspected through ${ctx.linkPage('wiki/Linter')}.
91
91
  `;
92
92
  }
93
93
  }
@@ -27,13 +27,11 @@ const doc_general_1 = require("./doc-util/doc-general");
27
27
  const node_id_1 = require("../r-bridge/lang-4.x/ast/model/processing/node-id");
28
28
  const identifier_1 = require("../dataflow/environments/identifier");
29
29
  const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
30
- const resolve_by_name_1 = require("../dataflow/environments/resolve-by-name");
31
30
  const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
32
31
  const text_1 = require("../util/text/text");
33
32
  const linker_1 = require("../dataflow/internal/linker");
34
33
  const apply_kill_1 = require("../dataflow/environments/apply-kill");
35
34
  const doc_normalized_ast_1 = require("./doc-util/doc-normalized-ast");
36
- const dfg_get_origin_1 = require("../dataflow/origin/dfg-get-origin");
37
35
  const identify_link_to_last_call_relation_1 = require("../queries/catalog/call-context-query/identify-link-to-last-call-relation");
38
36
  const alias_tracking_1 = require("../dataflow/eval/resolve/alias-tracking");
39
37
  const doc_issue_1 = require("./doc-util/doc-issue");
@@ -51,6 +49,7 @@ const range_1 = require("../util/range");
51
49
  const df_helper_1 = require("../dataflow/graph/df-helper");
52
50
  const resolve_helper_1 = require("../dataflow/environments/resolve-helper");
53
51
  const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
52
+ const vertex_2 = require("../dataflow/graph/vertex");
54
53
  async function subExplanation(parser, ctx, { description, code, expectedSubgraph }) {
55
54
  expectedSubgraph = await (0, doc_dfg_1.verifyExpectedSubgraph)(parser, code, expectedSubgraph);
56
55
  const marks = [];
@@ -178,7 +177,7 @@ ${(0, doc_structure_1.block)({
178
177
  content: `
179
178
  If you want to obtain the locations where a variable is defined, or read, or re-defined, refrain from tracking these details manually in the dataflow graph
180
179
  as there are some edge-cases that require special attention.
181
- In general, the ${ctx.link(dfg_get_origin_1.getOriginInDfg)} (which is also available as ${ctx.linkO(df_helper_1.Dataflow, 'origin')}) function explained below in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')} will help you to get the information you need.
180
+ In general, the ${ctx.link(df_helper_1.Dataflow.origin)} (which is also available as ${ctx.linkO(df_helper_1.Dataflow, 'origin')}) function explained below in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')} will help you to get the information you need.
182
181
  `
183
182
  })}
184
183
 
@@ -195,6 +194,7 @@ In general the vertex provides you with information about
195
194
  the _name_ of the called function, the passed _arguments_, and the _environment_ in which the call happens (if it is of importance).
196
195
 
197
196
  Whenever flowR can determine which package a call resolves to &mdash; via a loaded \`library()\`/\`::\`, or via the always-available base-R packages taken from the ${ctx.linkPage('wiki/Signature Database', 'signature database')} &mdash; the mermaid visualization prints the **package-qualified name** in place of the bare one (e.g. \`acf\` is shown as \`stats::acf\`). To obtain this qualified identifier programmatically, prefer ${ctx.linkO(df_helper_1.Dataflow, 'qualify')} which, given only a call's id and its graph, reconstructs the \`pkg::fn\` identifier from the origins (and, for base R, from the exporting package) &mdash; the compact form of \`Identifier.toQualified\` (see the \`origin\` property below and the ${ctx.linkPage('wiki/Signature Database', 'signature database')} for where the base-R knowledge comes from).
197
+ The graph caches what it resolved, with and without the base-R step, and drops the cache whenever it changes, so asking twice costs a map lookup. If you want the qualified name of every call, use ${ctx.linkO(df_helper_1.Dataflow, 'qualifyAll')}: it walks the call vertices once and pays the (expensive) origin resolution once per call instead of once per ask.
198
198
 
199
199
  However, the implementation reveals that it may hold an additional \`onlyBuiltin\` flag to indicate that the call is only calling builtin functions &mdash; however, this is only a flag to improve performance,
200
200
  and it should not be relied on as it may under-approximate the actual calling targets (e.g., being \`false\` even though all calls resolve to builtins).
@@ -212,7 +212,7 @@ However, in general, flowR may use any fitting handler as an origin (see the ${c
212
212
  ${(0, doc_structure_1.details)('Example: Simple Function Call (unresolved)', await (async () => {
213
213
  const code = 'foo(x,3,y=3,)';
214
214
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set([8]), exposeResult: true, ctx });
215
- const callInfo = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && identifier_1.Identifier.getName(vertex.name) === 'foo');
215
+ const callInfo = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex_2.FunctionCallVertex.is(vertex) && identifier_1.Identifier.getName(vertex.name) === 'foo');
216
216
  (0, assert_1.guard)(callInfo !== undefined, () => `Could not find call vertex for ${code}`);
217
217
  const [callId, callVert] = callInfo;
218
218
  const inverseMapReferenceTypes = Object.fromEntries(Object.entries(identifier_1.ReferenceType).map(([k, v]) => [v, k]));
@@ -268,7 +268,7 @@ In this case, the call does not have a single ${linkEdgeName(edge_1.EdgeType.Cal
268
268
  global beyond the scope of the given script. _flowR_ generally (theoretically at least) does not know if the call really refers to a built-in variable or function,
269
269
  as any code that is not part of the analysis could cause the semantics to change.
270
270
  However, it is (in most cases) safe to assume we call a builtin if there is a builtin function with the given name and if there is no ${linkEdgeName(edge_1.EdgeType.Calls)} edge attached to a call.
271
- If you want to check the resolve targets, refer to ${ctx.link(resolve_by_name_1.resolveByName)}.
271
+ If you want to check the resolve targets, refer to ${ctx.link(resolve_helper_1.Resolve.byNameAndType)}.
272
272
  `)}
273
273
 
274
274
  ${(0, doc_structure_1.details)('2) the function only resolves to definitions that are present in the program', `
@@ -279,7 +279,7 @@ ${await (async () => {
279
279
  const code = 'foo <- function() 3\nfoo()';
280
280
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { exposeResult: true, mark: new Set([6, '6->0', '6->1', '6->3']), ctx });
281
281
  const numberOfEdges = [...info.dataflow.graph.edges()].flatMap(e => [...e[1].keys()]).length;
282
- const callVertex = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && identifier_1.Identifier.getName(vertex.name) === 'foo');
282
+ const callVertex = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex_2.FunctionCallVertex.is(vertex) && identifier_1.Identifier.getName(vertex.name) === 'foo');
283
283
  (0, assert_1.guard)(callVertex !== undefined, () => `Could not find call vertex for ${code}`);
284
284
  const [callId] = callVertex;
285
285
  return `
@@ -349,8 +349,8 @@ Great, you should see a definition of \`<-\` which is constraint by the [control
349
349
  Hence, trying to re-resolve the call using ${ctx.link(linker_1.getAllFunctionCallTargets)} (defined in ${(0, doc_files_1.getFilePathMd)('../dataflow/internal/linker.ts')}) with the id \`${id}\` of the call as starting point will present you with
350
350
  the following target ids: { \`${[...(0, linker_1.getAllFunctionCallTargets)(id, info.dataflow.graph)].join('`, `')}\` }.
351
351
  This way we know that the call may refer to the built-in assignment operator or to the multiplication.
352
- Similarly, trying to resolve the name with ${ctx.link(resolve_by_name_1.resolveByName)}\` using the environment attached to the call vertex (filtering for any reference type) returns (in a similar fashion):
353
- { \`${(0, resolve_by_name_1.resolveByNameAnyType)(identifier_1.Identifier.make(name), env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
352
+ Similarly, trying to resolve the name with ${ctx.link(resolve_helper_1.Resolve.byNameAndType)}\` using the environment attached to the call vertex (filtering for any reference type) returns (in a similar fashion):
353
+ { \`${resolve_helper_1.Resolve.byName(identifier_1.Identifier.make(name), env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
354
354
 
355
355
  `;
356
356
  })()}
@@ -489,7 +489,7 @@ ${(0, doc_structure_1.details)('Example: Parameters of a Function', await (async
489
489
  const code = 'f <- function(x, y = 3) x + y';
490
490
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set([10, 1, 3]), exposeResult: true, ctx });
491
491
  const ast = await (0, doc_normalized_ast_1.printNormalizedAstForCode)(parser, code, { prefix: 'flowchart LR\n', showCode: false, ctx });
492
- const functionDefinition = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionDefinition);
492
+ const functionDefinition = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex_2.FunctionDefinitionVertex.is(vertex));
493
493
  (0, assert_1.guard)(functionDefinition !== undefined, () => `Could not find function definition for ${code}`);
494
494
  const [id] = functionDefinition;
495
495
  const normalized = info.normalize.idMap.get(id);
@@ -541,8 +541,8 @@ ${(0, doc_structure_1.block)({
541
541
  A ${linkEdgeName(edge_1.EdgeType.Reads)} edge is not a transitive closure and only links the "directly read" definition(s).
542
542
  Our abstract domains resolving transitive ${linkEdgeName(edge_1.EdgeType.Reads)} edges (and for that matter, following ${linkEdgeName(edge_1.EdgeType.Returns)} as well)
543
543
  are currently tailored to what we need in _flowR_. Hence, we offer a function like ${ctx.link(linker_1.getAllFunctionCallTargets)},
544
- as well as ${ctx.link(resolve_by_name_1.resolvesToBuiltInConstant)} which do this for specific cases.
545
- Refer to ${ctx.link(dfg_get_origin_1.getOriginInDfg)} for a more general solution, as explained in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')}.
544
+ as well as ${ctx.link(resolve_helper_1.Resolve.toBuiltIn)} which do this for specific cases.
545
+ Refer to ${ctx.link(df_helper_1.Dataflow.origin)} for a more general solution, as explained in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')}.
546
546
 
547
547
  ${(0, doc_structure_1.details)('Example: Multi-Level Reads', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 3\ny <- x\nprint(y)', { mark: new Set(['9->7', '7->3', '4->0']), ctx }))}
548
548
 
@@ -598,7 +598,7 @@ However, nested definitions can carry it (in the nested case, \`x\` is defined b
598
598
  name: 'Calls Edge',
599
599
  type: edge_1.EdgeType.Calls,
600
600
  description: `Link the [function call](#function-call-vertex) to the [function definition](#function-definition-vertex) that is called. To find all called definitions,
601
- please use the ${ctx.link(dfg_get_origin_1.getOriginInDfg.name)} function, as explained in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')}.
601
+ please use the ${ctx.link(df_helper_1.Dataflow.origin.name)} function, as explained in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')}.
602
602
  If you are interested in the call graph, refer to ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'callGraph')} and consult the ${ctx.linkPage('wiki/Dataflow Graph', 'call graph wiki', 'perspectives-cg')} for more information.
603
603
  `,
604
604
  code: 'foo <- function() {}\nfoo()',
@@ -1096,10 +1096,10 @@ Generally, we recommend you check out the ${ctx.link(df_helper_1.Dataflow, undef
1096
1096
  * The **${ctx.linkPage('wiki/Query API')}** provides many functions to query the dataflow graph for specific information (dependencies, calls, slices, clusters, ...)
1097
1097
  * The **${ctx.linkPage('wiki/Search API')}** allows you to search for specific vertices or edges in the dataflow graph or the original program
1098
1098
  * ${ctx.link(node_id_1.recoverName)} and ${ctx.link(node_id_1.recoverContent)} to get the name or content of a vertex in the dataflow graph
1099
- * ${ctx.link(alias_tracking_1.resolveIdToValue)} to resolve the value of a variable or id (if possible, see [below](#dfg-resolving-values))
1099
+ * ${ctx.link(resolve_helper_1.Resolve.toValue)} to resolve the value of a variable or id (if possible, see [below](#dfg-resolving-values))
1100
1100
  * ${ctx.link(alias_tracking_1.getAliases)} to get all (potentially currently) aliases of a given definition
1101
1101
  * ${ctx.link(identify_link_to_last_call_relation_1.getValueOfArgument)} to get the (syntactical) value of an argument in a function call
1102
- * ${ctx.link(dfg_get_origin_1.getOriginInDfg)} to get information about where a read, call, ... comes from (see [below](#dfg-resolving-values))
1102
+ * ${ctx.link(df_helper_1.Dataflow.origin)} to get information about where a read, call, ... comes from (see [below](#dfg-resolving-values))
1103
1103
 
1104
1104
  FlowR also provides various helper objects (with the same name as the corresponding type) to help you work with the dataflow graph:
1105
1105
 
@@ -1118,12 +1118,12 @@ ${(0, doc_structure_1.section)('Resolving Values', 3, 'dfg-resolving-values')}
1118
1118
  FlowR supports a ${ctx.linkPage('wiki/Interface', 'configurable', 'configuring-flowr')} level of value tracking&mdash;all with the goal of knowing the static value domain of a variable.
1119
1119
  These capabilities are exposed by the ${(0, doc_query_1.linkToQueryOfName)('resolve-value', 'resolve value Query')} and backed by two important functions:
1120
1120
 
1121
- ${ctx.link(alias_tracking_1.resolveIdToValue)} provides an environment-sensitive (see ${ctx.link('REnvironmentInformation')})
1121
+ ${ctx.link(resolve_helper_1.Resolve.toValue)} provides an environment-sensitive (see ${ctx.link('REnvironmentInformation')})
1122
1122
  value resolution depending on if the environment is provided.
1123
- The idea of ${ctx.link(alias_tracking_1.resolveIdToValue)} is to provide a compromise between precision and performance, to
1123
+ The idea of ${ctx.link(resolve_helper_1.Resolve.toValue)} is to provide a compromise between precision and performance, to
1124
1124
  be used _during_ and _after_ the core analysis. After the dataflow analysis completes, there are much more expensive queries possible (such as the resolution of the data frame shape, see the ${ctx.linkPage('wiki/Query API', 'Query API')}).
1125
1125
 
1126
- Additionally, to ${ctx.link(alias_tracking_1.resolveIdToValue)}, we offer the aforementioned ${ctx.link(identify_link_to_last_call_relation_1.getValueOfArgument)} to retrieve the value of an argument in a function call.
1126
+ Additionally, to ${ctx.link(resolve_helper_1.Resolve.toValue)}, we offer the aforementioned ${ctx.link(identify_link_to_last_call_relation_1.getValueOfArgument)} to retrieve the value of an argument in a function call.
1127
1127
  Be aware, that this function is currently not optimized for speed, so if you frequently require the values of multiple arguments of the same function call, you may want to open [an issue](${doc_issue_1.NewIssueUrl}) to request support for resolving
1128
1128
  multiple arguments at once.
1129
1129
 
@@ -1156,7 +1156,7 @@ ${(0, doc_structure_1.section)('Handling Origins', 3, 'dfg-handling-origins')}
1156
1156
 
1157
1157
  If you are writing another analysis on top of the dataflow graph, you probably want to know all definitions that serve as the source of a read, all functions
1158
1158
  that are called by an invocation, and more.
1159
- For this, the ${ctx.link(dfg_get_origin_1.getOriginInDfg)} (this is also accessible with ${ctx.linkO(df_helper_1.Dataflow, 'origin')}) function provides you with a collection of ${ctx.link('Origin')} objects:
1159
+ For this, the ${ctx.link(df_helper_1.Dataflow.origin)} (this is also accessible with ${ctx.linkO(df_helper_1.Dataflow, 'origin')}) function provides you with a collection of ${ctx.link('Origin')} objects:
1160
1160
 
1161
1161
  ${ctx.hierarchy('Origin', { openTop: true })}
1162
1162
 
@@ -134,6 +134,7 @@ function(x) {
134
134
  rule(knownParser, 'no-leaked-credentials', 'NoLeakedCredentialsConfig', 'NO_LEAKED_CREDENTIALS', 'lint-no-leaked-credentials', 'password <- "s3cr3t"', tagTypes);
135
135
  rule(knownParser, 'undefined-symbol', 'UndefinedSymbolConfig', 'UNDEFINED_SYMBOL', 'lint-undefined-symbol', 'undefined_helper(42)', tagTypes);
136
136
  rule(knownParser, 'syntactically-valid', 'SyntacticallyValidConfig', 'SYNTACTICALLY_VALID', 'lint-syntactically-valid', 'x <- c(1, 2', tagTypes);
137
+ rule(knownParser, 'unclosed-connection', 'UnclosedConnectionConfig', 'UNCLOSED_CONNECTION', 'lint-unclosed-connection', 'con <- file("data.csv")\nreadLines(con)', tagTypes);
137
138
  function rule(parser, name, configType, ruleType, testfile, example, types) {
138
139
  const rule = linter_rules_1.LintingRules[name];
139
140
  const tags = rule.info.tags.toSorted((a, b) => {