@eagleoutice/flowr 2.13.3 → 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 (176) hide show
  1. package/README.md +32 -32
  2. package/abstract-interpretation/absint-visitor.js +2 -2
  3. package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
  4. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +1 -1
  5. package/abstract-interpretation/unsupported-functions.js +1 -1
  6. package/cli/repl/core.js +10 -2
  7. package/config.d.ts +4 -1
  8. package/config.js +10 -1
  9. package/control-flow/cfg-dead-code.js +91 -15
  10. package/control-flow/extract-cfg.js +93 -8
  11. package/control-flow/semantic-cfg-guided-visitor.js +2 -0
  12. package/dataflow/environments/built-in-config.d.ts +6 -3
  13. package/dataflow/environments/built-in-eval-name.d.ts +20 -0
  14. package/dataflow/environments/built-in-eval-name.js +25 -0
  15. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  16. package/dataflow/environments/built-in-proc-name.js +4 -0
  17. package/dataflow/environments/built-in-props.d.ts +175 -0
  18. package/dataflow/environments/built-in-props.js +207 -0
  19. package/dataflow/environments/built-in.d.ts +28 -20
  20. package/dataflow/environments/built-in.js +39 -8
  21. package/dataflow/environments/default-builtin-config.d.ts +1094 -86
  22. package/dataflow/environments/default-builtin-config.js +496 -212
  23. package/dataflow/environments/identifier.d.ts +25 -1
  24. package/dataflow/environments/identifier.js +24 -2
  25. package/dataflow/environments/query-fn-props.d.ts +102 -0
  26. package/dataflow/environments/query-fn-props.js +188 -0
  27. package/dataflow/eval/resolve/alias-tracking.d.ts +2 -0
  28. package/dataflow/eval/resolve/alias-tracking.js +12 -2
  29. package/dataflow/eval/resolve/match-arguments.d.ts +15 -0
  30. package/dataflow/eval/resolve/match-arguments.js +77 -0
  31. package/dataflow/eval/resolve/resolve-numbers.d.ts +202 -0
  32. package/dataflow/eval/resolve/resolve-numbers.js +163 -0
  33. package/dataflow/eval/resolve/resolve-operators.d.ts +60 -0
  34. package/dataflow/eval/resolve/resolve-operators.js +115 -0
  35. package/dataflow/eval/resolve/resolve-strings.d.ts +98 -0
  36. package/dataflow/eval/resolve/resolve-strings.js +116 -0
  37. package/dataflow/eval/resolve/resolve.d.ts +5 -23
  38. package/dataflow/eval/resolve/resolve.js +56 -87
  39. package/dataflow/fn/higher-order-function.js +3 -3
  40. package/dataflow/fn/recursive-function.js +1 -1
  41. package/dataflow/graph/df-helper.js +1 -1
  42. package/dataflow/graph/vertex.d.ts +32 -25
  43. package/dataflow/graph/vertex.js +40 -36
  44. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -0
  45. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -4
  46. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +14 -0
  47. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +28 -29
  48. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +41 -48
  49. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +14 -0
  50. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +45 -0
  51. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -1
  52. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +30 -0
  53. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +62 -2
  54. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +63 -16
  55. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +29 -9
  56. package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +5 -1
  57. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +35 -0
  58. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +2 -2
  59. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +1 -1
  60. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -0
  61. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +46 -0
  62. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
  63. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +3 -1
  64. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -1
  65. package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
  66. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +24 -0
  67. package/dataflow/internal/process/functions/process-parameter.js +2 -1
  68. package/documentation/data/faq/faqs.js +11 -0
  69. package/documentation/doc-util/doc-types.js +1 -1
  70. package/documentation/wiki-analyzer.js +75 -0
  71. package/documentation/wiki-core.js +65 -16
  72. package/documentation/wiki-interface.js +3 -0
  73. package/linter/linter-rules.d.ts +10 -11
  74. package/linter/rules/absolute-path.js +1 -1
  75. package/linter/rules/deprecated-functions.js +5 -3
  76. package/linter/rules/function-finder-util.d.ts +2 -2
  77. package/linter/rules/function-finder-util.js +11 -4
  78. package/linter/rules/network-functions.d.ts +25 -5
  79. package/linter/rules/network-functions.js +51 -11
  80. package/linter/rules/no-leaked-credentials.js +1 -1
  81. package/linter/rules/problematic-inputs.d.ts +1 -1
  82. package/linter/rules/problematic-inputs.js +7 -1
  83. package/linter/rules/seeded-randomness.d.ts +5 -8
  84. package/linter/rules/seeded-randomness.js +17 -9
  85. package/linter/rules/undefined-symbol.js +1 -1
  86. package/linter/rules/unused-definition.js +15 -10
  87. package/linter/rules/useless-loop.js +1 -1
  88. package/package.json +3 -2
  89. package/project/cache/flowr-analyzer-cache.d.ts +4 -3
  90. package/project/cache/flowr-analyzer-cache.js +32 -13
  91. package/project/cache/flowr-cache.d.ts +39 -12
  92. package/project/cache/flowr-cache.js +5 -3
  93. package/project/context/flowr-analyzer-context.d.ts +8 -1
  94. package/project/context/flowr-analyzer-context.js +11 -1
  95. package/project/context/flowr-analyzer-dependencies-context.d.ts +4 -2
  96. package/project/context/flowr-analyzer-dependencies-context.js +15 -1
  97. package/project/context/flowr-analyzer-files-context.d.ts +8 -4
  98. package/project/context/flowr-analyzer-files-context.js +20 -1
  99. package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +33 -0
  100. package/project/context/flowr-analyzer-incremental-analysis-context.js +63 -0
  101. package/project/context/flowr-analyzer-meta-context.d.ts +3 -1
  102. package/project/context/flowr-analyzer-meta-context.js +14 -0
  103. package/project/context/flowr-file.d.ts +25 -3
  104. package/project/context/flowr-file.js +24 -2
  105. package/project/dependency-version-space.d.ts +37 -0
  106. package/project/dependency-version-space.js +118 -26
  107. package/project/flowr-analyzer.d.ts +6 -0
  108. package/project/flowr-analyzer.js +6 -2
  109. package/project/incremental/incremental-parse/edit-computation.d.ts +7 -0
  110. package/project/incremental/incremental-parse/edit-computation.js +61 -0
  111. package/project/incremental/incremental-parse/incremental-parse.d.ts +12 -0
  112. package/project/incremental/incremental-parse/incremental-parse.js +37 -0
  113. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +1 -1
  114. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +57 -0
  115. package/project/plugins/file-plugins/files/flowr-manifest-files.js +121 -0
  116. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -2
  117. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
  118. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +1 -1
  119. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +33 -0
  120. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +53 -0
  121. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +1 -1
  122. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -3
  123. package/project/plugins/package-version-plugins/flowr-analyzer-meta-manifest-file-plugin.d.ts +27 -0
  124. package/project/plugins/package-version-plugins/flowr-analyzer-meta-manifest-file-plugin.js +47 -0
  125. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +7 -0
  126. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +31 -3
  127. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +10 -4
  128. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +17 -4
  129. package/project/plugins/plugin-registry.d.ts +4 -4
  130. package/project/plugins/plugin-registry.js +7 -4
  131. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +4 -4
  132. package/project/sigdb/reader.d.ts +7 -0
  133. package/project/sigdb/reader.js +12 -0
  134. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +1 -1
  135. package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -1
  136. package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +10 -0
  137. package/queries/catalog/dependencies-query/function-info/derived-functions.js +41 -0
  138. package/queries/catalog/dependencies-query/function-info/read-functions.js +14 -13
  139. package/queries/catalog/dependencies-query/function-info/write-functions.js +28 -36
  140. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +33 -3
  141. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +31 -0
  142. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +9 -2
  143. package/queries/catalog/input-sources-query/input-source-functions.d.ts +9 -10
  144. package/queries/catalog/input-sources-query/input-source-functions.js +23 -394
  145. package/queries/catalog/input-sources-query/input-sources-query-executor.js +11 -6
  146. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -0
  147. package/queries/catalog/input-sources-query/input-sources-query-format.js +28 -10
  148. package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +14 -1
  149. package/queries/catalog/input-sources-query/simple-input-classifier.js +24 -0
  150. package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -1
  151. package/queries/catalog/signature-query/signature-query-executor.js +79 -3
  152. package/queries/catalog/signature-query/signature-query-format.d.ts +27 -0
  153. package/queries/catalog/signature-query/signature-query-render.js +21 -3
  154. package/r-bridge/data/data.d.ts +2 -2
  155. package/r-bridge/data/data.js +2 -2
  156. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +6 -2
  157. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +21 -2
  158. package/r-bridge/parser.d.ts +11 -1
  159. package/r-bridge/parser.js +7 -4
  160. package/r-bridge/shell-executor.d.ts +1 -0
  161. package/r-bridge/shell-executor.js +1 -0
  162. package/r-bridge/shell.d.ts +1 -0
  163. package/r-bridge/shell.js +1 -0
  164. package/reconstruct/inline/source-inline-map.js +1 -1
  165. package/search/flowr-search-filters.d.ts +1 -6
  166. package/search/flowr-search-filters.js +1 -8
  167. package/search/search-executor/search-enrichers.d.ts +2 -0
  168. package/search/search-executor/search-enrichers.js +29 -12
  169. package/util/mermaid/dfg.js +1 -1
  170. package/util/version.js +1 -1
  171. package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +0 -31
  172. package/project/plugins/file-plugins/files/flowr-rproject-file.js +0 -66
  173. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +0 -22
  174. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +0 -36
  175. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +0 -13
  176. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +0 -32
