@eagleoutice/flowr 2.13.4 → 2.13.5

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 (130) hide show
  1. package/README.md +31 -31
  2. package/cli/repl/core.js +10 -2
  3. package/config.d.ts +4 -1
  4. package/config.js +10 -1
  5. package/control-flow/cfg-dead-code.js +19 -4
  6. package/control-flow/extract-cfg.js +12 -4
  7. package/dataflow/environments/built-in-config.d.ts +6 -3
  8. package/dataflow/environments/built-in-eval-name.d.ts +20 -0
  9. package/dataflow/environments/built-in-eval-name.js +25 -0
  10. package/dataflow/environments/built-in-props.d.ts +175 -0
  11. package/dataflow/environments/built-in-props.js +207 -0
  12. package/dataflow/environments/built-in.d.ts +26 -22
  13. package/dataflow/environments/built-in.js +37 -10
  14. package/dataflow/environments/default-builtin-config.d.ts +1046 -93
  15. package/dataflow/environments/default-builtin-config.js +485 -213
  16. package/dataflow/environments/identifier.d.ts +24 -1
  17. package/dataflow/environments/identifier.js +24 -2
  18. package/dataflow/environments/query-fn-props.d.ts +102 -0
  19. package/dataflow/environments/query-fn-props.js +188 -0
  20. package/dataflow/eval/resolve/alias-tracking.js +4 -1
  21. package/dataflow/eval/resolve/match-arguments.d.ts +15 -0
  22. package/dataflow/eval/resolve/match-arguments.js +77 -0
  23. package/dataflow/eval/resolve/resolve-numbers.d.ts +202 -0
  24. package/dataflow/eval/resolve/resolve-numbers.js +163 -0
  25. package/dataflow/eval/resolve/resolve-operators.d.ts +60 -0
  26. package/dataflow/eval/resolve/resolve-operators.js +115 -0
  27. package/dataflow/eval/resolve/resolve-strings.d.ts +98 -0
  28. package/dataflow/eval/resolve/resolve-strings.js +116 -0
  29. package/dataflow/eval/resolve/resolve.d.ts +5 -37
  30. package/dataflow/eval/resolve/resolve.js +56 -134
  31. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +1 -1
  32. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +5 -4
  33. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
  34. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -1
  35. package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
  36. package/documentation/data/faq/faqs.js +11 -0
  37. package/documentation/doc-util/doc-types.js +1 -1
  38. package/documentation/wiki-analyzer.js +75 -0
  39. package/documentation/wiki-core.js +65 -16
  40. package/documentation/wiki-interface.js +3 -0
  41. package/linter/linter-rules.d.ts +10 -11
  42. package/linter/rules/deprecated-functions.js +5 -3
  43. package/linter/rules/function-finder-util.d.ts +2 -2
  44. package/linter/rules/function-finder-util.js +10 -3
  45. package/linter/rules/network-functions.d.ts +25 -5
  46. package/linter/rules/network-functions.js +51 -11
  47. package/linter/rules/problematic-inputs.d.ts +1 -1
  48. package/linter/rules/problematic-inputs.js +7 -1
  49. package/linter/rules/seeded-randomness.d.ts +5 -8
  50. package/linter/rules/seeded-randomness.js +17 -9
  51. package/package.json +3 -2
  52. package/project/cache/flowr-analyzer-cache.d.ts +4 -3
  53. package/project/cache/flowr-analyzer-cache.js +32 -13
  54. package/project/cache/flowr-cache.d.ts +39 -12
  55. package/project/cache/flowr-cache.js +5 -3
  56. package/project/context/flowr-analyzer-context.d.ts +8 -1
  57. package/project/context/flowr-analyzer-context.js +11 -1
  58. package/project/context/flowr-analyzer-dependencies-context.d.ts +4 -2
  59. package/project/context/flowr-analyzer-dependencies-context.js +15 -1
  60. package/project/context/flowr-analyzer-files-context.d.ts +8 -4
  61. package/project/context/flowr-analyzer-files-context.js +20 -1
  62. package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +33 -0
  63. package/project/context/flowr-analyzer-incremental-analysis-context.js +63 -0
  64. package/project/context/flowr-analyzer-meta-context.d.ts +3 -1
  65. package/project/context/flowr-analyzer-meta-context.js +14 -0
  66. package/project/context/flowr-file.d.ts +25 -3
  67. package/project/context/flowr-file.js +24 -2
  68. package/project/dependency-version-space.d.ts +37 -0
  69. package/project/dependency-version-space.js +118 -26
  70. package/project/flowr-analyzer.d.ts +6 -0
  71. package/project/flowr-analyzer.js +6 -2
  72. package/project/incremental/incremental-parse/edit-computation.d.ts +7 -0
  73. package/project/incremental/incremental-parse/edit-computation.js +61 -0
  74. package/project/incremental/incremental-parse/incremental-parse.d.ts +12 -0
  75. package/project/incremental/incremental-parse/incremental-parse.js +37 -0
  76. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +1 -1
  77. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +57 -0
  78. package/project/plugins/file-plugins/files/flowr-manifest-files.js +121 -0
  79. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -2
  80. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
  81. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +1 -1
  82. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +33 -0
  83. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +53 -0
  84. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +1 -1
  85. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -3
  86. package/project/plugins/package-version-plugins/flowr-analyzer-meta-manifest-file-plugin.d.ts +27 -0
  87. package/project/plugins/package-version-plugins/flowr-analyzer-meta-manifest-file-plugin.js +47 -0
  88. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +7 -0
  89. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +31 -3
  90. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +10 -4
  91. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +17 -4
  92. package/project/plugins/plugin-registry.d.ts +4 -4
  93. package/project/plugins/plugin-registry.js +7 -4
  94. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +4 -4
  95. package/project/sigdb/reader.d.ts +7 -0
  96. package/project/sigdb/reader.js +12 -0
  97. package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +10 -0
  98. package/queries/catalog/dependencies-query/function-info/derived-functions.js +41 -0
  99. package/queries/catalog/dependencies-query/function-info/read-functions.js +13 -12
  100. package/queries/catalog/dependencies-query/function-info/write-functions.js +16 -23
  101. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +33 -3
  102. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +31 -0
  103. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +9 -2
  104. package/queries/catalog/input-sources-query/input-source-functions.d.ts +8 -10
  105. package/queries/catalog/input-sources-query/input-source-functions.js +23 -388
  106. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -0
  107. package/queries/catalog/input-sources-query/input-sources-query-format.js +27 -10
  108. package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -1
  109. package/queries/catalog/signature-query/signature-query-executor.js +79 -3
  110. package/queries/catalog/signature-query/signature-query-format.d.ts +27 -0
  111. package/queries/catalog/signature-query/signature-query-render.js +21 -3
  112. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +6 -2
  113. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +21 -2
  114. package/r-bridge/parser.d.ts +11 -1
  115. package/r-bridge/parser.js +7 -4
  116. package/r-bridge/shell-executor.d.ts +1 -0
  117. package/r-bridge/shell-executor.js +1 -0
  118. package/r-bridge/shell.d.ts +1 -0
  119. package/r-bridge/shell.js +1 -0
  120. package/search/flowr-search-filters.d.ts +1 -6
  121. package/search/flowr-search-filters.js +1 -8
  122. package/search/search-executor/search-enrichers.d.ts +2 -0
  123. package/search/search-executor/search-enrichers.js +29 -12
  124. package/util/version.js +1 -1
  125. package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +0 -31
  126. package/project/plugins/file-plugins/files/flowr-rproject-file.js +0 -66
  127. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +0 -22
  128. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +0 -36
  129. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +0 -13
  130. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +0 -32
