@eagleoutice/flowr 2.13.16 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +31 -31
  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 +12 -5
  10. package/benchmark/calibration.js +42 -14
  11. package/benchmark/slicer.d.ts +1 -1
  12. package/benchmark/slicer.js +5 -4
  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/common/options.d.ts +0 -31
  17. package/cli/common/options.js +1 -8
  18. package/cli/common/scripts-info.d.ts +0 -38
  19. package/cli/common/scripts-info.js +0 -8
  20. package/cli/repl/core.js +1 -1
  21. package/cli/repl/parser/slice-query-parser.js +1 -1
  22. package/cli/repl/print-version.js +2 -2
  23. package/config.d.ts +16 -0
  24. package/config.js +79 -0
  25. package/control-flow/extract-cfg.js +1 -1
  26. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  27. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  28. package/control-flow/useless-loop.js +1 -1
  29. package/core/print/slice-diff-ansi.js +1 -1
  30. package/core/steps/pipeline/create-pipeline.js +1 -1
  31. package/dataflow/cluster.js +2 -2
  32. package/dataflow/environments/built-in-props.d.ts +8 -1
  33. package/dataflow/environments/built-in-props.js +18 -0
  34. package/dataflow/environments/built-in.d.ts +7 -1
  35. package/dataflow/environments/built-in.js +42 -3
  36. package/dataflow/environments/default-builtin-config.d.ts +442 -10
  37. package/dataflow/environments/default-builtin-config.js +188 -18
  38. package/dataflow/environments/environment.d.ts +1 -1
  39. package/dataflow/environments/identifier.d.ts +7 -2
  40. package/dataflow/environments/identifier.js +6 -1
  41. package/dataflow/environments/query-fn-props.js +2 -2
  42. package/dataflow/environments/reference-to-maybe.js +5 -5
  43. package/dataflow/environments/resolve-by-name.d.ts +3 -0
  44. package/dataflow/environments/resolve-by-name.js +30 -5
  45. package/dataflow/environments/resolve-helper.d.ts +6 -0
  46. package/dataflow/environments/resolve-helper.js +6 -0
  47. package/dataflow/eval/resolve/alias-tracking.d.ts +5 -0
  48. package/dataflow/eval/resolve/alias-tracking.js +21 -14
  49. package/dataflow/eval/resolve/node-value.d.ts +6 -0
  50. package/dataflow/eval/resolve/node-value.js +15 -9
  51. package/dataflow/eval/resolve/resolve-argument.js +2 -2
  52. package/dataflow/eval/resolve/resolve-numbers.js +2 -2
  53. package/dataflow/eval/resolve/resolve-operators.js +4 -3
  54. package/dataflow/eval/resolve/resolve-strings.js +3 -3
  55. package/dataflow/eval/resolve/resolve-working-directory.js +2 -1
  56. package/dataflow/eval/resolve/resolve.d.ts +5 -5
  57. package/dataflow/eval/resolve/resolve.js +10 -11
  58. package/dataflow/eval/values/general.d.ts +4 -1
  59. package/dataflow/eval/values/general.js +1 -1
  60. package/dataflow/extractor.js +2 -1
  61. package/dataflow/fn/exceptions-of-function.js +5 -4
  62. package/dataflow/fn/higher-order-function.js +5 -4
  63. package/dataflow/graph/call-graph.js +14 -14
  64. package/dataflow/graph/df-helper.d.ts +15 -0
  65. package/dataflow/graph/df-helper.js +10 -4
  66. package/dataflow/graph/diff-dataflow-graph.js +6 -6
  67. package/dataflow/graph/edge.d.ts +27 -0
  68. package/dataflow/graph/edge.js +33 -0
  69. package/dataflow/graph/graph-helper.d.ts +3 -4
  70. package/dataflow/graph/graph-helper.js +4 -5
  71. package/dataflow/graph/graph.d.ts +11 -1
  72. package/dataflow/graph/graph.js +16 -5
  73. package/dataflow/graph/vertex.d.ts +42 -6
  74. package/dataflow/graph/vertex.js +42 -6
  75. package/dataflow/internal/linker.d.ts +1 -0
  76. package/dataflow/internal/linker.js +11 -9
  77. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -2
  78. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
  79. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -5
  80. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +2 -2
  81. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -7
  82. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -6
  83. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -0
  84. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +19 -18
  85. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -1
  86. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  87. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +2 -2
  88. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
  89. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -5
  90. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
  91. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -3
  92. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
  93. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
  94. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
  95. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -3
  96. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +3 -1
  97. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +15 -12
  98. package/dataflow/internal/process/functions/call/common.d.ts +9 -1
  99. package/dataflow/internal/process/functions/call/common.js +17 -6
  100. package/dataflow/internal/process/functions/call/deferred.js +2 -1
  101. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -1
  102. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -3
  103. package/dataflow/internal/process/functions/call/named-call-handling.js +44 -12
  104. package/dataflow/internal/process/functions/call/nse.d.ts +33 -5
  105. package/dataflow/internal/process/functions/call/nse.js +113 -6
  106. package/dataflow/internal/process/functions/call/quoted.d.ts +5 -0
  107. package/dataflow/internal/process/functions/call/quoted.js +21 -9
  108. package/dataflow/origin/dfg-get-origin.d.ts +1 -0
  109. package/dataflow/origin/dfg-get-origin.js +9 -6
  110. package/documentation/data/faq/faqs.js +88 -88
  111. package/documentation/data/faq/recommended-configs.js +1 -1
  112. package/documentation/data/faq/wiki-faq-store.js +1 -1
  113. package/documentation/doc-capabilities.js +1 -1
  114. package/documentation/doc-readme.js +1 -1
  115. package/documentation/doc-util/doc-auto-gen.js +6 -2
  116. package/documentation/doc-util/doc-functions.js +1 -1
  117. package/documentation/wiki-cfg.js +2 -2
  118. package/documentation/wiki-create-linting-rules.js +45 -45
  119. package/documentation/wiki-dataflow-graph.js +17 -18
  120. package/documentation/wiki-linting-and-testing.js +93 -5
  121. package/documentation/wiki-mk/doc-maker.js +1 -1
  122. package/documentation/wiki-overview.js +12 -1
  123. package/documentation/wiki-signature-database.js +3 -0
  124. package/linter/rules/file-path-validity.js +1 -1
  125. package/linter/rules/function-finder-util.js +1 -1
  126. package/linter/rules/naming-convention.js +1 -1
  127. package/linter/rules/no-leaked-credentials.js +2 -1
  128. package/linter/rules/stop-with-call-arg.js +4 -4
  129. package/linter/rules/undefined-symbol-util.d.ts +1 -1
  130. package/linter/rules/undefined-symbol-util.js +5 -4
  131. package/linter/rules/undefined-symbol.js +3 -3
  132. package/linter/rules/unused-definition.js +2 -1
  133. package/package.json +35 -45
  134. package/project/context/flowr-analyzer-environment-context.d.ts +23 -0
  135. package/project/context/flowr-analyzer-environment-context.js +25 -0
  136. package/project/dependency-version-space.js +1 -2
  137. package/project/flowr-analyzer.js +1 -1
  138. package/project/plugins/file-plugins/files/flowr-rda-file.js +3 -3
  139. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
  140. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +3 -1
  141. package/project/sigdb/build.js +16 -16
  142. package/project/sigdb/codec.d.ts +1 -1
  143. package/project/sigdb/codec.js +13 -13
  144. package/project/sigdb/decompress.d.ts +1 -1
  145. package/project/sigdb/decompress.js +33 -33
  146. package/project/sigdb/index-format.js +2 -2
  147. package/project/sigdb/manifest.js +21 -21
  148. package/project/sigdb/memory-source.d.ts +64 -0
  149. package/project/sigdb/memory-source.js +133 -0
  150. package/project/sigdb/reader.js +13 -13
  151. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  152. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -2
  153. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  154. package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
  155. package/queries/catalog/dependencies-query/link-devices.js +2 -2
  156. package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
  157. package/queries/catalog/input-sources-query/simple-input-classifier.js +4 -4
  158. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  159. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
  160. package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -0
  161. package/queries/catalog/signature-query/signature-query-executor.js +3 -2
  162. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +3 -3
  163. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
  164. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
  165. package/r-bridge/retriever.d.ts +2 -1
  166. package/r-bridge/retriever.js +3 -2
  167. package/r-bridge/roxygen2/documentation-provider.d.ts +1 -0
  168. package/r-bridge/roxygen2/documentation-provider.js +1 -0
  169. package/r-bridge/roxygen2/roxygen-parse.d.ts +1 -1
  170. package/r-bridge/roxygen2/roxygen-parse.js +1 -1
  171. package/search/flowr-search-filters.d.ts +1 -1
  172. package/search/flowr-search-filters.js +2 -2
  173. package/search/search-executor/search-enrichers.js +4 -4
  174. package/search/search-executor/search-generators.js +1 -1
  175. package/slicing/criterion/parse.js +3 -3
  176. package/slicing/static/slice-call.d.ts +1 -1
  177. package/slicing/static/slice-call.js +2 -2
  178. package/slicing/static/static-slicer.js +4 -3
  179. package/util/assert.js +1 -1
  180. package/util/log.d.ts +4 -1
  181. package/util/log.js +15 -2
  182. package/util/logic.js +2 -2
  183. package/util/mermaid/cfg.js +1 -1
  184. package/util/mermaid/dfg.js +6 -6
  185. package/util/mermaid/mermaid.js +3 -1
  186. package/util/quads.js +19 -6
  187. package/util/schema.js +2 -2
  188. package/util/text/ansi.d.ts +2 -0
  189. package/util/text/ansi.js +8 -0
  190. package/util/text/name-rank.d.ts +29 -0
  191. package/util/text/name-rank.js +39 -0
  192. package/util/text/url-encoding.d.ts +15 -0
  193. package/util/text/url-encoding.js +59 -0
  194. package/util/version.js +1 -1
  195. package/cli/export-quads-app.d.ts +0 -7
  196. package/cli/export-quads-app.js +0 -44
