@eagleoutice/flowr 2.10.9 → 2.10.10

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 (256) hide show
  1. package/README.md +103 -33
  2. package/abstract-interpretation/absint-visitor.js +6 -3
  3. package/abstract-interpretation/domains/abstract-domain.d.ts +1 -1
  4. package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
  5. package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
  6. package/abstract-interpretation/domains/interval-domain.d.ts +1 -1
  7. package/abstract-interpretation/domains/interval-domain.js +1 -1
  8. package/abstract-interpretation/domains/lattice.d.ts +1 -1
  9. package/abstract-interpretation/domains/partial-product-domain.d.ts +1 -1
  10. package/abstract-interpretation/domains/partial-product-domain.js +2 -2
  11. package/abstract-interpretation/domains/set-range-domain.d.ts +1 -1
  12. package/abstract-interpretation/domains/set-range-domain.js +1 -1
  13. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +1 -1
  14. package/abstract-interpretation/domains/set-upper-bound-domain.js +1 -1
  15. package/abstract-interpretation/domains/singleton-domain.d.ts +1 -1
  16. package/abstract-interpretation/domains/singleton-domain.js +1 -1
  17. package/abstract-interpretation/domains/state-abstract-domain.d.ts +1 -1
  18. package/abstract-interpretation/domains/state-abstract-domain.js +2 -2
  19. package/abstract-interpretation/unsupported-functions.d.ts +3 -2
  20. package/abstract-interpretation/unsupported-functions.js +38 -28
  21. package/cli/benchmark-app.js +2 -1
  22. package/cli/common/script.js +3 -2
  23. package/cli/flowr.js +47 -10
  24. package/cli/repl/commands/repl-cfg.js +9 -9
  25. package/cli/repl/commands/repl-commands.js +5 -0
  26. package/cli/repl/commands/repl-dataflow.js +31 -24
  27. package/cli/repl/commands/repl-main.d.ts +6 -0
  28. package/cli/repl/commands/repl-normalize.js +15 -12
  29. package/cli/repl/commands/repl-parse.js +1 -1
  30. package/cli/repl/commands/repl-query.js +4 -5
  31. package/cli/repl/commands/repl-quit.js +2 -1
  32. package/cli/repl/core.d.ts +11 -0
  33. package/cli/repl/core.js +101 -3
  34. package/cli/repl/execute.js +3 -2
  35. package/cli/repl/parser/slice-query-parser.d.ts +16 -0
  36. package/cli/repl/parser/slice-query-parser.js +52 -0
  37. package/cli/repl/server/connection.d.ts +1 -0
  38. package/cli/repl/server/connection.js +25 -0
  39. package/cli/repl/server/messages/message-analysis.d.ts +10 -0
  40. package/cli/repl/server/messages/message-analysis.js +6 -2
  41. package/cli/repl/server/messages/message-slice.d.ts +1 -1
  42. package/cli/script-core/statistics-core.js +2 -1
  43. package/cli/script-core/statistics-helper-core.js +2 -1
  44. package/cli/wiki.d.ts +2 -1
  45. package/cli/wiki.js +4 -1
  46. package/config.d.ts +9 -10
  47. package/config.js +25 -7
  48. package/control-flow/diff-cfg.d.ts +1 -1
  49. package/control-flow/diff-cfg.js +1 -1
  50. package/control-flow/semantic-cfg-guided-visitor.js +1 -0
  51. package/control-flow/simple-visitor.js +6 -5
  52. package/control-flow/useless-loop.js +2 -2
  53. package/core/print/dataflow-printer.d.ts +2 -2
  54. package/core/print/dataflow-printer.js +2 -2
  55. package/core/steps/all/static-slicing/00-slice.js +1 -1
  56. package/core/steps/pipeline/default-pipelines.d.ts +146 -146
  57. package/dataflow/environments/append.d.ts +2 -1
  58. package/dataflow/environments/append.js +2 -1
  59. package/dataflow/environments/built-in-proc-name.d.ts +2 -0
  60. package/dataflow/environments/built-in-proc-name.js +2 -0
  61. package/dataflow/environments/built-in.d.ts +2 -0
  62. package/dataflow/environments/built-in.js +2 -0
  63. package/dataflow/environments/default-builtin-config.d.ts +122 -66
  64. package/dataflow/environments/default-builtin-config.js +324 -145
  65. package/dataflow/environments/environment.d.ts +2 -1
  66. package/dataflow/environments/environment.js +13 -9
  67. package/dataflow/environments/identifier.d.ts +55 -2
  68. package/dataflow/environments/identifier.js +14 -2
  69. package/dataflow/environments/reference-to-maybe.d.ts +2 -0
  70. package/dataflow/environments/reference-to-maybe.js +56 -11
  71. package/dataflow/environments/resolve-by-name.js +13 -7
  72. package/dataflow/eval/values/general.js +4 -0
  73. package/dataflow/extractor.js +12 -2
  74. package/dataflow/graph/df-helper.d.ts +6 -0
  75. package/dataflow/graph/df-helper.js +33 -0
  76. package/dataflow/graph/graph.js +1 -1
  77. package/dataflow/info.d.ts +1 -1
  78. package/dataflow/internal/linker.d.ts +5 -1
  79. package/dataflow/internal/linker.js +34 -9
  80. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
  81. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +53 -0
  82. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +13 -0
  83. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +58 -0
  84. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
  85. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -1
  86. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +38 -14
  87. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +9 -10
  88. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +1 -1
  89. package/dataflow/internal/process/functions/call/known-call-handling.js +4 -3
  90. package/dataflow/internal/process/functions/call/named-call-handling.js +6 -0
  91. package/dataflow/origin/dfg-get-origin.d.ts +1 -1
  92. package/dataflow/origin/dfg-get-origin.js +1 -1
  93. package/dataflow/processor.d.ts +6 -0
  94. package/documentation/data/faq/faqs.d.ts +2 -1
  95. package/documentation/data/faq/faqs.js +75 -57
  96. package/documentation/data/server/doc-data-server-messages.d.ts +2 -1
  97. package/documentation/data/server/doc-data-server-messages.js +15 -7
  98. package/documentation/doc-readme.js +15 -15
  99. package/documentation/doc-util/doc-cfg.d.ts +3 -1
  100. package/documentation/doc-util/doc-cfg.js +3 -3
  101. package/documentation/doc-util/doc-dfg.d.ts +3 -1
  102. package/documentation/doc-util/doc-dfg.js +3 -3
  103. package/documentation/doc-util/doc-files.d.ts +3 -1
  104. package/documentation/doc-util/doc-files.js +9 -6
  105. package/documentation/doc-util/doc-normalized-ast.d.ts +3 -1
  106. package/documentation/doc-util/doc-normalized-ast.js +2 -2
  107. package/documentation/doc-util/doc-query.d.ts +2 -1
  108. package/documentation/doc-util/doc-query.js +2 -2
  109. package/documentation/doc-util/doc-repl.js +1 -0
  110. package/documentation/doc-util/doc-types.d.ts +6 -6
  111. package/documentation/doc-util/doc-types.js +11 -9
  112. package/documentation/issue-linting-rule.js +1 -2
  113. package/documentation/wiki-analyzer.js +9 -9
  114. package/documentation/wiki-cfg.js +40 -41
  115. package/documentation/wiki-core.js +119 -31
  116. package/documentation/wiki-create-linting-rules.d.ts +6 -0
  117. package/documentation/wiki-create-linting-rules.js +95 -0
  118. package/documentation/wiki-dataflow-graph.js +77 -76
  119. package/documentation/wiki-engine.js +1 -2
  120. package/documentation/wiki-faq.d.ts +2 -1
  121. package/documentation/wiki-faq.js +4 -4
  122. package/documentation/wiki-interface.js +19 -6
  123. package/documentation/wiki-linter.d.ts +1 -1
  124. package/documentation/wiki-linter.js +14 -6
  125. package/documentation/wiki-linting-and-testing.js +2 -2
  126. package/documentation/wiki-mk/doc-context.d.ts +3 -3
  127. package/documentation/wiki-mk/doc-maker.d.ts +2 -0
  128. package/documentation/wiki-mk/doc-maker.js +7 -1
  129. package/documentation/wiki-normalized-ast.js +5 -5
  130. package/documentation/wiki-onboarding.d.ts +2 -1
  131. package/documentation/wiki-onboarding.js +5 -5
  132. package/documentation/wiki-overview.js +3 -3
  133. package/documentation/wiki-query.js +85 -84
  134. package/documentation/wiki-search.js +4 -5
  135. package/documentation/wiki-setup.js +6 -7
  136. package/gas.d.ts +74 -0
  137. package/gas.js +18 -0
  138. package/linter/linter-executor.js +2 -8
  139. package/linter/linter-format.d.ts +4 -11
  140. package/linter/linter-rules.d.ts +88 -86
  141. package/linter/linter-rules.js +7 -1
  142. package/linter/rules/absolute-path.d.ts +2 -7
  143. package/linter/rules/absolute-path.js +6 -4
  144. package/linter/rules/dataframe-access-validation.d.ts +1 -6
  145. package/linter/rules/dataframe-access-validation.js +8 -6
  146. package/linter/rules/dead-code.d.ts +2 -11
  147. package/linter/rules/dead-code.js +16 -11
  148. package/linter/rules/deprecated-functions.d.ts +3 -3
  149. package/linter/rules/file-path-validity.d.ts +1 -6
  150. package/linter/rules/file-path-validity.js +5 -5
  151. package/linter/rules/function-finder-util.d.ts +7 -11
  152. package/linter/rules/function-finder-util.js +9 -6
  153. package/linter/rules/naming-convention.d.ts +2 -7
  154. package/linter/rules/naming-convention.js +3 -2
  155. package/linter/rules/network-functions.d.ts +2 -7
  156. package/linter/rules/network-functions.js +14 -12
  157. package/linter/rules/no-leaked-credentials.d.ts +36 -0
  158. package/linter/rules/no-leaked-credentials.js +75 -0
  159. package/linter/rules/problematic-inputs.d.ts +1 -8
  160. package/linter/rules/problematic-inputs.js +5 -4
  161. package/linter/rules/roxygen-arguments.d.ts +2 -7
  162. package/linter/rules/roxygen-arguments.js +13 -20
  163. package/linter/rules/seeded-randomness.d.ts +2 -7
  164. package/linter/rules/seeded-randomness.js +7 -4
  165. package/linter/rules/software-has-license.d.ts +31 -0
  166. package/linter/rules/software-has-license.js +46 -0
  167. package/linter/rules/software-has-tests.d.ts +38 -0
  168. package/linter/rules/software-has-tests.js +48 -0
  169. package/linter/rules/stop-with-call-arg.d.ts +2 -7
  170. package/linter/rules/stop-with-call-arg.js +3 -2
  171. package/linter/rules/unused-definition.d.ts +3 -8
  172. package/linter/rules/unused-definition.js +7 -5
  173. package/linter/rules/useless-loop.d.ts +2 -7
  174. package/linter/rules/useless-loop.js +5 -2
  175. package/package.json +3 -2
  176. package/project/context/flowr-analyzer-context.d.ts +13 -14
  177. package/project/context/flowr-analyzer-context.js +4 -0
  178. package/project/context/flowr-analyzer-files-context.d.ts +12 -0
  179. package/project/context/flowr-analyzer-files-context.js +12 -2
  180. package/project/context/flowr-analyzer-gas-context.d.ts +28 -0
  181. package/project/context/flowr-analyzer-gas-context.js +101 -0
  182. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +13 -7
  183. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +56 -11
  184. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
  185. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +2 -2
  186. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +2 -1
  187. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +5 -5
  188. package/project/plugins/flowr-analyzer-plugin.d.ts +15 -8
  189. package/project/plugins/flowr-analyzer-plugin.js +14 -7
  190. package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.d.ts +19 -0
  191. package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.js +35 -0
  192. package/project/plugins/plugin-registry.d.ts +2 -1
  193. package/project/plugins/plugin-registry.js +3 -1
  194. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +22 -0
  195. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +47 -0
  196. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +1 -1
  197. package/queries/catalog/call-context-query/call-context-query-executor.js +54 -8
  198. package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -2
  199. package/queries/catalog/dependencies-query/function-info/test-functions.d.ts +2 -0
  200. package/queries/catalog/dependencies-query/function-info/test-functions.js +18 -177
  201. package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
  202. package/queries/catalog/dice-query/dice-query-executor.d.ts +8 -0
  203. package/queries/catalog/dice-query/dice-query-executor.js +52 -0
  204. package/queries/catalog/dice-query/dice-query-format.d.ts +53 -0
  205. package/queries/catalog/dice-query/dice-query-format.js +102 -0
  206. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
  207. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
  208. package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -0
  209. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
  210. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -0
  211. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
  212. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -0
  213. package/queries/catalog/linter-query/linter-query-executor.js +7 -0
  214. package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
  215. package/queries/catalog/location-map-query/location-map-query-format.js +1 -0
  216. package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
  217. package/queries/catalog/origin-query/origin-query-format.js +1 -0
  218. package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
  219. package/queries/catalog/provenance-query/provenance-query-format.js +1 -0
  220. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
  221. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -0
  222. package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
  223. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -0
  224. package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -0
  225. package/queries/query.d.ts +18 -1
  226. package/queries/query.js +3 -1
  227. package/r-bridge/data/data.d.ts +5 -0
  228. package/r-bridge/data/data.js +6 -0
  229. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +0 -1
  230. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.d.ts +1 -1
  231. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
  232. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.d.ts +1 -1
  233. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -1
  234. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +55 -44
  235. package/r-bridge/parser.js +2 -9
  236. package/r-bridge/shell.d.ts +8 -1
  237. package/r-bridge/shell.js +26 -7
  238. package/search/flowr-search-builder.d.ts +2 -2
  239. package/search/flowr-search-builder.js +1 -1
  240. package/search/flowr-search-filters.d.ts +30 -9
  241. package/search/flowr-search-filters.js +26 -21
  242. package/search/search-executor/search-enrichers.d.ts +600 -0
  243. package/search/search-executor/search-enrichers.js +23 -2
  244. package/slicing/static/static-slicer.d.ts +39 -11
  245. package/slicing/static/static-slicer.js +44 -14
  246. package/util/collections/queue.d.ts +16 -0
  247. package/util/collections/queue.js +38 -0
  248. package/util/log.d.ts +1 -1
  249. package/util/log.js +1 -1
  250. package/util/mermaid/dfg.d.ts +2 -2
  251. package/util/mermaid/dfg.js +2 -2
  252. package/util/objects.d.ts +9 -0
  253. package/util/objects.js +54 -0
  254. package/util/proc.d.ts +6 -0
  255. package/util/proc.js +20 -0
  256. package/util/version.js +1 -1
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WikiCreateLintingRules = void 0;
4
+ const doc_files_1 = require("./doc-util/doc-files");
5
+ const doc_maker_1 = require("./wiki-mk/doc-maker");
6
+ const linter_format_1 = require("../linter/linter-format");
7
+ const flowr_search_builder_1 = require("../search/flowr-search-builder");
8
+ const deprecated_functions_1 = require("../linter/rules/deprecated-functions");
9
+ function lintingRuleFields(ctx) {
10
+ return Object.keys(deprecated_functions_1.DEPRECATED_FUNCTIONS).map(field => {
11
+ return `- ${ctx.link(`LintingRule::${field}`)} ${ctx.doc(`LintingRule::${field}`)}`;
12
+ }).join('\n');
13
+ }
14
+ function lintingRuleInfoFields(ctx) {
15
+ return Object.keys(deprecated_functions_1.DEPRECATED_FUNCTIONS.info).map(field => {
16
+ return ` - ${ctx.link(`LinterRuleInformation::${field}`)} ${ctx.doc(`LinterRuleInformation::${field}`)}`;
17
+ }).join('\n');
18
+ }
19
+ function defineRule() {
20
+ // eslint-disable-next-line @typescript-eslint/naming-convention
21
+ const MY_NEW_RULE = {
22
+ createSearch: (_config) => flowr_search_builder_1.Q.all(),
23
+ processSearchResult: (_elements, _config, _data) => ({
24
+ results: [],
25
+ '.meta': {}
26
+ }),
27
+ prettyPrint: {
28
+ query: (_result, _metadata) => 'my-rule finding',
29
+ full: (_result, _metadata) => 'My Rule reported a finding that should be reviewed.'
30
+ },
31
+ info: {
32
+ name: 'My Rule',
33
+ description: 'Detects something.',
34
+ tags: [],
35
+ certainty: linter_format_1.LintingRuleCertainty.BestEffort,
36
+ defaultConfig: {}
37
+ }
38
+ };
39
+ void MY_NEW_RULE;
40
+ }
41
+ class WikiCreateLintingRules extends doc_maker_1.DocMaker {
42
+ constructor() {
43
+ super('wiki/Create Linting Rules.md', module.filename, 'creating linting rules');
44
+ }
45
+ text({ ctx }) {
46
+ return `
47
+ # Create Linting Rules
48
+
49
+ This page explains how to add a new linting rule to flowR. For an overview of the linter and the existing linting rules, see ${ctx.linkPage('wiki/Linter')}.
50
+
51
+ ## Step 1: Create the new rule file
52
+
53
+ To add a new linting rule, create a dedicated rule file next to the existing rule implementations. The file name should correspond to the exported linting rule object, for example \`my-new-rule.ts\` for a rule object named \`MY_NEW_RULE\`.
54
+ Existing rules such as ${ctx.link('DEPRECATED_FUNCTIONS')} can be used as references.
55
+ Before implementing a new linting rule, open a corresponding [linting rule issue](${doc_files_1.FlowrGithubRef}/issues/new?template=linting-rule.yaml) using the accompanying issue template.
56
+
57
+ ## Step 2: Define the types for the rule
58
+
59
+ For new rules, the central interface is ${ctx.link('LintingRule')}. Its type parameters are documented directly as part of the interface.
60
+
61
+ ## Step 3: Define the rule itself
62
+
63
+ A new linting rule must implement the ${ctx.link('LintingRule')} interface. It consists of the following main parts:
64
+
65
+ ${lintingRuleFields(ctx)}
66
+
67
+ The ${ctx.link('LintingRule::info')} field has type ${ctx.link('LinterRuleInformation')} and contains:
68
+
69
+ ${lintingRuleInfoFields(ctx)}
70
+
71
+ The following example shows the basic structure of a linting rule:
72
+
73
+ ${ctx.code(defineRule, { dropLinesStart: 8, dropLinesEnd: 2 })}
74
+
75
+
76
+ ## Step 4: Register the rule
77
+
78
+ After implementing the rule, register it by adding it to ${ctx.link('LintingRules')}.
79
+
80
+
81
+ ## Step 5: Add the rule to the linter wiki generation
82
+
83
+ After registering the rule, add a corresponding \`rule\` entry to the linter wiki generation in ${ctx.link('WikiLinter')}. These entries are used to generate the linter overview and the individual wiki pages for linting rules, which can then be inspected through ${ctx.linkPage('wiki/Linter')}.
84
+
85
+ ## Step 6: Add tests for the rule
86
+
87
+ New linting rules should be covered by tests following the existing linter test pattern. The test file should be named \`lint-<my-new-rule>.test.ts\`. Existing linter tests can be used as references for the expected structure.
88
+
89
+ The linter wiki automatically extracts additional examples from these tests by reading \`assertLinter\` calls. If a test should not appear as a generated wiki example, add \`/* @ignore-in-wiki */\` to the test.
90
+ For general information on creating and regenerating wiki pages, see ${ctx.linkPage('wiki/FAQ')}, especially the FAQ entry on creating new wiki pages. The linter overview and the generated rule documentation can then be inspected through ${ctx.linkPage('wiki/Linter')}.
91
+ `;
92
+ }
93
+ }
94
+ exports.WikiCreateLintingRules = WikiCreateLintingRules;
95
+ //# sourceMappingURL=wiki-create-linting-rules.js.map