@@ -28,7 +28,11 @@ const flowr_analyzer_plugin_1 = require("../project/plugins/flowr-analyzer-plugi
28
28
  const flowr_analyzer_environment_context_1 = require("../project/context/flowr-analyzer-environment-context");
29
29
  const flowr_analyzer_functions_context_1 = require("../project/context/flowr-analyzer-functions-context");
30
30
  const flowr_analyzer_meta_context_1 = require("../project/context/flowr-analyzer-meta-context");
31
+ const flowr_analyzer_incremental_analysis_context_1 = require("../project/context/flowr-analyzer-incremental-analysis-context");
32
+ const flowr_analyzer_gas_context_1 = require("../project/context/flowr-analyzer-gas-context");
33
+ const flowr_analyzer_gas_plugin_1 = require("../project/plugins/gas-plugins/flowr-analyzer-gas-plugin");
31
34
  const config_1 = require("../config");
35
+ const flowr_file_1 = require("../project/context/flowr-file");
32
36
  async function analyzerQuickExample() {
33
37
  const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
34
38
  .setEngine('tree-sitter')
@@ -84,6 +88,8 @@ ${(0, doc_structure_1.collapsibleToc)({
84
88
  'Dependencies Context': undefined,
85
89
  'Environment Context': undefined,
86
90
  'Meta Context': undefined,
91
+ 'Gas Context': undefined,
92
+ 'Incremental Analysis Context': undefined,
87
93
  },
88
94
  'Caching': undefined
89
95
  })}
@@ -441,6 +447,75 @@ ${ctx.linkM(flowr_analyzer_meta_context_1.FlowrAnalyzerMetaContext, 'getProjectV
441
447
  and the project namespace via
442
448
  ${ctx.linkM(flowr_analyzer_meta_context_1.FlowrAnalyzerMetaContext, 'getNamespace', { codeFont: true, realNameWrapper: 'i' })}.
443
449
 
450
+ ${(0, doc_structure_1.section)('Gas Context', 3)}
451
+
452
+ The ${ctx.link(flowr_analyzer_gas_context_1.FlowrAnalyzerGasContext)} (reachable as \`ctx.gas\`) acts as the resource guard of an analysis:
453
+
454
+ ${ctx.hierarchy(flowr_analyzer_gas_context_1.FlowrAnalyzerGasContext, { showImplSnippet: false })}
455
+
456
+ Expensive analysis sites ask for the current resource pressure with
457
+ ${ctx.linkM(flowr_analyzer_gas_context_1.FlowrAnalyzerGasContext, 'checkGas', { codeFont: true, realNameWrapper: 'i' })}, passing the name of the feature they are about to run
458
+ (see ${ctx.link('GasFeatureKey')}), and may then degrade or skip their work.
459
+ The level combines the current heap usage and the time elapsed since the analysis started (or since the last
460
+ ${ctx.linkM(flowr_analyzer_context_1.FlowrAnalyzerContext, 'reset')}, which also resets the gas clock via
461
+ ${ctx.linkM(flowr_analyzer_gas_context_1.FlowrAnalyzerGasContext, 'reset', { codeFont: true, realNameWrapper: 'i' })}),
462
+ each scaled by the per-feature factor from \`config.gas.features\`.
463
+ Registered ${ctx.link(flowr_analyzer_gas_plugin_1.FlowrAnalyzerGasPlugin)}s may escalate the level for any key.
464
+
465
+ ${(0, doc_structure_1.block)({
466
+ type: 'NOTE',
467
+ content: `
468
+ Gas is disabled for every feature by default, and with no gas plugins registered
469
+ ${ctx.linkM(flowr_analyzer_gas_context_1.FlowrAnalyzerGasContext, 'checkGas', { codeFont: true, realNameWrapper: 'i' })} returns \`GasLevel.Normal\` without measuring anything.
470
+ See the ${ctx.linkPage('wiki/Core', 'gas section of the Core wiki page', 'gas-resource-guard')} for the levels, the configuration, and how to write a gas plugin.
471
+ `.trim()
472
+ })}
473
+
474
+ ${(0, doc_structure_1.section)('Incremental Analysis Context', 3)}
475
+
476
+ The ${ctx.link(flowr_analyzer_incremental_analysis_context_1.FlowrAnalyzerIncrementalAnalysisContext)} is a context that stores analysis information needed for making the next analysis run incremental by reusing the previous analysis results:
477
+
478
+ ${ctx.hierarchy(flowr_analyzer_incremental_analysis_context_1.FlowrAnalyzerIncrementalAnalysisContext, { showImplSnippet: false })}
479
+
480
+ This context is not an analysis-result cache by itself.
481
+ Instead, it carries forward the minimal state needed by future incremental phases after an invalidation happened.
482
+ At the moment, it is used for incremental parsing with Tree-sitter, but it is intended to become the shared context for additional incremental analysis stages as well.
483
+
484
+ If the analyzer or context is reset, the incremental information is discarded via
485
+ ${ctx.linkM(flowr_analyzer_incremental_analysis_context_1.FlowrAnalyzerIncrementalAnalysisContext, 'reset', { codeFont: true, realNameWrapper: 'i' })}.
486
+ In other words, this context only transports incremental handoff state between analysis runs.
487
+
488
+ ${(0, doc_structure_1.section)('Incremental Parsing', 4)}
489
+
490
+ This context is used to exploit Tree-sitter's incremental parsing feature.
491
+ For one file, the incremental state follows a fixed lifecycle:
492
+
493
+ 1. After a successful parse-oriented analysis run, the analyzer cache stores the latest Tree-sitter parse tree via
494
+ ${ctx.linkM(flowr_analyzer_incremental_analysis_context_1.FlowrAnalyzerIncrementalAnalysisContext, 'storeOldParseResults', { codeFont: true, realNameWrapper: 'i' })}.
495
+ This tree is the baseline for the next incremental parse of that file.
496
+ 2. When a mutable file provider such as ${ctx.link('FlowrInlineTextFile')} is invalidated via
497
+ ${ctx.linkM(flowr_file_1.FlowrInlineTextFile, 'invalidate', { codeFont: true, realNameWrapper: 'i' })},
498
+ the analyzer receives a file invalidation event and stores the file path together with the old source text.
499
+ If the same file is invalidated again before the next parse, this stored old text is intentionally **not** replaced:
500
+ the stored parse tree still belongs to the version from before the first invalidation, so the incremental parse must keep that matching old-content baseline.
501
+ 3. When parsing is requested again, flowR retrieves
502
+ * the previous parse tree from
503
+ ${ctx.linkM(flowr_analyzer_incremental_analysis_context_1.FlowrAnalyzerIncrementalAnalysisContext, 'getOldParseResultOf', { codeFont: true, realNameWrapper: 'i' })}
504
+ * the stored old source text from
505
+ ${ctx.linkM(flowr_analyzer_incremental_analysis_context_1.FlowrAnalyzerIncrementalAnalysisContext, 'getOldContentOf', { codeFont: true, realNameWrapper: 'i' })}
506
+
507
+ Using these together with the current file content, flowR computes a minimal ${ctx.link('Parser.Edit')} only when a new parse is actually requested.
508
+ If the file content did not change, the previous tree can be reused directly.
509
+ Otherwise, the edit is applied to the previous tree and Tree-sitter reparses incrementally instead of starting from scratch.
510
+ 4. The stored old-content entry is removed when it is used because it belongs only to that previous parse snapshot.
511
+ After the new parse succeeds, the analyzer stores a new parse tree baseline.
512
+ A later invalidation must then be able to record a fresh old-content value that matches this new tree.
513
+ If the old-content entry were kept, later invalidations of the same file would not replace it, and the next incremental parse could compare the current file content against stale old text that no longer matches the stored previous tree.
514
+
515
+ ${(0, doc_structure_1.section)('Incremental Dataflow', 4)}
516
+
517
+ This context is planned to also support future incremental dataflow graph computation.
518
+
444
519
 
445
520
  ${(0, doc_structure_1.section)('Caching', 2)}
446
521
 
@@ -38,6 +38,8 @@ const flowr_analyzer_context_1 = require("../project/context/flowr-analyzer-cont
38
38
  const flowr_analyzer_gas_context_1 = require("../project/context/flowr-analyzer-gas-context");
39
39
  const flowr_analyzer_gas_plugin_1 = require("../project/plugins/gas-plugins/flowr-analyzer-gas-plugin");
40
40
  const gas_1 = require("../gas");
41
+ const built_in_props_1 = require("../dataflow/environments/built-in-props");
42
+ const query_fn_props_1 = require("../dataflow/environments/query-fn-props");
41
43
  const semver_1 = require("semver");
42
44
  const doc_maker_1 = require("./wiki-mk/doc-maker");
43
45
  const process_value_1 = require("../dataflow/internal/process/process-value");
@@ -47,8 +49,6 @@ const doc_cli_option_1 = require("./doc-util/doc-cli-option");
47
49
  const doc_files_1 = require("./doc-util/doc-files");
48
50
  const doc_structure_1 = require("./doc-util/doc-structure");
49
51
  const shell_1 = require("../r-bridge/shell");
50
- const log_1 = require("../../test/functionality/_helper/log");
51
- const log_2 = require("../util/log");
52
52
  const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
53
53
  async function makeAnalyzerExample() {
54
54
  const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
@@ -105,6 +105,60 @@ async function gasPluginExample() {
105
105
  .setEngine('tree-sitter')
106
106
  .build();
107
107
  }
108
+ /** the names of the {@link CallProp} bits that make up a mask, as inline code */
109
+ function propNames(mask) {
110
+ return Object.entries(built_in_props_1.CallProp).filter(([, b]) => typeof b === 'number' && (b & mask) !== 0)
111
+ .map(([n]) => `\`${n}\``).join(', ');
112
+ }
113
+ /**
114
+ * A table per property enum, taken straight from the configuration: what each bit means (its own doc comment),
115
+ * how many built-ins carry it, and which of them the signature database can state on its own.
116
+ */
117
+ function builtInPropsTables(ctx) {
118
+ const index = query_fn_props_1.BuiltInIndex.default();
119
+ /* the doc comment of a bit is its explanation, flattened to fit a table cell; bits nothing carries are left out */
120
+ const table = (type, of) => [
121
+ `| ${type === 'CallProp' ? 'Call property' : 'Argument role'} | Built-ins | Meaning |`,
122
+ '| :-- | --: | :-- |',
123
+ ...Object.entries(type === 'CallProp' ? built_in_props_1.CallProp : built_in_props_1.ArgProp)
124
+ .filter(([, bit]) => typeof bit === 'number' && of(bit) > 0)
125
+ .map(([name, bit]) => {
126
+ /* a `{@link}` has already become an anchor, so dropping the tags leaves the bare name and a stray space */
127
+ const doc = ctx.doc(`${type}::${name}`).replaceAll(/<[^>]*>/g, '').replaceAll(/\s+/g, ' ')
128
+ .replaceAll(/ ([),.;])/g, '$1').replaceAll('|', '\\|').trim();
129
+ const db = type === 'CallProp' && (bit & built_in_props_1.SigDbInferable) !== 0 ? '<sup>db</sup>' : '';
130
+ return `| \`${name}\`${db} | ${of(bit)} | ${doc} |`;
131
+ })
132
+ ].join('\n');
133
+ return `${(0, doc_structure_1.details)('What each call property means', `<sup>db</sup> marks the bits the ${ctx.linkPage('wiki/Signature Database', 'signature database')}
134
+ states for any package function on its own (${ctx.link(query_fn_props_1.inferFnProps.name)} reads them off an entry and carries what a
135
+ function calls over to the function calling it).
136
+
137
+ ${table('CallProp', bit => index.with(bit).length)}
138
+
139
+ Most of these combine freely. The exceptions are ${ctx.link('ExclusiveCallProps')}, which a test checks the whole
140
+ configuration against:
141
+
142
+ ${built_in_props_1.ExclusiveCallProps.map(([bit, forbidden]) => `* \`${built_in_props_1.CallProp[bit]}\` rules out ${propNames(forbidden)}`).join('\n')}
143
+
144
+ Two pairs read like refinements but are not: \`TempFile\` does not imply \`File\` (making up a path touches no file
145
+ system, so a call doing both states both), and \`Reads\`/\`Writes\` say what happens to the resource an
146
+ \`ArgProp.Resource\` argument names, so they only ever appear next to a resource bit.`)}
147
+
148
+ ${(0, doc_structure_1.details)('What each argument role means', `A role is stated per parameter in the ${ctx.link('FnSig')} of a built-in, in the order R declares
149
+ them, with \`...\` covering every position from where it appears. The count is how many built-ins have at least one
150
+ parameter in that role.
151
+
152
+ ${table('ArgProp', bit => new Set(index.params(bit).map(p => p.call)).size)}`)}
153
+
154
+ So \`lapply\` is pure on its own but runs what it is handed, and says which argument that is:
155
+
156
+ ${(0, doc_code_1.codeBlock)('ts', `{ type: 'function', names: Identifier.fromAll(PkgName.Base, ['lapply', 'sapply', 'vapply']),
157
+ processor: BuiltInProcName.Apply,
158
+ config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN', unquoteFunction: true,
159
+ props: CallProp.MayPure, sig: [['X', ArgProp.Value], ['FUN', ArgProp.Callee]] } }`)}
160
+ `;
161
+ }
108
162
  /**
109
163
  * https://github.com/flowr-analysis/flowr/wiki/Core
110
164
  */