@@ -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
 
@@ -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
 
@@ -212,7 +211,7 @@ However, in general, flowR may use any fitting handler as an origin (see the ${c
212
211
  ${(0, doc_structure_1.details)('Example: Simple Function Call (unresolved)', await (async () => {
213
212
  const code = 'foo(x,3,y=3,)';
214
213
  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');
214
+ const callInfo = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex_2.FunctionCallVertex.is(vertex) && identifier_1.Identifier.getName(vertex.name) === 'foo');
216
215
  (0, assert_1.guard)(callInfo !== undefined, () => `Could not find call vertex for ${code}`);
217
216
  const [callId, callVert] = callInfo;
218
217
  const inverseMapReferenceTypes = Object.fromEntries(Object.entries(identifier_1.ReferenceType).map(([k, v]) => [v, k]));
@@ -268,7 +267,7 @@ In this case, the call does not have a single ${linkEdgeName(edge_1.EdgeType.Cal
268
267
  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
268
  as any code that is not part of the analysis could cause the semantics to change.
270
269
  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)}.
270
+ If you want to check the resolve targets, refer to ${ctx.link(resolve_helper_1.Resolve.byNameAndType)}.
272
271
  `)}
273
272
 
274
273
  ${(0, doc_structure_1.details)('2) the function only resolves to definitions that are present in the program', `
@@ -279,7 +278,7 @@ ${await (async () => {
279
278
  const code = 'foo <- function() 3\nfoo()';
280
279
  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
280
  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');
281
+ const callVertex = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex_2.FunctionCallVertex.is(vertex) && identifier_1.Identifier.getName(vertex.name) === 'foo');
283
282
  (0, assert_1.guard)(callVertex !== undefined, () => `Could not find call vertex for ${code}`);
284
283
  const [callId] = callVertex;
285
284
  return `
@@ -349,8 +348,8 @@ Great, you should see a definition of \`<-\` which is constraint by the [control
349
348
  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
349
  the following target ids: { \`${[...(0, linker_1.getAllFunctionCallTargets)(id, info.dataflow.graph)].join('`, `')}\` }.
351
350
  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).
351
+ 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):
352
+ { \`${resolve_helper_1.Resolve.byName(identifier_1.Identifier.make(name), env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
354
353
 
355
354
  `;
356
355
  })()}
@@ -489,7 +488,7 @@ ${(0, doc_structure_1.details)('Example: Parameters of a Function', await (async
489
488
  const code = 'f <- function(x, y = 3) x + y';
490
489
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set([10, 1, 3]), exposeResult: true, ctx });
491
490
  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);
491
+ const functionDefinition = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex_2.FunctionDefinitionVertex.is(vertex));
493
492
  (0, assert_1.guard)(functionDefinition !== undefined, () => `Could not find function definition for ${code}`);
494
493
  const [id] = functionDefinition;
495
494
  const normalized = info.normalize.idMap.get(id);
@@ -541,8 +540,8 @@ ${(0, doc_structure_1.block)({
541
540
  A ${linkEdgeName(edge_1.EdgeType.Reads)} edge is not a transitive closure and only links the "directly read" definition(s).
542
541
  Our abstract domains resolving transitive ${linkEdgeName(edge_1.EdgeType.Reads)} edges (and for that matter, following ${linkEdgeName(edge_1.EdgeType.Returns)} as well)
543
542
  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')}.
543
+ as well as ${ctx.link(resolve_helper_1.Resolve.toBuiltIn)} which do this for specific cases.
544
+ 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
545
 
547
546
  ${(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
547
 
@@ -598,7 +597,7 @@ However, nested definitions can carry it (in the nested case, \`x\` is defined b
598
597
  name: 'Calls Edge',
599
598
  type: edge_1.EdgeType.Calls,
600
599
  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')}.
600
+ 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
601
  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
602
  `,
604
603
  code: 'foo <- function() {}\nfoo()',
@@ -1096,10 +1095,10 @@ Generally, we recommend you check out the ${ctx.link(df_helper_1.Dataflow, undef
1096
1095
  * The **${ctx.linkPage('wiki/Query API')}** provides many functions to query the dataflow graph for specific information (dependencies, calls, slices, clusters, ...)
1097
1096
  * The **${ctx.linkPage('wiki/Search API')}** allows you to search for specific vertices or edges in the dataflow graph or the original program
1098
1097
  * ${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))
1098
+ * ${ctx.link(resolve_helper_1.Resolve.toValue)} to resolve the value of a variable or id (if possible, see [below](#dfg-resolving-values))
1100
1099
  * ${ctx.link(alias_tracking_1.getAliases)} to get all (potentially currently) aliases of a given definition
1101
1100
  * ${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))
1101
+ * ${ctx.link(df_helper_1.Dataflow.origin)} to get information about where a read, call, ... comes from (see [below](#dfg-resolving-values))
1103
1102
 
1104
1103
  FlowR also provides various helper objects (with the same name as the corresponding type) to help you work with the dataflow graph:
1105
1104
 
@@ -1118,12 +1117,12 @@ ${(0, doc_structure_1.section)('Resolving Values', 3, 'dfg-resolving-values')}
1118
1117
  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
1118
  These capabilities are exposed by the ${(0, doc_query_1.linkToQueryOfName)('resolve-value', 'resolve value Query')} and backed by two important functions:
1120
1119
 
1121
- ${ctx.link(alias_tracking_1.resolveIdToValue)} provides an environment-sensitive (see ${ctx.link('REnvironmentInformation')})
1120
+ ${ctx.link(resolve_helper_1.Resolve.toValue)} provides an environment-sensitive (see ${ctx.link('REnvironmentInformation')})
1122
1121
  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
1122
+ The idea of ${ctx.link(resolve_helper_1.Resolve.toValue)} is to provide a compromise between precision and performance, to
1124
1123
  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
1124
 
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.
1125
+ 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
1126
  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
1127
  multiple arguments at once.
1129
1128
 
@@ -1156,7 +1155,7 @@ ${(0, doc_structure_1.section)('Handling Origins', 3, 'dfg-handling-origins')}
1156
1155
 
1157
1156
  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
1157
  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:
1158
+ 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
1159
 
1161
1160
  ${ctx.hierarchy('Origin', { openTop: true })}
1162
1161
 
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.WikiLintingAndTesting = void 0;
4
7
  const log_1 = require("../util/log");
@@ -6,7 +9,19 @@ const doc_code_1 = require("./doc-util/doc-code");
6
9
  const doc_files_1 = require("./doc-util/doc-files");
7
10
  const doc_structure_1 = require("./doc-util/doc-structure");
8
11
  const doc_cli_option_1 = require("./doc-util/doc-cli-option");
12
+ const patterns_1 = __importDefault(require("@eagleoutice/eslint-config-flowr/patterns"));
13
+ const edge_1 = require("../dataflow/graph/edge");
14
+ const resolve_helper_1 = require("../dataflow/environments/resolve-helper");
15
+ const node_id_1 = require("../r-bridge/lang-4.x/ast/model/processing/node-id");
9
16
  const doc_maker_1 = require("./wiki-mk/doc-maker");
17
+ /** the default patterns of `flowr/replacement-pattern`, rendered so the wiki cannot drift from the configuration */
18
+ /** two of the default patterns, kept generated so the wiki cannot drift from the configuration */
19
+ function patternExamples() {
20
+ const shown = ['edge-is-only-type', 'vertex-is'];
21
+ const cell = (text) => text.replaceAll('|', '\\|');
22
+ const rows = patterns_1.default.filter(p => p.id !== undefined && shown.includes(p.id)).map(p => `| \`${p.id}\` | ${cell(p.message ?? '')} | \`${cell(p.replace)}\` |`);
23
+ return ['| id | what it says | replacement |', '| :-- | :-- | :-- |', ...rows].join('\n');
24
+ }
10
25
  /**
11
26
  * https://github.com/flowr-analysis/flowr/wiki/Linting-and-Testing
12
27
  */
@@ -33,6 +48,11 @@ for the latest benchmark results, see the ${ctx.linkPage('flowr:benchmarks', 'be
33
48
  - [🪈 CI Pipeline](#ci-pipeline)
34
49
  - [🧹 Linting](#linting)
35
50
  - [Oh no, the linter fails](#oh-no-the-linter-fails)
51
+ - [flowR-Specific Rules](#flowr-specific-rules)
52
+ - [Pointing at a Helper with \`@useInstead\`](#pointing-at-a-helper-with-useinstead)
53
+ - [Replacement Patterns](#replacement-patterns)
54
+ - [Suppressing a Rule](#suppressing-a-rule)
55
+ - [A Part of unicorn](#a-part-of-unicorn)
36
56
  - [License Checker](#license-checker)
37
57
  - [🐛 Debugging](#debugging)
38
58
  - [VS Code](#vs-code-1)
@@ -71,7 +91,7 @@ ${(0, doc_code_1.codeBlock)('shell', 'npm run test -- --no-watch')}
71
91
 
72
92
  To run all tests, including a coverage report and label summary, run:
73
93
 
74
- ${(0, doc_code_1.codeBlock)('shell', 'npm run test-full')}
94
+ ${(0, doc_code_1.codeBlock)('shell', 'npm run test:full')}
75
95
 
76
96
  However, depending on your local version of&nbsp;R, your network connection, and other factors (each test may have a set of criteria),
77
97
  some tests may be skipped automatically as they do not apply to your current system setup (or cannot be tested with the current prerequisites).
@@ -93,8 +113,12 @@ ${(0, doc_structure_1.block)({
93
113
  type: 'WARNING',
94
114
  content: `
95
115
  We name all test files using the \`.test.ts\` suffix and try to run them in parallel.
96
- Whenever this is impossible (e.g., when using ${ctx.link('withShell')}), please use _\`describe.sequential\`_
97
- to disable parallel execution for the respective test (otherwise, such tests are flaky).
116
+ Whenever this is impossible (e.g., when using ${ctx.link('withShell')}), pass \`{ concurrent: false }\` to the
117
+ \`describe\` to disable parallel execution for the respective test (otherwise, such tests are flaky):
118
+
119
+ ${(0, doc_code_1.codeBlock)('typescript', 'describe(\'my suite\', { concurrent: false }, withShell(shell => { /* ... */ }));')}
120
+
121
+ Vitest deprecated the \`describe.sequential\` form in favour of that option, so please do not reintroduce it.
98
122
  `
99
123
  })}
100
124
 
@@ -177,7 +201,7 @@ Although we measure wall time in the CI (which is subject to rather large variat
177
201
  Furthermore, the respective scripts can be used locally as well.
178
202
  To run them, issue:
179
203
 
180
- ${(0, doc_code_1.codeBlock)('shell', 'npm run performance-test')}
204
+ ${(0, doc_code_1.codeBlock)('shell', 'npm run test:performance')}
181
205
 
182
206
  See ${(0, doc_files_1.linkFlowRSourceFile)('test/performance')} for more information on the suites, how to run them, and their results. If you are interested in the results of the benchmarks, see ${ctx.linkPage('flowr:benchmarks', 'here')}.
183
207
 
@@ -248,7 +272,71 @@ it is usually best if you (when necessary) read the respective description and f
248
272
  Rules in this project cover general JavaScript issues [using regular ESLint](https://eslint.org/docs/latest/rules), TypeScript-specific issues [using typescript-eslint](https://typescript-eslint.io/rules/), and code formatting [with ESLint Stylistic](https://eslint.style/packages/default#rules).
249
273
 
250
274
  However, in case you think that the linter is wrong, please do not hesitate to open a [new issue](${doc_files_1.FlowrGithubBaseRef}/flowr/issues/new/choose).
251
-
275
+
276
+ <a id='flowr-specific-rules'></a>
277
+ ### 🧭 flowR-Specific Rules
278
+
279
+ flowR groups its functions in helper objects (${ctx.link(edge_1.DfEdge)}, ${ctx.link(resolve_helper_1.Resolve)}, ${ctx.link(node_id_1.NodeId)}, and
280
+ friends) so that there is one obvious entry point per topic. Two rules of the
281
+ [\`flowr\` plugin](${doc_files_1.FlowrGithubBaseRef}/flowr-lint) keep the code on those entry points, both part of \`npm run lint\`.
282
+ Each is fixed on the spot where the replacement is already imported, and offered as an editor suggestion otherwise.
283
+
284
+ <a id='pointing-at-a-helper-with-useinstead'></a>
285
+ #### Pointing at a Helper with \`@useInstead\`
286
+
287
+ A function that only exists to be wired into a helper object names its replacement, and every reference outside its own
288
+ file is then reported:
289
+
290
+ ${(0, doc_code_1.codeBlock)('ts', `/**
291
+ * Every definition the identifier may refer to.
292
+ * @useInstead {@link Resolve.byName}
293
+ */
294
+ export function resolveByNameAnyType(/* ... */) { /* ... */ }`)}
295
+
296
+ Never reported are the references that make the replacement exist: the wiring in an object literal
297
+ (${ctx.linkO(resolve_helper_1.Resolve, 'byName')} pointing at \`resolveByNameAnyType\`), re-exports, and files declaring the helper itself.
298
+
299
+ <a id='replacement-patterns'></a>
300
+ #### Replacement Patterns
301
+
302
+ Some replacements are a shape of code rather than a renamed function, such as \`edge.types === EdgeType.Reads\`, which
303
+ reads like "has this type" (${ctx.linkO(edge_1.DfEdge, 'includesType')}) but holds only if it is the *only* type
304
+ (${ctx.linkO(edge_1.DfEdge, 'isOnlyType')}). These are matched with [esquery](https://github.com/estools/esquery) selectors,
305
+ the language \`no-restricted-syntax\` uses. Two of the ${patterns_1.default.length} that ship, the rest are in
306
+ [\`patterns.ts\`](${doc_files_1.FlowrGithubBaseRef}/flowr-lint/blob/main/patterns.ts):
307
+
308
+ ${patternExamples()}
309
+
310
+ The [flowr-lint README](${doc_files_1.FlowrGithubBaseRef}/flowr-lint#flowrreplacement-pattern) documents the fields of a pattern,
311
+ and \`npx eslint\` names the id of whichever one fires.
312
+ To propose a new pattern or a change to any of them, open an issue with the replacement pattern template in
313
+ [that repository](${doc_files_1.FlowrGithubBaseRef}/flowr-lint/issues/new/choose).
314
+
315
+ <a id='suppressing-a-rule'></a>
316
+ #### Suppressing a Rule
317
+
318
+ A tag on a declaration covers everything below it, a header comment above the imports covers the whole file.
319
+
320
+ | | silences |
321
+ | :-- | :-- |
322
+ | \`// eslint-disable-next-line\` | the next line, as usual |
323
+ | \`@lintIgnore <ids>\` | the named rules or pattern ids, all of them when given none |
324
+
325
+ Put the reason in the prose above the tag, a hot path that has to keep the raw form is as good a reason as any.
326
+
327
+ <a id='a-part-of-unicorn'></a>
328
+ #### A Part of unicorn
329
+
330
+ The configuration also enables a hand-picked part of [unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn):
331
+ the rules naming a shape with a clearer equivalent (\`prefer-includes\`, \`prefer-string-slice\`, and friends), not its
332
+ opinions on naming or style. Three are left out on purpose:
333
+
334
+ - \`prefer-array-flat\` rewrites \`.flatMap(f => f)\` on an iterator, which has no \`.flat()\`.
335
+ - \`prefer-structured-clone\` does not know that a \`JSON\` round-trip is sometimes the point.
336
+ - \`prefer-node-protocol\` is inverted, \`no-restricted-imports\` forbids the \`node:\` prefix instead: flowR is bundled for
337
+ the browser as well (the web build of the ${ctx.linkPage('flowr:vscode', 'VS Code extension')}), where the core modules
338
+ are swapped for polyfills by their bare name, and a \`node:\` specifier matches none of those bundler keys.
339
+
252
340
  <a id='license-checker'></a>
253
341
  ### 🪪 License Checker
254
342
 
@@ -84,7 +84,7 @@ class DocMaker {
84
84
  async make(args) {
85
85
  this.currentArgs = args;
86
86
  this.writtenSubfiles = new Set();
87
- const newText = normalizeLineEndings((this.printHeader ? (await args.ctx.header(this.filename, this.purpose)) + '\n' : '') + await this.text(args));
87
+ const newText = normalizeLineEndings((this.printHeader ? (await args.ctx.header(this.filename, this.purpose)) + '\n\n' : '') + await this.text(args));
88
88
  if (args.force || this.didUpdate(this.target, newText, args.readFileSync(this.target)?.toString()) === WikiChangeType.Changed) {
89
89
  args.writeFileSync(this.target, newText);
90
90
  return true;
@@ -6,6 +6,8 @@ const doc_files_1 = require("./doc-util/doc-files");
6
6
  const shell_1 = require("../r-bridge/shell");
7
7
  const graph_1 = require("../dataflow/graph/graph");
8
8
  const flowr_analyzer_1 = require("../project/flowr-analyzer");
9
+ const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
10
+ const doc_code_1 = require("./doc-util/doc-code");
9
11
  /**
10
12
  * https://github.com/flowr-analysis/flowr/wiki/Overview
11
13
  */
@@ -39,7 +41,16 @@ Its subcomponents (like the custom ${ctx.link(shell_1.RShell)}) or the internals
39
41
  are not important if you simply wish to use _flowR_.
40
42
  If you wish to use _flowR_, check out one of its extensions (e.g., the ${ctx.linkPage('flowr:vscode', 'VS Code extension')}),
41
43
  the [REPL and server interfaces](#using-flowr-from-the-outside) or its coding API with the
42
- ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)}.
44
+ ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)}, which you build with the ${ctx.link(flowr_analyzer_builder_1.FlowrAnalyzerBuilder)}:
45
+
46
+ ${(0, doc_code_1.codeBlock)('ts', `
47
+ const analyzer = await new FlowrAnalyzerBuilder()
48
+ .setParser(new TreeSitterExecutor())
49
+ .build();
50
+ analyzer.addRequest({ request: 'file', content: 'survey.R' });
51
+ const result = await analyzer.query([{ type: 'dependencies' }]);
52
+ `)}
53
+
43
54
 
44
55
  The benchmark module is only of interest if you want to benchmark/measure the runtime performance and reduction of the slicer.
45
56
  It is available with the [\`benchmark\`](#benchmark-the-slicer) script.
@@ -216,6 +216,9 @@ After \`library(ggplot2)\`, a call to \`ggplot()\` resolves to \`ggplot2::ggplot
216
216
  qualifies bare names and backs various components like the ${ctx.linkPage('wiki/Query API', 'dependencies and call-context queries')}
217
217
  as well as the ${ctx.linkPage('wiki/Linter', 'undefined symbol')} rule.
218
218
 
219
+ You can search what it knows at [flowr-analysis.github.io/flowr/wiki/sigdb](https://flowr-analysis.github.io/flowr/wiki/sigdb/),
220
+ a static page listing every exported name, generated from this database by \`npm run gen:landing\`.
221
+
219
222
  ## What is stored
220
223
 
221
224
  Every function is a ${ctx.link('DecodedFunction')}:
@@ -108,7 +108,7 @@ exports.FILE_PATH_VALIDITY = {
108
108
  // check if any write to the same file happens before the read, and exclude this case if so
109
109
  const writesToFile = results.write.filter(r => samePath(r.value, matchingRead.value, data.flowrConfig.solver.resolveSource?.ignoreCapitalization));
110
110
  const writesBefore = writesToFile.map(w => (0, happens_before_1.happensBefore)(cfg, w.nodeId, element.node.info.id));
111
- if (writesBefore.some(w => w === logic_1.Ternary.Always)) {
111
+ if (writesBefore.includes(logic_1.Ternary.Always)) {
112
112
  metadata.totalWritesBeforeAlways++;
113
113
  return [];
114
114
  }
@@ -87,7 +87,7 @@ exports.functionFinderUtil = {
87
87
  else if (argValues.some(v => requireValue instanceof RegExp ? requireValue.test(v) : v === requireValue)) {
88
88
  return logic_1.Ternary.Always;
89
89
  }
90
- else if (argValues.some(v => v === dependencies_query_format_1.Unknown)) {
90
+ else if (argValues.includes(dependencies_query_format_1.Unknown)) {
91
91
  return logic_1.Ternary.Maybe;
92
92
  }
93
93
  }
@@ -104,7 +104,7 @@ function fixCasing(identifier, convention, ignorePrefix) {
104
104
  if (s.length < 1) {
105
105
  return s.toUpperCase();
106
106
  }
107
- return `${s[0].toUpperCase()}${s.substring(1)}`;
107
+ return `${s[0].toUpperCase()}${s.slice(1)}`;
108
108
  };
109
109
  switch (convention) {
110
110
  case CasingConvention.CamelCase: // camelCase
@@ -8,6 +8,7 @@ const linter_tags_1 = require("../linter-tags");
8
8
  const vertex_1 = require("../../dataflow/graph/vertex");
9
9
  const edge_1 = require("../../dataflow/graph/edge");
10
10
  const r_string_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-string");
11
+ const graph_1 = require("../../dataflow/graph/graph");
11
12
  const defaultCredentialNamePattern = '(?:password|passwd|pwd|secret|api[_.]?key|api[_.]?token|access[_.]?token|auth[_.]?token|bearer[_.]?token|private[_.]?key|credential)';
12
13
  const defaultCredentialValuePattern = '^(?:AKIA|AIPA|ASIA|AROA)[A-Z0-9]{16}' + // AWS access key IDs (exact 20-char format)
13
14
  '|^gh[psoar]_[A-Za-z0-9_]{10,}' + // GitHub Classic/App/OAuth/Actions tokens
@@ -38,7 +39,7 @@ exports.NO_LEAKED_CREDENTIALS = {
38
39
  return [];
39
40
  }
40
41
  const nameMatches = namePattern.test(name);
41
- for (const [targetId, edge] of dfg.outgoingEdges(element.node.info.id) ?? []) {
42
+ for (const [targetId, edge] of dfg.outgoingEdges(element.node.info.id) ?? graph_1.NoEdges) {
42
43
  if (!edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedBy)) {
43
44
  continue;
44
45
  }
@@ -7,10 +7,10 @@ const flowr_search_builder_1 = require("../../search/flowr-search-builder");
7
7
  const linter_tags_1 = require("../linter-tags");
8
8
  const assert_1 = require("../../util/assert");
9
9
  const vertex_1 = require("../../dataflow/graph/vertex");
10
- const alias_tracking_1 = require("../../dataflow/eval/resolve/alias-tracking");
11
- const dfg_get_origin_1 = require("../../dataflow/origin/dfg-get-origin");
12
10
  const linker_1 = require("../../dataflow/internal/linker");
13
11
  const general_1 = require("../../dataflow/eval/values/general");
12
+ const resolve_helper_1 = require("../../dataflow/environments/resolve-helper");
13
+ const df_helper_1 = require("../../dataflow/graph/df-helper");
14
14
  exports.STOP_WITH_CALL_ARG = {
15
15
  createSearch: () => flowr_search_builder_1.Q.var('stop').filter(vertex_1.VertexType.FunctionCall),
16
16
  processSearchResult: async (elements, _config, data) => {
@@ -22,7 +22,7 @@ exports.STOP_WITH_CALL_ARG = {
22
22
  results: elements.getElements()
23
23
  .filter(element => {
24
24
  //only built-in functions
25
- const origins = (0, dfg_get_origin_1.getOriginInDfg)(dataflow.graph, element.node.info.id);
25
+ const origins = df_helper_1.Dataflow.origin(dataflow.graph, element.node.info.id);
26
26
  if ((0, assert_1.isNotUndefined)(origins)) {
27
27
  const builtIn = origins.every(e => e.type === 3 /* OriginType.BuiltInFunctionOrigin */);
28
28
  if (!builtIn) {
@@ -39,7 +39,7 @@ exports.STOP_WITH_CALL_ARG = {
39
39
  const mapping = (0, linker_1.pMatch)(fCall.args, stopParamMap);
40
40
  const mappedToStop = mapping.get('call.') ?? [];
41
41
  for (const argId of mappedToStop) {
42
- const res = (0, alias_tracking_1.resolveIdToValue)(argId, { graph: dataflow.graph, environment: fCall.environment, ctx: data.inspectContext() });
42
+ const res = resolve_helper_1.Resolve.toValue(argId, { graph: dataflow.graph, environment: fCall.environment, ctx: data.inspectContext() });
43
43
  const values = (0, general_1.valueSetGuard)(res);
44
44
  if (values?.type === 'set' && values.elements.length !== 0) {
45
45
  if (values.elements[0].type === 'logical') {
@@ -7,7 +7,7 @@ import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
7
7
  export declare function isInstalledResourceFile(file: string | undefined): boolean;
8
8
  /**
9
9
  * Whether the variable use `id` resolves to a local definition, a parameter, or a built-in (function or
10
- * constant such as `T`, `pi`). Broader than `getOriginInDfg`, which misses built-in constants.
10
+ * constant such as `T`, `pi`). Broader than `Dataflow.origin`, which misses built-in constants.
11
11
  */
12
12
  export declare function useResolvesToDefinitionOrBuiltin(graph: DataflowGraph, id: NodeId): boolean;
13
13
  /**
@@ -11,6 +11,7 @@ const df_helper_1 = require("../../dataflow/graph/df-helper");
11
11
  const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
12
12
  const vertex_1 = require("../../dataflow/graph/vertex");
13
13
  const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
14
+ const graph_1 = require("../../dataflow/graph/graph");
14
15
  /**
15
16
  * Path heuristic for an R package `inst/` resource (installed verbatim, not namespace source). Fallback for
16
17
  * the authoritative `FileRole.Install`, covering requests that bypass the file-role plugins.
@@ -21,10 +22,10 @@ function isInstalledResourceFile(file) {
21
22
  const ResolveEdges = edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedByOnCall;
22
23
  /**
23
24
  * Whether the variable use `id` resolves to a local definition, a parameter, or a built-in (function or
24
- * constant such as `T`, `pi`). Broader than `getOriginInDfg`, which misses built-in constants.
25
+ * constant such as `T`, `pi`). Broader than `Dataflow.origin`, which misses built-in constants.
25
26
  */
26
27
  function useResolvesToDefinitionOrBuiltin(graph, id) {
27
- for (const [target, edge] of graph.outgoingEdges(id) ?? []) {
28
+ for (const [target, edge] of graph.outgoingEdges(id) ?? graph_1.NoEdges) {
28
29
  if (edge_1.DfEdge.doesNotIncludeType(edge, ResolveEdges) || edge_1.DfEdge.includesType(edge, edge_1.EdgeType.NonStandardEvaluation)) {
29
30
  continue;
30
31
  }
@@ -32,7 +33,7 @@ function useResolvesToDefinitionOrBuiltin(graph, id) {
32
33
  return true;
33
34
  }
34
35
  const targetVtx = graph.getVertex(target);
35
- if (targetVtx?.tag === vertex_1.VertexType.VariableDefinition || targetVtx?.tag === vertex_1.VertexType.FunctionDefinition) {
36
+ if (vertex_1.VariableDefinitionVertex.is(targetVtx) || vertex_1.FunctionDefinitionVertex.is(targetVtx)) {
36
37
  return true;
37
38
  }
38
39
  }
@@ -109,7 +110,7 @@ function collectScopeDefinedNames(graph) {
109
110
  return byScope;
110
111
  }
111
112
  for (const [id, vtx] of graph.vertices(true)) {
112
- if (vtx.tag !== vertex_1.VertexType.VariableDefinition) {
113
+ if (!vertex_1.VariableDefinitionVertex.is(vtx)) {
113
114
  continue; // function bindings/params surface as variable definitions of their name symbol
114
115
  }
115
116
  const name = idMap.get(id)?.lexeme;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UNDEFINED_SYMBOL = void 0;
4
4
  const vertex_1 = require("../../dataflow/graph/vertex");
5
5
  const graph_1 = require("../../dataflow/graph/graph");
6
- const dfg_get_origin_1 = require("../../dataflow/origin/dfg-get-origin");
7
6
  const identifier_1 = require("../../dataflow/environments/identifier");
8
7
  const flowr_search_builder_1 = require("../../search/flowr-search-builder");
9
8
  const flowr_search_filters_1 = require("../../search/flowr-search-filters");
@@ -15,6 +14,7 @@ const r_base_packages_1 = require("../../util/r-base-packages");
15
14
  const linter_format_1 = require("../linter-format");
16
15
  const linter_tags_1 = require("../linter-tags");
17
16
  const undefined_symbol_util_1 = require("./undefined-symbol-util");
17
+ const df_helper_1 = require("../../dataflow/graph/df-helper");
18
18
  /** calls that load a package; an unresolved one means we cannot enumerate all exports in scope */
19
19
  const LibraryLoadFunctions = new Set(['library', 'require', 'requireNamespace', 'loadNamespace', 'attachNamespace', 'load_all', 'use', 'p_load']);
20
20
  // standard packages attached by default; exports are in scope without library()
@@ -106,7 +106,7 @@ exports.UNDEFINED_SYMBOL = {
106
106
  return check(element, id, identifier_1.Identifier.getName(vtx.name), identifier_1.Identifier.getNamespace(vtx.name), 'function');
107
107
  }
108
108
  // variable use: only plain symbols (not argument names, `...`, or empty)
109
- if (vtx.tag === vertex_1.VertexType.Use && config.checkVariables) {
109
+ if (vertex_1.UseVertex.is(vtx) && config.checkVariables) {
110
110
  const node = element.node;
111
111
  if (node.type !== type_1.RType.Symbol || node.lexeme === '...' || node.lexeme === undefined) {
112
112
  return undefined;
@@ -123,7 +123,7 @@ exports.UNDEFINED_SYMBOL = {
123
123
  /** shared resolution logic for a name used either as a function call or a variable */
124
124
  function check(element, id, name, namespace, kind) {
125
125
  // resolved by flowR itself (local/param/builtin) - never a candidate, so not counted as suppressed
126
- if (kind === 'variable' ? (0, undefined_symbol_util_1.useResolvesToDefinitionOrBuiltin)(graph, id) : ((0, dfg_get_origin_1.getOriginInDfg)(graph, id)?.length ?? 0) > 0) {
126
+ if (kind === 'variable' ? (0, undefined_symbol_util_1.useResolvesToDefinitionOrBuiltin)(graph, id) : (df_helper_1.Dataflow.origin(graph, id)?.length ?? 0) > 0) {
127
127
  return undefined;
128
128
  }
129
129
  // a bare call to a registered flowR builtin whose dataflow origin was rewritten away from its