@@ -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
  };
@@ -162,7 +162,7 @@ exports.ABSOLUTE_PATH = {
162
162
  }
163
163
  else {
164
164
  const dfNode = dataflow.graph.getVertex(node.info.id);
165
- if ((0, vertex_1.isFunctionCallVertex)(dfNode)) {
165
+ if (vertex_1.FunctionCallVertex.is(dfNode)) {
166
166
  const handler = dfNode.name ? PathFunctions.get(dfNode.name) : undefined;
167
167
  const strings = handler ? handler(dataflow.graph, dfNode, data.inspectContext()) : [];
168
168
  if (strings) {
@@ -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,14 +65,19 @@ 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
- if ((0, vertex_1.isFunctionCallVertex)(vert)) {
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());
75
82
  // we obtain all values, at least one of them has to trigger for the request
76
83
  const argValues = args ? args.values().flatMap(s => Array.from(s)).filter(assert_1.isNotUndefined).toArray() : [];
@@ -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
  };
@@ -34,7 +34,7 @@ exports.NO_LEAKED_CREDENTIALS = {
34
34
  totalChecked++;
35
35
  const name = element.node.lexeme ?? '';
36
36
  const vertex = dfg.getVertex(element.node.info.id);
37
- if (!(0, vertex_1.isVariableDefinitionVertex)(vertex)) {
37
+ if (!vertex_1.VariableDefinitionVertex.is(vertex)) {
38
38
  return [];
39
39
  }
40
40
  const nameMatches = namePattern.test(name);
@@ -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],
@@ -85,7 +85,7 @@ exports.UNDEFINED_SYMBOL = {
85
85
  return undefined;
86
86
  }
87
87
  const inInstalledFile = isInstalledFile(element.node.info.file);
88
- if ((0, vertex_1.isFunctionCallVertex)(vtx)) {
88
+ if (vertex_1.FunctionCallVertex.is(vtx)) {
89
89
  if (vtx.origin === 'unnamed' || !config.checkFunctions) {
90
90
  return undefined;
91
91
  }
@@ -64,29 +64,30 @@ function collectCalledNames(dfg) {
64
64
  }
65
65
  return names;
66
66
  }
67
- /** Checks if a function body is a single call to UseMethod. */
68
- function isUseMethodOnlyBody(node) {
69
- // Direct call to UseMethod
70
- if (r_function_call_1.RFunctionCall.isNamed(node) && identifier_1.Identifier.getName(node.functionName.content) === 'UseMethod') {
67
+ /** S3 (`UseMethod`) and S4/S7 (`standardGeneric`) generic dispatchers, invoked indirectly by R's dispatch. */
68
+ const GenericDispatchers = new Set(['UseMethod', 'standardGeneric']);
69
+ /** Whether a function body is a single call to a generic dispatcher. */
70
+ function isGenericDispatcherOnlyBody(node) {
71
+ if (r_function_call_1.RFunctionCall.isNamed(node) && GenericDispatchers.has(identifier_1.Identifier.getName(node.functionName.content))) {
71
72
  return true;
72
73
  }
73
74
  const nodeWithChildren = node;
74
75
  if (Array.isArray(nodeWithChildren.children) && nodeWithChildren.children.length === 1) {
75
76
  const child = nodeWithChildren.children[0];
76
- if (child && r_function_call_1.RFunctionCall.isNamed(child) && identifier_1.Identifier.getName(child.functionName.content) === 'UseMethod') {
77
+ if (child && r_function_call_1.RFunctionCall.isNamed(child) && GenericDispatchers.has(identifier_1.Identifier.getName(child.functionName.content))) {
77
78
  return true;
78
79
  }
79
80
  }
80
81
  return false;
81
82
  }
82
- /** Collects the parameter IDs of S3 generic functions (functions whose body is just UseMethod). */
83
+ /** Collects the parameter IDs of generic dispatcher functions. */
83
84
  function collectS3GenericParameterIds(ast) {
84
85
  const paramIds = new Set();
85
86
  for (const [, node] of ast.idMap) {
86
87
  if (!r_function_definition_1.RFunctionDefinition.is(node)) {
87
88
  continue;
88
89
  }
89
- if (isUseMethodOnlyBody(node.body)) {
90
+ if (isGenericDispatcherOnlyBody(node.body)) {
90
91
  for (const param of node.parameters) {
91
92
  paramIds.add(param.name.info.id);
92
93
  }
@@ -211,18 +212,22 @@ exports.UNUSED_DEFINITION = {
211
212
  return [];
212
213
  }
213
214
  const dfgVertex = dataflow.graph.getVertex(element.node.info.id);
214
- if (!dfgVertex || (!(0, vertex_1.isVariableDefinitionVertex)(dfgVertex)
215
- && (0, vertex_1.isFunctionDefinitionVertex)(dfgVertex) && !config.includeFunctionDefinitions)) {
215
+ if (!dfgVertex || (!vertex_1.VariableDefinitionVertex.is(dfgVertex)
216
+ && vertex_1.FunctionDefinitionVertex.is(dfgVertex) && !config.includeFunctionDefinitions)) {
216
217
  return undefined;
217
218
  }
218
219
  if (s3GenericParams.has(element.node.info.id)) {
219
220
  return undefined;
220
221
  }
222
+ // an anonymous dispatcher passed to setGeneric()/new_generic() runs on every dispatch, so it is used
223
+ if (vertex_1.FunctionDefinitionVertex.is(dfgVertex) && r_function_definition_1.RFunctionDefinition.is(element.node) && isGenericDispatcherOnlyBody(element.node.body)) {
224
+ return undefined;
225
+ }
221
226
  if (isConsideredUsed(element.node.lexeme, config, packageInfo, calledNames)) {
222
227
  return undefined;
223
228
  }
224
229
  const ingoingEdges = dataflow.graph.ingoingEdges(dfgVertex.id);
225
- const interestedIn = (0, vertex_1.isVariableDefinitionVertex)(dfgVertex) ? InterestingEdgesVariable : InterestingEdgesFunction;
230
+ const interestedIn = vertex_1.VariableDefinitionVertex.is(dfgVertex) ? InterestingEdgesVariable : InterestingEdgesFunction;
226
231
  const ingoingInteresting = ingoingEdges?.values().some(e => edge_1.DfEdge.includesType(e, interestedIn));
227
232
  if (ingoingInteresting) {
228
233
  return undefined;
@@ -16,7 +16,7 @@ exports.USELESS_LOOP = {
16
16
  const results = elements.getElements().filter(e => {
17
17
  const vertex = dataflow.graph.getVertex(e.node.info.id);
18
18
  return vertex
19
- && (0, vertex_1.isFunctionCallVertex)(vertex)
19
+ && vertex_1.FunctionCallVertex.is(vertex)
20
20
  && vertex.origin !== 'unnamed'
21
21
  && useLessLoopConfig.loopyFunctions.has(vertex.origin[0]);
22
22
  }).filter(loop => (0, useless_loop_1.onlyLoopsOnce)(loop.node.info.id, dataflow.graph, cfg, normalize, data.inspectContext())).map(res => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.13.3",
3
+ "version": "2.13.5",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "repository": {
@@ -182,7 +182,7 @@
182
182
  "devDependencies": {
183
183
  "@commitlint/cli": "^20.5.0",
184
184
  "@commitlint/config-angular": "^20.5.0",
185
- "@eagleoutice/eslint-config-flowr": "^2.0.1",
185
+ "@eagleoutice/eslint-config-flowr": "^2.0.2",
186
186
  "@j-ulrich/release-it-regex-bumper": "^5.4.0",
187
187
  "@stylistic/eslint-plugin": "^5.10.0",
188
188
  "@types/command-line-args": "^5.2.3",
@@ -227,6 +227,7 @@
227
227
  "command-line-usage": "^7.0.3",
228
228
  "commonmark": "^0.31.2",
229
229
  "dagre": "^0.8.5",
230
+ "diff": "^8.0.3",
230
231
  "gray-matter": "^4.0.3",
231
232
  "ignore": "^5.3.2",
232
233
  "joi": "^18.0.1",
@@ -1,5 +1,5 @@
1
1
  import type { KnownParser } from '../../r-bridge/parser';
2
- import { type CacheInvalidationEvent, FlowrCache } from './flowr-cache';
2
+ import { FlowrCache, type InvalidationEvent } from './flowr-cache';
3
3
  import { type DEFAULT_DATAFLOW_PIPELINE, type TREE_SITTER_DATAFLOW_PIPELINE } from '../../core/steps/pipeline/default-pipelines';
4
4
  import type { IdGenerator } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
5
5
  import type { NoInfo } from '../../r-bridge/lang-4.x/ast/model/model';
@@ -27,13 +27,14 @@ export declare class FlowrAnalyzerCache<Parser extends KnownParser> extends Flow
27
27
  private callGraphCache;
28
28
  protected constructor(args: FlowrAnalyzerCacheOptions<Parser>);
29
29
  private initCacheProviders;
30
+ static create<Parser extends KnownParser>(data: FlowrAnalyzerCacheOptions<Parser>): FlowrAnalyzerCache<Parser>;
30
31
  /** Free the current parse trees: tree-sitter trees live on the WASM heap, which the GC does not reclaim. */
31
32
  private disposeParse;
32
- static create<Parser extends KnownParser>(data: FlowrAnalyzerCacheOptions<Parser>): FlowrAnalyzerCache<Parser>;
33
- receive(event: CacheInvalidationEvent): void;
33
+ receive(event: InvalidationEvent): void;
34
34
  private get;
35
35
  reset(): void;
36
36
  private runTapeUntil;
37
+ private storeIncrementalSnapshotIfAvailable;
37
38
  /**
38
39
  * Get the parse output for the request, parsing if necessary.
39
40
  * @param force - Do not use the cache, instead force a new parse.