@@ -135,7 +189,7 @@ ${await (0, doc_repl_1.documentReplSession)(shell, [{
135
189
  }])}
136
190
 
137
191
  If you are brave (or desperate) enough, you can also try to use the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'verbose')} option to be dumped with information about flowR's internals (please, never use this for benchmarking).
138
- See the [Getting flowR to Talk](#getting-flowr-to-talk) section below for more information.
192
+ See the ${ctx.linkPage('wiki/FAQ', 'FAQ')} (*How to get flowR to talk?*) for more information.
139
193
  `
140
194
  })}
141
195
 
@@ -149,7 +203,6 @@ See the [Getting flowR to Talk](#getting-flowr-to-talk) section below for more i
149
203
  * [Beyond the Dataflow Graph](#beyond-the-dataflow-graph)
150
204
  * [Static Backward Slicing](#static-backward-slicing)
151
205
  * [Gas (Resource Guard)](#gas-resource-guard)
152
- * [Getting flowR to Talk](#getting-flowr-to-talk)
153
206
 
154
207
  ## Creating and Using a flowR Analyzer Instance
155
208
 
@@ -426,9 +479,16 @@ But where are all the interesting things handled then?
426
479
  For that, we want to have a look at the built-in environment, which can be freely configured using flowR's ${ctx.linkPage('wiki/Interface', 'configuration system', 'configuring-flowr')}.
427
480
  FlowR's heart and soul resides in the ${ctx.link('DefaultBuiltinConfig')} object, which is used to configure the built-in environment
428
481
  by mapping function names to ${ctx.link('BuiltInProcessorMapper')} functions.
429
- There you can find functions like ${ctx.link(built_in_access_1.processAccess)} which handles the (subset) access to a variable,
482
+ There you can find functions like ${ctx.link(built_in_access_1.processAccess)} which handles the (subset) access to a variable,
430
483
  or ${ctx.link(built_in_for_loop_1.processForLoop)} which handles the primitive for loop construct (whenever it is not overwritten).
431
484
 
485
+ Besides the processor, an entry states what the function does with ${ctx.link('BuiltInFnInfo')}: its ${ctx.link('CallProp')} bits
486
+ say what the call as a whole does, its ${ctx.link('FnSig')} says what each argument is used for (in the order R declares them,
487
+ with \`...\` covering every position from where it appears). Anything you add there is picked up by ${ctx.link(query_fn_props_1.BuiltInIndex.name)},
488
+ which is how the ${ctx.linkPage('wiki/Query API', 'input-sources query')} learns which functions bring in data of their own.
489
+
490
+ ${builtInPropsTables(ctx)}
491
+
432
492
  Just as an example, we want to have a look at the ${ctx.link(built_in_repeat_loop_1.processRepeatLoop)} function, as it is one of the simplest built-in processors
433
493
  we have:
434
494
 
@@ -533,17 +593,6 @@ ${ctx.doc(flowr_analyzer_gas_plugin_1.FlowrAnalyzerGasPlugin)}
533
593
 
534
594
  ${ctx.code(gasPluginExample, { dropLinesStart: 1, dropLinesEnd: 1, hideDefinedAt: true })}
535
595
 
536
- ## Helpful Things
537
-
538
- ### Getting flowR to Talk
539
-
540
- 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.
541
- 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).
542
- 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')}.
543
- 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.
544
- If you are an implementor and want to add logging, please make sure there are no larger runtime impliciations when logging is disabled.
545
- 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.
546
-
547
596
  `;
548
597
  }
549
598
  }
@@ -301,6 +301,9 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
301
301
  }
302
302
  }
303
303
  },
304
+ incrementalParsing: {
305
+ activated: false,
306
+ },
304
307
  gas: {
305
308
  thresholds: {
306
309
  memory: { problematic: 0.7, critical: 0.9 },
@@ -60,14 +60,11 @@ export declare const LintingRules: {
60
60
  }>;
61
61
  readonly info: {
62
62
  readonly defaultConfig: {
63
- readonly randomnessProducers: readonly [{
64
- readonly type: "function";
65
- readonly name: "set.seed";
66
- }, {
67
- readonly type: "assignment";
68
- readonly name: ".Random.seed";
69
- }];
70
- readonly randomnessConsumers: readonly ["jitter", "sample", "sample.int", "arima.sim", "kmeans", "princomp", "rcauchy", "rchisq", "rexp", "rgamma", "rgeom", "rlnorm", "rlogis", "rmultinom", "rnbinom", "rnorm", "rpois", "runif", "pointLabel", "some", "rbernoulli", "rdunif", "generateSeedVectors", "rbeta", "rf", "rhyper", "rweibull", "rt", "rvonmises", "rwilcox", "rxor", "rhyper", "rmvnorm", "rsignrank", "randomForest", "permuted", "permute", "shuffle", "shuffleSet", "data_shuffle", "sample_frac", "sample_n", "slice_sample"];
63
+ readonly randomnessProducers: {
64
+ type: "function" | "assignment";
65
+ name: string;
66
+ }[];
67
+ readonly randomnessConsumers: readonly [...import("../dataflow/environments/identifier").BrandedIdentifier[], "princomp", "pointLabel", "some", "rbernoulli", "rdunif", "generateSeedVectors", "rvonmises", "rxor", "rmvnorm", "randomForest", "permuted", "permute", "shuffle", "shuffleSet", "data_shuffle", "sample_frac", "sample_n"];
71
68
  };
72
69
  readonly tags: readonly [import("./linter-tags").LintingRuleTag.Robustness, import("./linter-tags").LintingRuleTag.Reproducibility];
73
70
  readonly certainty: import("./linter-format").LintingRuleCertainty.BestEffort;
@@ -168,8 +165,10 @@ export declare const LintingRules: {
168
165
  readonly certainty: import("./linter-format").LintingRuleCertainty.BestEffort;
169
166
  readonly description: "Marks network functions that execute network operations, such as downloading files or making HTTP requests.";
170
167
  readonly defaultConfig: {
171
- readonly fns: readonly ["read.table", "read.csv", "read.csv2", "read.delim", "read.delim2", "readRDS", "download.file", "url", "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "content", "handle", "get_callback", "VERB", "fread", "gzcon", "readlines", "readLines", "source", "load", "curl_download", "curl_fetch_memory", "getURL", "getForm", "read_html", "read_xml", "html_nodes", "html_text", "fromJSON", "read.xlsx", "drive_download", "drive_get", "s3read_using", "s3write_using", "storage_download", "AnnotationHub", "ExperimentHub", "scan", "socketConnection", "request", "curl"];
172
- readonly onlyTriggerWithArgument: RegExp;
168
+ readonly fns: {
169
+ name: import("../dataflow/environments/identifier").Identifier;
170
+ onlyTriggerWithArgument: RegExp;
171
+ }[];
173
172
  };
174
173
  };
175
174
  };
@@ -252,7 +251,7 @@ export declare const LintingRules: {
252
251
  readonly tags: readonly [import("./linter-tags").LintingRuleTag.Security, import("./linter-tags").LintingRuleTag.Smell, import("./linter-tags").LintingRuleTag.Readability, import("./linter-tags").LintingRuleTag.Performance];
253
252
  readonly certainty: import("./linter-format").LintingRuleCertainty.BestEffort;
254
253
  readonly defaultConfig: {
255
- readonly consider: readonly ["^eval$", "^system$", "^system2$", "^shell$"];
254
+ readonly consider: readonly string[];
256
255
  readonly pipeCommandFunctions: readonly import("./rules/problematic-inputs").PipeCommandFunctionSpec[];
257
256
  };
258
257
  };
@@ -6,7 +6,6 @@ const df_helper_1 = require("../../dataflow/graph/df-helper");
6
6
  const identifier_1 = require("../../dataflow/environments/identifier");
7
7
  const flowr_search_builder_1 = require("../../search/flowr-search-builder");
8
8
  const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
9
- const flowr_search_filters_1 = require("../../search/flowr-search-filters");
10
9
  const range_1 = require("../../util/range");
11
10
  const linter_format_1 = require("../linter-format");
12
11
  const linter_tags_1 = require("../linter-tags");
@@ -14,9 +13,12 @@ const function_finder_util_1 = require("./function-finder-util");
14
13
  exports.DEPRECATED_FUNCTIONS = {
15
14
  // unlike functionFinderUtil.createSearch(config.fns), this does not pre-filter to the hardcoded list: the
16
15
  // sigdb-driven pass below needs every resolved call, so the `fns` filtering happens in processSearchResult instead
17
- createSearch: (_config) => flowr_search_builder_1.Q.all().filter(vertex_1.VertexType.FunctionCall).with(search_enrichers_1.Enrichment.CallTargets, { onlyBuiltin: true }),
16
+ createSearch: (_config) => flowr_search_builder_1.Q.all().filter(vertex_1.VertexType.FunctionCall).with(search_enrichers_1.Enrichment.CallTargets, {
17
+ onlyBuiltin: true,
18
+ qualifyNames: false // we don't use qualified names for this rule yet
19
+ }),
18
20
  processSearchResult: async (elements, config, data) => {
19
- const matchesConfiguredFns = (0, flowr_search_filters_1.testFunctionsIgnoringPackage)(config.fns);
21
+ const matchesConfiguredFns = identifier_1.Identifier.regex(...config.fns);
20
22
  const hardcoded = await function_finder_util_1.functionFinderUtil.processSearchResult(elements, config, data, es => es.filter(e => (0, search_enrichers_1.enrichmentContent)(e, search_enrichers_1.Enrichment.CallTargets)?.targets
21
23
  .some(t => typeof t === 'string' && matchesConfiguredFns.test(t))));
22
24
  const deps = data.inspectContext().deps;
@@ -3,7 +3,7 @@ import type { FlowrSearchElement, FlowrSearchElements } from '../../search/flowr
3
3
  import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
4
4
  import type { MergeableRecord } from '../../util/objects';
5
5
  import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info';
6
- import type { Identifier } from '../../dataflow/environments/identifier';
6
+ import { Identifier } from '../../dataflow/environments/identifier';
7
7
  import { Ternary } from '../../util/logic';
8
8
  import type { ReadonlyFlowrAnalysisProvider } from '../../project/flowr-analyzer';
9
9
  import type { AsyncOrSync } from 'ts-essentials';
@@ -24,7 +24,7 @@ export interface FunctionsToDetectConfig extends MergeableRecord {
24
24
  * This helper object collects utility functions used to create linting rules that search for specific functions.
25
25
  */
26
26
  export declare const functionFinderUtil: {
27
- createSearch: (functions: readonly string[]) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter", "with", "filter"], ParentInformation, Promise<FlowrSearchElements<ParentInformation, [] | FlowrSearchElement<ParentInformation>[]>>>;
27
+ createSearch: (functions: readonly Identifier[]) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter", "with", "filter"], ParentInformation, Promise<FlowrSearchElements<ParentInformation, [] | FlowrSearchElement<ParentInformation>[]>>>;
28
28
  processSearchResult<T extends FlowrSearchElement<ParentInformation>[]>(this: void, elements: FlowrSearchElements<ParentInformation, T>, _config: unknown, _data: unknown, refineSearch?: (elements: T) => AsyncOrSync<(T[number] & {
29
29
  certainty?: LintingResultCertainty;
30
30
  })[]>): Promise<{
@@ -10,7 +10,9 @@ const assert_1 = require("../../util/assert");
10
10
  const resolve_argument_1 = require("../../dataflow/eval/resolve/resolve-argument");
11
11
  const vertex_1 = require("../../dataflow/graph/vertex");
12
12
  const dependencies_query_format_1 = require("../../queries/catalog/dependencies-query/dependencies-query-format");
13
+ const identifier_1 = require("../../dataflow/environments/identifier");
13
14
  const logic_1 = require("../../util/logic");
15
+ const df_helper_1 = require("../../dataflow/graph/df-helper");
14
16
  /**
15
17
  * This helper object collects utility functions used to create linting rules that search for specific functions.
16
18
  */
@@ -23,7 +25,7 @@ exports.functionFinderUtil = {
23
25
  args: {
24
26
  enrichment: search_enrichers_1.Enrichment.CallTargets,
25
27
  test: {
26
- targets: (0, flowr_search_filters_1.testFunctionsIgnoringPackage)(functions)
28
+ targets: identifier_1.Identifier.regex(...functions)
27
29
  }
28
30
  }
29
31
  }));
@@ -63,12 +65,17 @@ exports.functionFinderUtil = {
63
65
  };
64
66
  },
65
67
  async requireArgumentValue(element, pool, analyzer, requireValue) {
66
- const info = pool.get(element.node.lexeme ?? '');
68
+ const dataflow = await analyzer.dataflow();
69
+ const identifier = df_helper_1.Dataflow.qualify(element.node.info.id, dataflow.graph, true) ?? (element.node.lexeme !== undefined ? identifier_1.Identifier.parse(element.node.lexeme) : undefined);
67
70
  /* if we have no additional info, we assume they always access the network */
71
+ if (identifier === undefined) {
72
+ return logic_1.Ternary.Always;
73
+ }
74
+ // we allow our function pool to contain non-namespaced functions
75
+ const info = pool.get(identifier_1.Identifier.toString(identifier)) ?? pool.get(identifier_1.Identifier.getName(identifier));
68
76
  if (info === undefined) {
69
77
  return logic_1.Ternary.Always;
70
78
  }
71
- const dataflow = await analyzer.dataflow();
72
79
  const vert = dataflow.graph.getVertex(element.node.info.id);
73
80
  if (vertex_1.FunctionCallVertex.is(vert)) {
74
81
  const args = (0, resolve_argument_1.getArgumentStringValue)(analyzer.flowrConfig.solver.variables, dataflow.graph, vert, info.argIdx, info.argName, info.resolveValue, analyzer.inspectContext());
@@ -4,10 +4,28 @@ import { LintingRuleTag } from '../linter-tags';
4
4
  import type { MergeableRecord } from '../../util/objects';
5
5
  import type { FlowrSearchElement } from '../../search/flowr-search';
6
6
  import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
7
+ import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info';
8
+ import { Identifier } from '../../dataflow/environments/identifier';
7
9
  export interface NetworkFunctionsConfig extends MergeableRecord {
8
- /** The list of function names that should be marked in the given context if their arguments match. */
9
- fns: readonly string[];
10
- /** only trigger if the function's read argument is linked to a value that matches this pattern */
10
+ /**
11
+ * The list of function names or more detailed {@link NetworkFunction} information that should be marked in the given context if their arguments match.
12
+ */
13
+ fns: readonly (Identifier | NetworkFunction)[];
14
+ }
15
+ export interface NetworkFunction extends MergeableRecord {
16
+ /**
17
+ * The name of the network function to find.
18
+ */
19
+ name: Identifier;
20
+ /**
21
+ * The {@link FunctionInfo} to use for querying the argument whose value should match {@link onlyTriggerWithArgument}.
22
+ * If this is not specified, flowR's default database of functions ({@link ReadFunctions}, {@link SourceFunctions} and {@link WriteFunctions}) is queried for appropriate information on the function's read argument.
23
+ */
24
+ info?: Omit<FunctionInfo, 'name'>;
25
+ /**
26
+ * Only trigger if the function's read argument is linked to a value that matches this pattern through {@link info}.
27
+ * If this is unset, the read argument is not queried for whether its value matches a pattern.
28
+ */
11
29
  onlyTriggerWithArgument?: RegExp | string;
12
30
  }
13
31
  export declare const NETWORK_FUNCTIONS: {
@@ -26,8 +44,10 @@ export declare const NETWORK_FUNCTIONS: {
26
44
  readonly certainty: LintingRuleCertainty.BestEffort;
27
45
  readonly description: "Marks network functions that execute network operations, such as downloading files or making HTTP requests.";
28
46
  readonly defaultConfig: {
29
- readonly fns: readonly ["read.table", "read.csv", "read.csv2", "read.delim", "read.delim2", "readRDS", "download.file", "url", "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "content", "handle", "get_callback", "VERB", "fread", "gzcon", "readlines", "readLines", "source", "load", "curl_download", "curl_fetch_memory", "getURL", "getForm", "read_html", "read_xml", "html_nodes", "html_text", "fromJSON", "read.xlsx", "drive_download", "drive_get", "s3read_using", "s3write_using", "storage_download", "AnnotationHub", "ExperimentHub", "scan", "socketConnection", "request", "curl"];
30
- readonly onlyTriggerWithArgument: RegExp;
47
+ readonly fns: {
48
+ name: Identifier;
49
+ onlyTriggerWithArgument: RegExp;
50
+ }[];
31
51
  };
32
52
  };
33
53
  };
@@ -8,14 +8,28 @@ const read_functions_1 = require("../../queries/catalog/dependencies-query/funct
8
8
  const logic_1 = require("../../util/logic");
9
9
  const source_functions_1 = require("../../queries/catalog/dependencies-query/function-info/source-functions");
10
10
  const write_functions_1 = require("../../queries/catalog/dependencies-query/function-info/write-functions");
11
- const FnPool = new Map(read_functions_1.ReadFunctions.concat(source_functions_1.SourceFunctions, write_functions_1.WriteFunctions).map(f => [f.name, f]));
11
+ const identifier_1 = require("../../dataflow/environments/identifier");
12
+ const df_helper_1 = require("../../dataflow/graph/df-helper");
13
+ const DefaultFunctionPool = new Map(read_functions_1.ReadFunctions.concat(source_functions_1.SourceFunctions, write_functions_1.WriteFunctions).map(f => [identifier_1.Identifier.toString(identifier_1.Identifier.make(f.name, f.package)), f]));
12
14
  exports.NETWORK_FUNCTIONS = {
13
- createSearch: (config) => function_finder_util_1.functionFinderUtil.createSearch(config.fns),
14
- processSearchResult: (e, c, d) => {
15
+ createSearch: (config) => function_finder_util_1.functionFinderUtil.createSearch(config.fns.map(f => identifier_1.Identifier.is(f) ? f : f.name)),
16
+ processSearchResult: async (e, c, d) => {
17
+ const df = await d.dataflow();
18
+ const fnPool = new Map([
19
+ ...DefaultFunctionPool,
20
+ ...c.fns.flatMap(f => identifier_1.Identifier.is(f) ? [] : f.info === undefined ? [] : [[identifier_1.Identifier.toString(f.name), { name: identifier_1.Identifier.toString(f.name), ...f.info }]])
21
+ ]);
22
+ const onlyTriggerLookup = new Map(c.fns.flatMap(f => identifier_1.Identifier.is(f) ? [] : [[identifier_1.Identifier.toString(f.name), f.onlyTriggerWithArgument]]));
15
23
  return function_finder_util_1.functionFinderUtil.processSearchResult(e, c, d, async (es) => {
16
24
  const res = [];
17
25
  for (const e of es) {
18
- const val = await function_finder_util_1.functionFinderUtil.requireArgumentValue(e, FnPool, d, c.onlyTriggerWithArgument);
26
+ const identifier = df_helper_1.Dataflow.qualify(e.node.info.id, df.graph, true) ?? (e.node.lexeme !== undefined ? identifier_1.Identifier.parse(e.node.lexeme) : undefined);
27
+ if (identifier === undefined) {
28
+ continue;
29
+ }
30
+ // we allow onlyTriggerLookup to contain non-namespaced functions
31
+ const requireValue = onlyTriggerLookup.get(identifier_1.Identifier.toString(identifier)) ?? onlyTriggerLookup.get(identifier_1.Identifier.getName(identifier));
32
+ const val = await function_finder_util_1.functionFinderUtil.requireArgumentValue(e, fnPool, d, requireValue);
19
33
  if (val === logic_1.Ternary.Never) {
20
34
  continue;
21
35
  }
@@ -35,13 +49,39 @@ exports.NETWORK_FUNCTIONS = {
35
49
  description: 'Marks network functions that execute network operations, such as downloading files or making HTTP requests.',
36
50
  defaultConfig: {
37
51
  fns: [
38
- 'read.table', 'read.csv', 'read.csv2', 'read.delim', 'read.delim2', 'readRDS', 'download.file', 'url', 'GET', 'POST', 'PUT',
39
- 'DELETE', 'PATCH', 'HEAD', 'content', 'handle', 'get_callback', 'VERB', 'fread', 'gzcon', 'readlines', 'readLines', 'source', 'load', 'curl_download',
40
- 'curl_fetch_memory', 'getURL', 'getForm', 'read_html', 'read_xml', 'html_nodes', 'html_text', 'fromJSON', 'read.xlsx', 'drive_download', 'drive_get',
41
- 's3read_using', 's3write_using', 'storage_download', 'AnnotationHub', 'ExperimentHub', 'scan',
42
- 'socketConnection', 'request', 'curl'
43
- ],
44
- onlyTriggerWithArgument: /^(https?|ftps?):\/\//
52
+ // subset of default network functions provided by manually reviewed results from analysis based on the signature database, see the dirty-network-funcs-test branch there
53
+ ...['oauth_endpoint', 'DELETE', 'PATCH', 'HEAD', 'GET', 'POST', 'PUT', 'BROWSE', 'RETRY', 'VERB', 'content', 'handle', 'get_callback', 'VERB'].map(f => identifier_1.Identifier.make(f, 'httr')),
54
+ ...['read.table', 'read.csv', 'read.csv2', 'read.delim', 'read.delim2', 'download.file'].map(f => identifier_1.Identifier.make(f, 'utils')),
55
+ ...['socketConnection', 'readRDS', 'url', 'gzcon', 'readlines', 'readLines', 'source', 'load', 'scan'].map(f => identifier_1.Identifier.make(f, 'base')),
56
+ ...['nslookup', 'new_handle', 'multi_download', 'curl', 'curl_upload', 'curl_echo', 'curl_download', 'curl_fetch_memory'].map(f => identifier_1.Identifier.make(f, 'curl')),
57
+ ...['read_html', 'read_xml'].map(f => identifier_1.Identifier.make(f, 'xml2')),
58
+ ...['download_html', 'html_nodes', 'html_text'].map(f => identifier_1.Identifier.make(f, 'rvest')),
59
+ ...['shared_drive_get', 'shared_drive_rm', 'drive_download', 'drive_get'].map(f => identifier_1.Identifier.make(f, 'googledrive')),
60
+ ...['s3read_using', 's3write_using'].map(f => identifier_1.Identifier.make(f, 'aws.s3')),
61
+ ...['url_filename', 'url_accessible', 'url_destination'].map(f => identifier_1.Identifier.make(f, 'xfun')),
62
+ ...['source_url', 'source_gist'].map(f => identifier_1.Identifier.make(f, 'devtools')),
63
+ ...['install_bioc', 'install_bitbucket', 'install_cran', 'install_dev', 'install_git', 'install_github', 'install_gitlab', 'install_svn', 'install_url', 'install_version'].flatMap(f => [identifier_1.Identifier.make(f, 'devtools'), identifier_1.Identifier.make(f, 'remotes')]),
64
+ ...['github_pull', 'update_packages'].map(f => identifier_1.Identifier.make(f, 'remotes')),
65
+ ...['viewer', 'getDelegatedAzureToken'].map(f => identifier_1.Identifier.make(f, 'rstudioapi')),
66
+ ...['runGist', 'runUrl', 'httpResponse', 'session'].map(f => identifier_1.Identifier.make(f, 'shiny')),
67
+ ...['create_from_github', 'use_git_remote', 'use_github_action', 'use_github_file', 'use_tidy_thanks'].map(f => identifier_1.Identifier.make(f, 'usethis')),
68
+ identifier_1.Identifier.make('copy_to', 'dplyr'),
69
+ identifier_1.Identifier.make('getURL', 'RCurl'),
70
+ identifier_1.Identifier.make('fread', 'data.table'),
71
+ identifier_1.Identifier.make('getForm', 'rBDAT'),
72
+ identifier_1.Identifier.make('fromJSON', 'jsonlite'),
73
+ identifier_1.Identifier.make('read.xlsx', 'openxlsx'),
74
+ identifier_1.Identifier.make('storage_download', 'googleCloudStorageR'),
75
+ identifier_1.Identifier.make('AnnotationHub', 'AnnotationHub'),
76
+ identifier_1.Identifier.make('ExperimentHub', 'ExperimentHub'),
77
+ identifier_1.Identifier.make('datasource', 'readr'),
78
+ identifier_1.Identifier.make('melt_csv', 'meltr'),
79
+ identifier_1.Identifier.make('addServer', 'rsconnect'),
80
+ identifier_1.Identifier.make('vroom', 'vroom'),
81
+ ].map(f => ({
82
+ name: f,
83
+ onlyTriggerWithArgument: /^(https?|ftps?):\/\//
84
+ }))
45
85
  }
46
86
  }
47
87
  };
@@ -32,7 +32,7 @@ export declare const PROBLEMATIC_INPUTS: {
32
32
  readonly tags: readonly [LintingRuleTag.Security, LintingRuleTag.Smell, LintingRuleTag.Readability, LintingRuleTag.Performance];
33
33
  readonly certainty: LintingRuleCertainty.BestEffort;
34
34
  readonly defaultConfig: {
35
- readonly consider: readonly ["^eval$", "^system$", "^system2$", "^shell$"];
35
+ readonly consider: readonly string[];
36
36
  readonly pipeCommandFunctions: readonly PipeCommandFunctionSpec[];
37
37
  };
38
38
  };
@@ -8,7 +8,13 @@ const linter_tags_1 = require("../linter-tags");
8
8
  const simple_input_classifier_1 = require("../../queries/catalog/input-sources-query/simple-input-classifier");
9
9
  const parse_1 = require("../../slicing/criterion/parse");
10
10
  const graph_1 = require("../../dataflow/graph/graph");
11
- const defaultConsider = ['^eval$', '^system$', '^system2$', '^shell$'];
11
+ const built_in_props_1 = require("../../dataflow/environments/built-in-props");
12
+ const query_fn_props_1 = require("../../dataflow/environments/query-fn-props");
13
+ const identifier_1 = require("../../dataflow/environments/identifier");
14
+ const defaultConsider = [
15
+ '^eval$',
16
+ ...query_fn_props_1.BuiltInIndex.default().with(built_in_props_1.CallProp.Process).map(n => `^${identifier_1.Identifier.getName(n)}$`)
17
+ ];
12
18
  const defaultPipeCommandFunctions = [
13
19
  { pattern: '^pdf$', argIdx: 0, argName: 'file' },
14
20
  { pattern: '^postscript$', argIdx: 0, argName: 'file' }
@@ -40,14 +40,11 @@ export declare const SEEDED_RANDOMNESS: {
40
40
  }>;
41
41
  readonly info: {
42
42
  readonly defaultConfig: {
43
- readonly randomnessProducers: readonly [{
44
- readonly type: "function";
45
- readonly name: "set.seed";
46
- }, {
47
- readonly type: "assignment";
48
- readonly name: ".Random.seed";
49
- }];
50
- readonly randomnessConsumers: readonly ["jitter", "sample", "sample.int", "arima.sim", "kmeans", "princomp", "rcauchy", "rchisq", "rexp", "rgamma", "rgeom", "rlnorm", "rlogis", "rmultinom", "rnbinom", "rnorm", "rpois", "runif", "pointLabel", "some", "rbernoulli", "rdunif", "generateSeedVectors", "rbeta", "rf", "rhyper", "rweibull", "rt", "rvonmises", "rwilcox", "rxor", "rhyper", "rmvnorm", "rsignrank", "randomForest", "permuted", "permute", "shuffle", "shuffleSet", "data_shuffle", "sample_frac", "sample_n", "slice_sample"];
43
+ readonly randomnessProducers: {
44
+ type: "function" | "assignment";
45
+ name: string;
46
+ }[];
47
+ readonly randomnessConsumers: readonly [...BrandedIdentifier[], "princomp", "pointLabel", "some", "rbernoulli", "rdunif", "generateSeedVectors", "rvonmises", "rxor", "rmvnorm", "randomForest", "permuted", "permute", "shuffle", "shuffleSet", "data_shuffle", "sample_frac", "sample_n"];
51
48
  };
52
49
  readonly tags: readonly [LintingRuleTag.Robustness, LintingRuleTag.Reproducibility];
53
50
  readonly certainty: LintingRuleCertainty.BestEffort;
@@ -20,15 +20,24 @@ const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-fun
20
20
  const r_value_1 = require("../../dataflow/eval/values/r-value");
21
21
  const info_1 = require("../../dataflow/info");
22
22
  const built_in_proc_name_1 = require("../../dataflow/environments/built-in-proc-name");
23
+ const built_in_props_1 = require("../../dataflow/environments/built-in-props");
24
+ const query_fn_props_1 = require("../../dataflow/environments/query-fn-props");
25
+ const RandomnessProducers = [
26
+ { type: 'function', name: 'set.seed' },
27
+ { type: 'assignment', name: '.Random.seed' }
28
+ ];
23
29
  exports.SEEDED_RANDOMNESS = {
24
30
  createSearch: (config) => flowr_search_builder_1.Q.all().filter(vertex_1.VertexType.FunctionCall)
25
- .with(search_enrichers_1.Enrichment.CallTargets, { onlyBuiltin: true })
31
+ .with(search_enrichers_1.Enrichment.CallTargets, {
32
+ onlyBuiltin: true,
33
+ qualifyNames: false // we don't use qualified names for this rule yet
34
+ })
26
35
  .filter({
27
36
  name: flowr_search_filters_1.FlowrFilter.MatchesEnrichment,
28
37
  args: {
29
38
  enrichment: search_enrichers_1.Enrichment.CallTargets,
30
39
  test: {
31
- targets: (0, flowr_search_filters_1.testFunctionsIgnoringPackage)(config.randomnessConsumers)
40
+ targets: identifier_1.Identifier.regex(...config.randomnessConsumers)
32
41
  }
33
42
  }
34
43
  })
@@ -128,14 +137,13 @@ exports.SEEDED_RANDOMNESS = {
128
137
  },
129
138
  info: {
130
139
  defaultConfig: {
131
- randomnessProducers: [{ type: 'function', name: 'set.seed' }, { type: 'assignment', name: '.Random.seed' }],
140
+ randomnessProducers: RandomnessProducers,
132
141
  randomnessConsumers: [
133
- 'jitter', 'sample', 'sample.int', 'arima.sim', 'kmeans', 'princomp', 'rcauchy', 'rchisq', 'rexp',
134
- 'rgamma', 'rgeom', 'rlnorm', 'rlogis', 'rmultinom', 'rnbinom', 'rnorm', 'rpois', 'runif', 'pointLabel',
135
- 'some', 'rbernoulli', 'rdunif', 'generateSeedVectors',
136
- 'rbeta', 'rf', 'rhyper', 'rweibull', 'rt', 'rvonmises', 'rwilcox', 'rxor', 'rhyper', 'rmvnorm',
137
- 'rsignrank', 'randomForest',
138
- 'permuted', 'permute', 'shuffle', 'shuffleSet', 'data_shuffle', 'sample_frac', 'sample_n', 'slice_sample',
142
+ ...query_fn_props_1.BuiltInIndex.default().with(built_in_props_1.CallProp.Random).map(identifier_1.Identifier.getName)
143
+ .filter(n => !RandomnessProducers.some(p => p.name === n)),
144
+ 'princomp', 'pointLabel', 'some', 'rbernoulli', 'rdunif', 'generateSeedVectors', 'rvonmises',
145
+ 'rxor', 'rmvnorm', 'randomForest',
146
+ 'permuted', 'permute', 'shuffle', 'shuffleSet', 'data_shuffle', 'sample_frac', 'sample_n',
139
147
  ],
140
148
  },
141
149
  tags: [linter_tags_1.LintingRuleTag.Robustness, linter_tags_1.LintingRuleTag.Reproducibility],