@eagleoutice/flowr 2.16.7 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -10
- package/abstract-interpretation/absint-inference.d.ts +17 -1
- package/abstract-interpretation/absint-inference.js +118 -3
- package/abstract-interpretation/data-frame/arguments.d.ts +11 -1
- package/abstract-interpretation/data-frame/arguments.js +12 -0
- package/abstract-interpretation/domains/lattice.d.ts +2 -0
- package/abstract-interpretation/domains/lattice.js +0 -6
- package/abstract-interpretation/domains/multi-value-state-domain.d.ts +2 -1
- package/abstract-interpretation/domains/multi-value-state-domain.js +7 -3
- package/abstract-interpretation/domains/partial-product-domain.js +2 -1
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +6 -3
- package/abstract-interpretation/domains/state-abstract-domain.js +13 -7
- package/abstract-interpretation/domains/state-domain.d.ts +4 -0
- package/config.js +1 -1
- package/control-flow/useless-loop.js +10 -8
- package/data/r-primitives.generated.d.ts +1 -0
- package/data/r-primitives.generated.js +9 -0
- package/data/sigdb/sigdb.remote.json +110 -110
- package/dataflow/environments/identifier.d.ts +1 -1
- package/dataflow/environments/query-fn-props.d.ts +9 -3
- package/dataflow/environments/query-fn-props.js +13 -5
- package/dataflow/environments/reference-to-maybe.js +1 -6
- package/dataflow/fn/class-declaration.js +1 -8
- package/dataflow/graph/dataflowgraph-builder.d.ts +4 -4
- package/dataflow/graph/df-helper.d.ts +2 -0
- package/dataflow/graph/df-helper.js +7 -0
- package/dataflow/graph/graph.js +3 -10
- package/dataflow/graph/vertex.d.ts +1 -1
- package/dataflow/hooks.d.ts +1 -1
- package/dataflow/info.d.ts +3 -3
- package/dataflow/internal/linker.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +1 -7
- package/dataflow/processor.d.ts +1 -1
- package/documentation/wiki-linter.js +29 -0
- package/documentation/wiki-query.js +20 -1
- package/linter/linter-executor.js +2 -1
- package/linter/linter-rules.d.ts +65 -0
- package/linter/linter-rules.js +5 -1
- package/linter/rules/cmd-check/global-environment-modification.d.ts +14 -1
- package/linter/rules/cmd-check/global-environment-modification.js +15 -7
- package/linter/rules/no-leaked-credentials.d.ts +1 -0
- package/linter/rules/no-leaked-credentials.js +3 -3
- package/linter/rules/process-state-in-session.d.ts +71 -0
- package/linter/rules/process-state-in-session.js +267 -0
- package/linter/rules/secret-exfiltration.d.ts +80 -0
- package/linter/rules/secret-exfiltration.js +183 -0
- package/package.json +1 -1
- package/project/flowr-analyzer.d.ts +6 -0
- package/project/flowr-analyzer.js +4 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +22 -3
- package/project/sigdb/decompress.d.ts +4 -0
- package/project/sigdb/decompress.js +60 -25
- package/project/sigdb/manifest.d.ts +1 -1
- package/project/sigdb/manifest.js +2 -5
- package/project/sigdb/reader.js +15 -6
- package/project/sigdb/sigdb-download.d.ts +3 -7
- package/project/sigdb/sigdb-download.js +71 -72
- package/queries/catalog/taint-query/taint-query-executor.d.ts +7 -0
- package/queries/catalog/taint-query/taint-query-executor.js +30 -0
- package/queries/catalog/taint-query/taint-query-format.d.ts +29 -0
- package/queries/catalog/taint-query/taint-query-format.js +124 -0
- package/queries/query.d.ts +12 -1
- package/queries/query.js +2 -0
- package/taint-analysis/builder/domain.d.ts +14 -0
- package/taint-analysis/builder/domain.js +69 -0
- package/taint-analysis/builder/report-template.d.ts +50 -0
- package/taint-analysis/builder/report-template.js +46 -0
- package/taint-analysis/builder/taint-analysis-definition.d.ts +108 -0
- package/taint-analysis/builder/taint-analysis-definition.js +128 -0
- package/taint-analysis/builder/taint-analysis.d.ts +124 -0
- package/taint-analysis/builder/taint-analysis.js +93 -0
- package/taint-analysis/builtin-index-bridge.d.ts +20 -0
- package/taint-analysis/builtin-index-bridge.js +48 -0
- package/taint-analysis/eval/eval.d.ts +1 -0
- package/taint-analysis/eval/eval.js +124 -0
- package/taint-analysis/eval/instrumentation.d.ts +59 -0
- package/taint-analysis/eval/instrumentation.js +124 -0
- package/taint-analysis/finite-domain.d.ts +41 -0
- package/taint-analysis/finite-domain.js +118 -0
- package/taint-analysis/function-categories.d.ts +31 -0
- package/taint-analysis/function-categories.js +61 -0
- package/taint-analysis/logger.d.ts +1 -0
- package/taint-analysis/logger.js +6 -0
- package/taint-analysis/predefined/determinism.d.ts +6 -0
- package/taint-analysis/predefined/determinism.js +14 -0
- package/taint-analysis/predefined/normalization.d.ts +17 -0
- package/taint-analysis/predefined/normalization.js +150 -0
- package/taint-analysis/predefined/predefined.d.ts +12 -0
- package/taint-analysis/predefined/predefined.js +18 -0
- package/taint-analysis/predefined/randomness-analysis.d.ts +6 -0
- package/taint-analysis/predefined/randomness-analysis.js +124 -0
- package/taint-analysis/predefined/secret-analysis.d.ts +77 -0
- package/taint-analysis/predefined/secret-analysis.js +165 -0
- package/taint-analysis/predefined/security-analysis.d.ts +7 -0
- package/taint-analysis/predefined/security-analysis.js +91 -0
- package/taint-analysis/taint-mapping.d.ts +86 -0
- package/taint-analysis/taint-mapping.js +70 -0
- package/taint-analysis/taint-resolve.d.ts +26 -0
- package/taint-analysis/taint-resolve.js +86 -0
- package/taint-analysis/taint-visitor.d.ts +80 -0
- package/taint-analysis/taint-visitor.js +82 -0
- package/util/flowr-version.d.ts +1 -1
- package/util/flowr-version.js +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RPrimitives: ReadonlySet<string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RPrimitives = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* GENERATED, do not edit: the primitive functions of base R. R 4.6.1 (2026-06-24). Regenerate:
|
|
6
|
+
* Rscript -e 'b<-baseenv();n<-ls(b,all.names=TRUE);writeLines(sort(n[vapply(n,function(x)is.primitive(get(x,envir=b)),NA)]))'
|
|
7
|
+
*/
|
|
8
|
+
exports.RPrimitives = new Set(["-", ":", "::", ":::", "!", "!=", "...elt", "...length", "...names", ".C", ".cache_class", ".Call", ".Call.graphics", ".class2", ".External", ".External.graphics", ".External2", ".Fortran", ".Internal", ".isMethodsDispatchOn", ".Primitive", ".primTrace", ".primUntrace", ".subset", ".subset2", "(", "[", "[[", "[[<-", "[<-", "{", "@", "@<-", "*", "/", "&", "&&", "%*%", "%/%", "%%", "^", "+", "<", "<-", "<<-", "<=", "=", "==", ">", ">=", "|", "||", "~", "$", "$<-", "abs", "acos", "acosh", "all", "any", "anyNA", "Arg", "as.call", "as.character", "as.complex", "as.double", "as.environment", "as.integer", "as.logical", "as.numeric", "as.raw", "asin", "asinh", "atan", "atanh", "attr", "attr<-", "attributes", "attributes<-", "baseenv", "break", "browser", "c", "call", "ceiling", "class", "class<-", "Conj", "cos", "cosh", "cospi", "crossprod", "cummax", "cummin", "cumprod", "cumsum", "declare", "digamma", "dim", "dim<-", "dimnames", "dimnames<-", "emptyenv", "enc2native", "enc2utf8", "environment<-", "Exec", "exp", "expm1", "expression", "floor", "for", "forceAndCall", "function", "gamma", "gc.time", "globalenv", "if", "Im", "interactive", "invisible", "is.array", "is.atomic", "is.call", "is.character", "is.complex", "is.double", "is.environment", "is.expression", "is.finite", "is.function", "is.infinite", "is.integer", "is.language", "is.list", "is.logical", "is.matrix", "is.na", "is.name", "is.nan", "is.null", "is.numeric", "is.object", "is.pairlist", "is.raw", "is.recursive", "is.single", "is.symbol", "isS4", "lazyLoadDBfetch", "length", "length<-", "levels<-", "lgamma", "list", "log", "log10", "log1p", "log2", "max", "min", "missing", "Mod", "names", "names<-", "nargs", "next", "nzchar", "oldClass", "oldClass<-", "on.exit", "pos.to.env", "proc.time", "prod", "quote", "range", "Re", "rep", "repeat", "retracemem", "return", "round", "seq_along", "seq_len", "seq.int", "sign", "signif", "sin", "sinh", "sinpi", "sqrt", "standardGeneric", "storage.mode<-", "substitute", "sum", "switch", "Tailcall", "tan", "tanh", "tanpi", "tcrossprod", "tracemem", "trigamma", "trunc", "unCfillPOSIXlt", "unclass", "untracemem", "UseMethod", "while", "xtfrm"]);
|
|
9
|
+
//# sourceMappingURL=r-primitives.generated.js.map
|
|
@@ -1,112 +1,112 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
2
|
+
"format": "flowr-sigdb-remote",
|
|
3
|
+
"schema": 2,
|
|
4
|
+
"tag": "v2.12.3",
|
|
5
|
+
"repo": "flowr-analysis/flowr",
|
|
6
|
+
"shards": {
|
|
7
|
+
"base.base-current.sigs.ndjson.br": {
|
|
8
|
+
"sha256": "e416dbb477b7db257a024e564c4b1624bceec977f8935b5b7d886680bee51523",
|
|
9
|
+
"bytes": 94093
|
|
10
|
+
},
|
|
11
|
+
"base.base-current.sigs.ndjson.zst": {
|
|
12
|
+
"sha256": "344725e5e230667a6189a80dd69e70c7c5d3681b8955f8776b6c2d454ed13759",
|
|
13
|
+
"bytes": 99922
|
|
14
|
+
},
|
|
15
|
+
"base.base-full.sigs.ndjson.br": {
|
|
16
|
+
"sha256": "0631a4448840cd8ae5dd5495cb7a76736ed4157cb8a9614017571c9be8f281b6",
|
|
17
|
+
"bytes": 427552
|
|
18
|
+
},
|
|
19
|
+
"base.base-full.sigs.ndjson.zst": {
|
|
20
|
+
"sha256": "c6d4224dd34c53163af537731b767cf5ec100d688325aca560a6f732897f1306",
|
|
21
|
+
"bytes": 464284
|
|
22
|
+
},
|
|
23
|
+
"base.dict.sigs.ndjson.br": {
|
|
24
|
+
"sha256": "b9b67b8482d94790e549bd992285efcc1a0b6fe63e8c27f3aff90181b93e93b9",
|
|
25
|
+
"bytes": 49912
|
|
26
|
+
},
|
|
27
|
+
"base.dict.sigs.ndjson.zst": {
|
|
28
|
+
"sha256": "15ecccca667b47e3b5f29d8cc149efa6741455bb94a62740736753f8bbd84a89",
|
|
29
|
+
"bytes": 51311
|
|
30
|
+
},
|
|
31
|
+
"base.manifest.json.br": {
|
|
32
|
+
"sha256": "d7749a4146eee5f64a31a58c609dc1af537fd158672f468f04c3e45469d00f63",
|
|
33
|
+
"bytes": 802
|
|
34
|
+
},
|
|
35
|
+
"base.manifest.json.zst": {
|
|
36
|
+
"sha256": "84dc383f8414764e0f080d3b00ba53c54b9fed58285e67341d5c4182cc06402e",
|
|
37
|
+
"bytes": 916
|
|
38
|
+
},
|
|
39
|
+
"current.base-current.sigs.ndjson.br": {
|
|
40
|
+
"sha256": "664459693ec1ff507fae465dc91c34f4dd507063144bfe6ae4d18fd17cbbf132",
|
|
41
|
+
"bytes": 101245
|
|
42
|
+
},
|
|
43
|
+
"current.base-current.sigs.ndjson.zst": {
|
|
44
|
+
"sha256": "adb44ea28268be16428b59265865c567b5232bc1e015feef29802c3116d03d93",
|
|
45
|
+
"bytes": 106631
|
|
46
|
+
},
|
|
47
|
+
"current.base-full.sigs.ndjson.br": {
|
|
48
|
+
"sha256": "9e339e4916fdf11a0339591705eaa6d356656873355777ead3476fc4b607d247",
|
|
49
|
+
"bytes": 443384
|
|
50
|
+
},
|
|
51
|
+
"current.base-full.sigs.ndjson.zst": {
|
|
52
|
+
"sha256": "92ed0acca5215c4f7e45aabe4ea5b3266525a624deed03b73e351900689cbeba",
|
|
53
|
+
"bytes": 479202
|
|
54
|
+
},
|
|
55
|
+
"current.current-rest.sigs.ndjson.br": {
|
|
56
|
+
"sha256": "4b0eaaaf4322c0c661906933c758adbf8e1555d768f765e62e59e1cd5ce25371",
|
|
57
|
+
"bytes": 15063281
|
|
58
|
+
},
|
|
59
|
+
"current.current-rest.sigs.ndjson.zst": {
|
|
60
|
+
"sha256": "c9253bd53ed377e5ef17c328b2c6c9b095afd8745fa2d285a4f9e3cb9f50f4e5",
|
|
61
|
+
"bytes": 15788300
|
|
62
|
+
},
|
|
63
|
+
"current.current-top.sigs.ndjson.br": {
|
|
64
|
+
"sha256": "b9351afc6de023d65df243cb325b2a88c919acfdc872b7cb5b734d0a3d20a61f",
|
|
65
|
+
"bytes": 2123308
|
|
66
|
+
},
|
|
67
|
+
"current.current-top.sigs.ndjson.zst": {
|
|
68
|
+
"sha256": "c1cf6aced3ba0013e3369e7e1e0d843659bd74936d89343b8f65d0a83a1d270a",
|
|
69
|
+
"bytes": 2224574
|
|
70
|
+
},
|
|
71
|
+
"current.dict.sigs.ndjson.br": {
|
|
72
|
+
"sha256": "467798d91506e50cd419513acdc90b1ad40eb8888af3ca9e94b9292acccff42c",
|
|
73
|
+
"bytes": 6635365
|
|
74
|
+
},
|
|
75
|
+
"current.dict.sigs.ndjson.zst": {
|
|
76
|
+
"sha256": "ba26328b2e41d569470d7dcae74e8a7b71cc5b96129ac975a80aaaba7f14b900",
|
|
77
|
+
"bytes": 6776106
|
|
78
|
+
},
|
|
79
|
+
"current.manifest.json.br": {
|
|
80
|
+
"sha256": "9d150be7ef1c265dff29d8a07df8af9440a01cce5b3c4702ea5d4c175d7ad9d3",
|
|
81
|
+
"bytes": 420886
|
|
82
|
+
},
|
|
83
|
+
"current.manifest.json.zst": {
|
|
84
|
+
"sha256": "8f7fa0048b6e50560eb11a05e0b6c7cd73332f60f106b3051ff6db8135468a06",
|
|
85
|
+
"bytes": 540936
|
|
86
|
+
},
|
|
87
|
+
"history.dict.sigs.ndjson.br": {
|
|
88
|
+
"sha256": "d99208eadaa7bf5f2acd6ec41a05dba3eeffc68faa294cbd018a4b9b78e77107",
|
|
89
|
+
"bytes": 6917713
|
|
90
|
+
},
|
|
91
|
+
"history.dict.sigs.ndjson.zst": {
|
|
92
|
+
"sha256": "29d01db01b65d7b84f4b05f5c652905214be270b11e0ba802108178b810a2099",
|
|
93
|
+
"bytes": 7048453
|
|
94
|
+
},
|
|
95
|
+
"history.history-rest.sigs.ndjson.br": {
|
|
96
|
+
"sha256": "ddfa1dd8c5b2abcb8f14711c91c8e3490778759171933381929f612c939d92a1",
|
|
97
|
+
"bytes": 29750045
|
|
98
|
+
},
|
|
99
|
+
"history.history-rest.sigs.ndjson.zst": {
|
|
100
|
+
"sha256": "e83887af44e7894d85ddac23acf5347b8dc5a143ed8c83fc95a64fbdf9f7a4b7",
|
|
101
|
+
"bytes": 32199780
|
|
102
|
+
},
|
|
103
|
+
"history.manifest.json.br": {
|
|
104
|
+
"sha256": "bf79bca873f7b056915db8d845f31acec64c2bb75b423c21e0b40e6e5ecd8d33",
|
|
105
|
+
"bytes": 335712
|
|
106
|
+
},
|
|
107
|
+
"history.manifest.json.zst": {
|
|
108
|
+
"sha256": "a290c361dada2d97657aafe8d788e3b1f723ad3cfc31630a6338afe43d55b248",
|
|
109
|
+
"bytes": 429934
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
112
|
}
|
|
@@ -458,7 +458,7 @@ export interface IdentifierReference {
|
|
|
458
458
|
* If the reference is only effective, if, for example, an if-then-else condition is true, this references the root of the `if`.
|
|
459
459
|
* As a hacky intermediate solution (until we have pointer-analysis), an empty array may indicate a `maybe` which is due to pointer access (e.g., in `a[x] <- 3`).
|
|
460
460
|
*/
|
|
461
|
-
cds?: ControlDependency[] | undefined;
|
|
461
|
+
cds?: readonly ControlDependency[] | undefined;
|
|
462
462
|
}
|
|
463
463
|
/**
|
|
464
464
|
* The definition of an {@link Identifier|identifier} within the {@link DataflowGraph|graph}.
|
|
@@ -141,13 +141,19 @@ export declare class BuiltInIndex {
|
|
|
141
141
|
static ofEnvironment(builtIns: BuiltIns): BuiltInIndex;
|
|
142
142
|
/** answers are keyed by what was asked, as every caller asks the same handful of questions over and over */
|
|
143
143
|
private cached;
|
|
144
|
-
/**
|
|
145
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Every built-in carrying at least one property of `props`, like {@link SemanticCallTag.File} for the file calls.
|
|
146
|
+
* @param props - The built-in must satisfy at least one of these properties.
|
|
147
|
+
* @param excluding - Drop built-ins that also carry any of these properties.
|
|
148
|
+
*/
|
|
149
|
+
with(props: PropSelector, excluding?: PropSelector): readonly Identifier[];
|
|
146
150
|
/**
|
|
147
151
|
* Every built-in carrying *every* property of `props`, for the questions a single one cannot answer,
|
|
148
152
|
* like {@link FileInputProps} for the calls that read a file rather than only write one.
|
|
153
|
+
* @param props - The built-in must satisfy all of these properties.
|
|
154
|
+
* @param excluding - Drop built-ins that also carry any of these properties.
|
|
149
155
|
*/
|
|
150
|
-
withAll(props: PropSelector): readonly Identifier[];
|
|
156
|
+
withAll(props: PropSelector, excluding?: PropSelector): readonly Identifier[];
|
|
151
157
|
/**
|
|
152
158
|
* Every built-in that states its props but carries none of `props`. With {@link InputProps} this yields
|
|
153
159
|
* the calls that derive their result from their arguments alone.
|
|
@@ -380,16 +380,24 @@ class BuiltInIndex {
|
|
|
380
380
|
}
|
|
381
381
|
return found;
|
|
382
382
|
}
|
|
383
|
-
/**
|
|
384
|
-
|
|
385
|
-
|
|
383
|
+
/**
|
|
384
|
+
* Every built-in carrying at least one property of `props`, like {@link SemanticCallTag.File} for the file calls.
|
|
385
|
+
* @param props - The built-in must satisfy at least one of these properties.
|
|
386
|
+
* @param excluding - Drop built-ins that also carry any of these properties.
|
|
387
|
+
*/
|
|
388
|
+
with(props, excluding) {
|
|
389
|
+
const key = `with:${built_in_props_1.CallProps.key(props)}${excluding === undefined ? '' : `!${built_in_props_1.CallProps.key(excluding)}`}`;
|
|
390
|
+
return this.cached(key, e => built_in_props_1.CallProps.hasAny(e, props) && (excluding === undefined || !built_in_props_1.CallProps.hasAny(e, excluding)));
|
|
386
391
|
}
|
|
387
392
|
/**
|
|
388
393
|
* Every built-in carrying *every* property of `props`, for the questions a single one cannot answer,
|
|
389
394
|
* like {@link FileInputProps} for the calls that read a file rather than only write one.
|
|
395
|
+
* @param props - The built-in must satisfy all of these properties.
|
|
396
|
+
* @param excluding - Drop built-ins that also carry any of these properties.
|
|
390
397
|
*/
|
|
391
|
-
withAll(props) {
|
|
392
|
-
|
|
398
|
+
withAll(props, excluding) {
|
|
399
|
+
const key = `all:${built_in_props_1.CallProps.key(props)}${excluding === undefined ? '' : `!${built_in_props_1.CallProps.key(excluding)}`}`;
|
|
400
|
+
return this.cached(key, e => built_in_props_1.CallProps.hasAny(e) && built_in_props_1.CallProps.hasAll(e, props) && (excluding === undefined || !built_in_props_1.CallProps.hasAny(e, excluding)));
|
|
393
401
|
}
|
|
394
402
|
/**
|
|
395
403
|
* Every built-in that states its props but carries none of `props`. With {@link InputProps} this yields
|
|
@@ -53,12 +53,7 @@ function applyCdsToDefinitions(environments, name, type, definitions, nodeId, de
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
function addCds(target, cds) {
|
|
56
|
-
|
|
57
|
-
(0, info_1.appendCds)(target.cds, cds);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
target.cds = cds ? Array.from(cds) : [];
|
|
61
|
-
}
|
|
56
|
+
target.cds = (0, info_1.withCds)(target.cds, cds);
|
|
62
57
|
}
|
|
63
58
|
/**
|
|
64
59
|
* Marks the reference as maybe (i.e., as controlled by a set of {@link IdentifierReference#cds|control dependencies}).
|
|
@@ -20,7 +20,6 @@ const edge_1 = require("../graph/edge");
|
|
|
20
20
|
const assert_1 = require("../../util/assert");
|
|
21
21
|
const objects_1 = require("../../util/objects");
|
|
22
22
|
const vertex_1 = require("../graph/vertex");
|
|
23
|
-
const built_in_proc_name_1 = require("../environments/built-in-proc-name");
|
|
24
23
|
const node_value_1 = require("../eval/resolve/node-value");
|
|
25
24
|
const string_constants_1 = require("../eval/values/string/string-constants");
|
|
26
25
|
const r_value_1 = require("../eval/values/r-value");
|
|
@@ -253,18 +252,12 @@ function s3ClassOfValue(id, info) {
|
|
|
253
252
|
}
|
|
254
253
|
return undefined;
|
|
255
254
|
}
|
|
256
|
-
/** The value a plain assignment binds to the definition `def`, `undefined` for any other kind of definition (`class(x) <- `, `assign`, a parameter, ...). */
|
|
257
|
-
function assignedValueOf(def, graph) {
|
|
258
|
-
const vertex = graph.getVertex(def);
|
|
259
|
-
const byAssignment = df_helper_1.Dataflow.targetsOf(graph, def, edge_1.EdgeType.DefinedBy).some(t => vertex_1.DfgVertex.hasOrigin(graph.getVertex(t), built_in_proc_name_1.BuiltInProcName.Assignment));
|
|
260
|
-
return vertex_1.DfgVertex.isVariableDefinition(vertex) && byAssignment && vertex.source?.length === 1 ? vertex.source[0] : undefined;
|
|
261
|
-
}
|
|
262
255
|
/** The class vectors S3 dispatch may see for the argument at `id`, one per reaching definition, `undefined` unless all are known. */
|
|
263
256
|
function s3DispatchClassesOf(id, info) {
|
|
264
257
|
const { graph } = info;
|
|
265
258
|
const value = r_argument_1.RArgument.valueOf(info.idMap.get(id))?.info.id;
|
|
266
259
|
const isRead = value !== undefined && vertex_1.DfgVertex.isUse(graph.getVertex(value));
|
|
267
|
-
const values = isRead ? df_helper_1.Dataflow.targetsOf(graph, value, edge_1.EdgeType.Reads).map(def => assignedValueOf(def, graph)) : [value];
|
|
260
|
+
const values = isRead ? df_helper_1.Dataflow.targetsOf(graph, value, edge_1.EdgeType.Reads).map(def => df_helper_1.Dataflow.assignedValueOf(def, graph)) : [value];
|
|
268
261
|
const classes = values.map(v => v === undefined ? undefined : s3ClassOfValue(v, info));
|
|
269
262
|
return classes.length > 0 && classes.every(assert_1.isNotUndefined) ? classes : undefined;
|
|
270
263
|
}
|
|
@@ -34,7 +34,7 @@ export declare class DataflowGraphBuilder<Vertex extends DataflowGraphVertexInfo
|
|
|
34
34
|
}, info?: {
|
|
35
35
|
environment?: REnvironmentInformation;
|
|
36
36
|
builtInEnvironment?: IEnvironment;
|
|
37
|
-
cds?: ControlDependency[];
|
|
37
|
+
cds?: readonly ControlDependency[];
|
|
38
38
|
readParams?: [NodeId, boolean][];
|
|
39
39
|
mode?: DataflowGraphVertexFunctionDefinition['mode'];
|
|
40
40
|
}, asRoot?: boolean): this;
|
|
@@ -53,7 +53,7 @@ export declare class DataflowGraphBuilder<Vertex extends DataflowGraphVertexInfo
|
|
|
53
53
|
onlyBuiltIn?: boolean;
|
|
54
54
|
environment?: REnvironmentInformation;
|
|
55
55
|
builtInEnvironment?: IEnvironment;
|
|
56
|
-
cds?: ControlDependency[];
|
|
56
|
+
cds?: readonly ControlDependency[];
|
|
57
57
|
origin?: FunctionOriginInformation[];
|
|
58
58
|
link?: DataflowGraphVertexAstLink;
|
|
59
59
|
omitArgs?: boolean;
|
|
@@ -69,7 +69,7 @@ export declare class DataflowGraphBuilder<Vertex extends DataflowGraphVertexInfo
|
|
|
69
69
|
* (i.e., be a valid entry point), or is it nested (e.g., as part of a function definition)
|
|
70
70
|
*/
|
|
71
71
|
defineVariable(id: NodeId, name?: string, info?: {
|
|
72
|
-
cds?: ControlDependency[];
|
|
72
|
+
cds?: readonly ControlDependency[];
|
|
73
73
|
definedBy?: NodeId[];
|
|
74
74
|
}, asRoot?: boolean): this;
|
|
75
75
|
/**
|
|
@@ -89,7 +89,7 @@ export declare class DataflowGraphBuilder<Vertex extends DataflowGraphVertexInfo
|
|
|
89
89
|
* (i.e., be a valid entry point), or is it nested (e.g., as part of a function definition)
|
|
90
90
|
*/
|
|
91
91
|
constant(id: NodeId, options?: {
|
|
92
|
-
cds?: ControlDependency[];
|
|
92
|
+
cds?: readonly ControlDependency[];
|
|
93
93
|
}, asRoot?: boolean): this;
|
|
94
94
|
private edgeHelper;
|
|
95
95
|
/**
|
|
@@ -133,6 +133,8 @@ export declare const Dataflow: {
|
|
|
133
133
|
* @see {@link Dataflow.calleeIdsOf} - for what a single call calls
|
|
134
134
|
*/
|
|
135
135
|
readonly callsIn: (this: void, definition: DataflowGraphVertexFunctionDefinition, graph: DataflowGraph) => Generator<[NodeId, DataflowGraphVertexFunctionCall]>;
|
|
136
|
+
/** The value a plain assignment binds to the definition `def`, `undefined` for any other kind of definition (`class(x) <- `, `assign`, a parameter, ...). */
|
|
137
|
+
readonly assignedValueOf: (this: void, def: NodeId, graph: DataflowGraph) => NodeId | undefined;
|
|
136
138
|
/** Every variable definition of the graph by its unquoted name, in a single pass. */
|
|
137
139
|
readonly definitionsByName: (this: void, graph: DataflowGraph) => DefaultMap<string, NodeId[]>;
|
|
138
140
|
/**
|
|
@@ -10,6 +10,7 @@ const transitive_side_effects_1 = require("../internal/process/functions/call/bu
|
|
|
10
10
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
11
11
|
const vertex_1 = require("./vertex");
|
|
12
12
|
const identifier_1 = require("../environments/identifier");
|
|
13
|
+
const built_in_proc_name_1 = require("../environments/built-in-proc-name");
|
|
13
14
|
const r_base_packages_1 = require("../../util/r-base-packages");
|
|
14
15
|
const defaultmap_1 = require("../../util/collections/defaultmap");
|
|
15
16
|
const linker_1 = require("../internal/linker");
|
|
@@ -204,6 +205,12 @@ exports.Dataflow = {
|
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
},
|
|
208
|
+
/** The value a plain assignment binds to the definition `def`, `undefined` for any other kind of definition (`class(x) <- `, `assign`, a parameter, ...). */
|
|
209
|
+
assignedValueOf(def, graph) {
|
|
210
|
+
const vertex = graph.getVertex(def);
|
|
211
|
+
const byAssignment = exports.Dataflow.targetsOf(graph, def, edge_1.EdgeType.DefinedBy).some(t => vertex_1.DfgVertex.hasOrigin(graph.getVertex(t), built_in_proc_name_1.BuiltInProcName.Assignment));
|
|
212
|
+
return vertex_1.DfgVertex.isVariableDefinition(vertex) && byAssignment && vertex.source?.length === 1 ? vertex.source[0] : undefined;
|
|
213
|
+
},
|
|
207
214
|
/** Every variable definition of the graph by its unquoted name, in a single pass. */
|
|
208
215
|
definitionsByName(graph) {
|
|
209
216
|
const byName = new defaultmap_1.DefaultMap(() => []);
|
package/dataflow/graph/graph.js
CHANGED
|
@@ -608,17 +608,10 @@ class DataflowGraph {
|
|
|
608
608
|
to = node_id_1.NodeId.normalize(to);
|
|
609
609
|
const vertex = this.getVertex(from);
|
|
610
610
|
(0, assert_1.guard)(vertex !== undefined, () => `node must be defined for ${from} to add control dependency`);
|
|
611
|
-
if (vertex.cds) {
|
|
612
|
-
|
|
613
|
-
if (id === to && when !== cond) {
|
|
614
|
-
return this;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
vertex.cds = [];
|
|
611
|
+
if (vertex.cds?.some(c => c.id === to && c.when !== when)) {
|
|
612
|
+
return this;
|
|
620
613
|
}
|
|
621
|
-
vertex.cds.
|
|
614
|
+
vertex.cds = [...vertex.cds ?? [], { id: to, when }];
|
|
622
615
|
return this;
|
|
623
616
|
}
|
|
624
617
|
/** Marks the given node as having unknown side effects */
|
|
@@ -42,7 +42,7 @@ interface DataflowGraphVertexBase extends MergeableRecord {
|
|
|
42
42
|
/**
|
|
43
43
|
* @see {@link ControlDependency} - the collection of control dependencies which have an influence on whether the vertex is executed.
|
|
44
44
|
*/
|
|
45
|
-
cds: ControlDependency[] | undefined;
|
|
45
|
+
cds: readonly ControlDependency[] | undefined;
|
|
46
46
|
/**
|
|
47
47
|
* Describes the collection of AST vertices that contributed to this vertex.
|
|
48
48
|
* For example, this is useful with replacement operators, telling you which assignment operator caused them
|
package/dataflow/hooks.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface HookInformation {
|
|
|
13
13
|
/** The id of the function definition which is added by the hook */
|
|
14
14
|
id: NodeId;
|
|
15
15
|
/** Control dependencies under which the hook was registered */
|
|
16
|
-
cds?: ControlDependency[];
|
|
16
|
+
cds?: readonly ControlDependency[];
|
|
17
17
|
/** Whether the hook is added on top of existing ones (true) or replaces them (false) */
|
|
18
18
|
add?: boolean;
|
|
19
19
|
/** Whether the hook is executed after existing ones (true) or before (false) */
|
package/dataflow/info.d.ts
CHANGED
|
@@ -102,14 +102,14 @@ export interface ExitPoint {
|
|
|
102
102
|
* (e.g., if the `return` is contained within an `if` statement).
|
|
103
103
|
* @see {@link happensInEveryBranch} - to check whether control dependencies are exhaustive
|
|
104
104
|
*/
|
|
105
|
-
readonly cds?: ControlDependency[];
|
|
105
|
+
readonly cds?: readonly ControlDependency[];
|
|
106
106
|
}
|
|
107
107
|
/** `exit` leaving through the construct `rootId`, which keeps the jump it stands for. */
|
|
108
108
|
export declare function leaveThrough(exit: ExitPoint, rootId: NodeId): ExitPoint;
|
|
109
109
|
/**
|
|
110
110
|
* Adds all non-default exit points to the existing list and updates the `invertExitCds` accordingly.
|
|
111
111
|
*/
|
|
112
|
-
export declare function addNonDefaultExitPoints(existing: ExitPoint[], invertExitCds: ControlDependency[], activeCds: ControlDependency[] | undefined, add: readonly ExitPoint[]): void;
|
|
112
|
+
export declare function addNonDefaultExitPoints(existing: ExitPoint[], invertExitCds: ControlDependency[], activeCds: readonly ControlDependency[] | undefined, add: readonly ExitPoint[]): void;
|
|
113
113
|
/**
|
|
114
114
|
* Overwrites the existing exit points with the given ones, taking care of cds:
|
|
115
115
|
* the existing ones stay if the replacements only happen in some branches.
|
|
@@ -246,5 +246,5 @@ export declare function diffControlDependency<Report extends WriteableDifference
|
|
|
246
246
|
/**
|
|
247
247
|
* Calculates the difference between two lists of control dependencies.
|
|
248
248
|
*/
|
|
249
|
-
export declare function diffControlDependencies<Report extends WriteableDifferenceReport>(a: ControlDependency[] | undefined, b: ControlDependency[] | undefined, info: GenericDifferenceInformation<Report>): void;
|
|
249
|
+
export declare function diffControlDependencies<Report extends WriteableDifferenceReport>(a: readonly ControlDependency[] | undefined, b: readonly ControlDependency[] | undefined, info: GenericDifferenceInformation<Report>): void;
|
|
250
250
|
export {};
|
|
@@ -17,9 +17,9 @@ export declare function hidesBody(definition: IdentifierDefinition): boolean;
|
|
|
17
17
|
/** A call into code flowR cannot see may read any option, draw random numbers (with `draws` advancing the generator), and with `graphics` draw on the device. */
|
|
18
18
|
export declare function readsAllAmbientState<OtherInfo>(res: DataflowInformation, rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, graphics: boolean, draws?: boolean): DataflowInformation;
|
|
19
19
|
/** What an assignment writes beyond its target: only a global `.Random.seed` sets {@link AmbientStateName.rng}. */
|
|
20
|
-
export declare function ambientWritesOfAssignment(environment: REnvironmentInformation, target: Identifier, rootId: NodeId, cds: ControlDependency[] | undefined, global: boolean): REnvironmentInformation;
|
|
20
|
+
export declare function ambientWritesOfAssignment(environment: REnvironmentInformation, target: Identifier, rootId: NodeId, cds: readonly ControlDependency[] | undefined, global: boolean): REnvironmentInformation;
|
|
21
21
|
/** Rebinding or removing the names (all of them if `undefined`) may release an object a finalizer is registered for. */
|
|
22
|
-
export declare function ambientWritesOfRelease(environment: REnvironmentInformation, names: readonly Identifier[] | undefined, rootId: NodeId, cds: ControlDependency[] | undefined): REnvironmentInformation;
|
|
22
|
+
export declare function ambientWritesOfRelease(environment: REnvironmentInformation, names: readonly Identifier[] | undefined, rootId: NodeId, cds: readonly ControlDependency[] | undefined): REnvironmentInformation;
|
|
23
23
|
/** Ambient writes stay out of `out` (see {@link withAccess}), so a part that only maybe runs marks its writes as maybe in `target` here. */
|
|
24
24
|
export declare function makeAmbientWritesMaybe(after: REnvironmentInformation, before: REnvironmentInformation, target: REnvironmentInformation, cds: readonly ControlDependency[]): void;
|
|
25
25
|
/** The states written in `after` that `before` does not hold, as by a promise (`delayedAssign`) whose writes only happen once a read forces it. */
|
|
@@ -39,7 +39,7 @@ interface AttachSpec {
|
|
|
39
39
|
*/
|
|
40
40
|
export declare function processLibrary<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config?: LibraryProcessorConfig): DataflowInformation;
|
|
41
41
|
/** Materialize the empty built-in function-definition vertex for a package export (idempotent). */
|
|
42
|
-
export declare function attachExportVertex(graph: DataflowGraph, builtInId: NodeId, environment: REnvironmentInformation, ctx: FlowrAnalyzerContext, cds?: ControlDependency[]): void;
|
|
42
|
+
export declare function attachExportVertex(graph: DataflowGraph, builtInId: NodeId, environment: REnvironmentInformation, ctx: FlowrAnalyzerContext, cds?: readonly ControlDependency[]): void;
|
|
43
43
|
/**
|
|
44
44
|
* The load calls (`library()`/`require()`) that brought package `pack` into scope without a database, collected from
|
|
45
45
|
* the {@link libraryLoadMarker} of every matching {@link EnvType.LoadedNamespace} layer below the global environment.
|
|
@@ -353,12 +353,6 @@ function constrainExitPoints(exitPoints, constrain) {
|
|
|
353
353
|
return exitPoints;
|
|
354
354
|
}
|
|
355
355
|
const cds = Array.from(constrain, id => ({ id, when: true }));
|
|
356
|
-
return exitPoints.map(e => {
|
|
357
|
-
if (e.cds) {
|
|
358
|
-
e.cds.push(...cds);
|
|
359
|
-
return e;
|
|
360
|
-
}
|
|
361
|
-
return { ...e, cds };
|
|
362
|
-
});
|
|
356
|
+
return exitPoints.map(e => ({ ...e, cds: e.cds ? [...e.cds, ...cds] : cds }));
|
|
363
357
|
}
|
|
364
358
|
//# sourceMappingURL=built-in-try-catch.js.map
|
package/dataflow/processor.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface DataflowProcessorInformation<OtherInfo> {
|
|
|
33
33
|
/**
|
|
34
34
|
* The chain of control-flow {@link NodeId}s that lead to the current node (e.g., of known ifs).
|
|
35
35
|
*/
|
|
36
|
-
readonly cds: ControlDependency[] | undefined;
|
|
36
|
+
readonly cds: readonly ControlDependency[] | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* The flowr context used for environment seeding, files, and precision control, ...
|
|
39
39
|
*/
|
|
@@ -252,6 +252,35 @@ function(x) {
|
|
|
252
252
|
'package-runtime': {
|
|
253
253
|
configType: 'PackageRuntimeConfig', ruleType: 'PACKAGE_RUNTIME', testfile: 'cmd-check/lint-package-runtime',
|
|
254
254
|
example: { code: 'f <- function() 1', files: { DESCRIPTION: ExampleDescription, 'NAMESPACE': 'export(f)\nexport(g)\nexportPattern("^api_")\n' } }
|
|
255
|
+
},
|
|
256
|
+
'secret-exfiltration': {
|
|
257
|
+
configType: 'SecretExfiltrationConfig', ruleType: 'SECRET_EXFILTRATION', testfile: 'lint-secret-exfiltration',
|
|
258
|
+
example: `
|
|
259
|
+
key <- Sys.getenv("API_KEY")
|
|
260
|
+
server <- function(input, output, session) {
|
|
261
|
+
httr2::request("https://api.example.org") |>
|
|
262
|
+
httr2::req_auth_bearer_token(key)
|
|
263
|
+
httr::GET(input$url, httr::add_headers(Authorization = key))
|
|
264
|
+
output$debug <- renderPrint(Sys.getenv())
|
|
265
|
+
message("calling with ", key)
|
|
266
|
+
message("key set: ", nzchar(key))
|
|
267
|
+
httr::GET(paste0("https://api.example.org/?key=", key))
|
|
268
|
+
}
|
|
269
|
+
`,
|
|
270
|
+
config: { optIn: ['url'] }
|
|
271
|
+
},
|
|
272
|
+
'process-state-in-session': {
|
|
273
|
+
configType: 'ProcessStateInSessionConfig', ruleType: 'PROCESS_STATE_IN_SESSION', testfile: 'lint-process-state-in-session',
|
|
274
|
+
example: `
|
|
275
|
+
counter <- reactiveVal(0)
|
|
276
|
+
addResourcePath("data", "/srv/data")
|
|
277
|
+
server <- function(input, output, session) {
|
|
278
|
+
user <<- input$name
|
|
279
|
+
options(digits = input$digits)
|
|
280
|
+
counter(counter() + 1)
|
|
281
|
+
output$plot <- renderPlot(plot(load_for(session$user, input$n))) |> bindCache(input$n)
|
|
282
|
+
}
|
|
283
|
+
`
|
|
255
284
|
}
|
|
256
285
|
};
|
|
257
286
|
/** the kinds of issue a rule finds, each rule carries at most one */
|
|
@@ -382,7 +382,7 @@ enables quick statistics after each REPL command. Likewise, ${ctx.linkConfig('re
|
|
|
382
382
|
const inference = 'df-shape';
|
|
383
383
|
const exampleCode = 'df <- data.frame(id = 1:3) |>\n filter(df, FALSE)';
|
|
384
384
|
return `
|
|
385
|
-
This query infers all shapes of dataframes within the code using abstract
|
|
385
|
+
This query infers all shapes of dataframes within the code using abstract interpretation. For example, you can use:
|
|
386
386
|
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{ type: 'absint', inference: inference }], { showCode: true, collapseQuery: true, ctx })}
|
|
387
387
|
|
|
388
388
|
The query optionally also accepts slice criteria to narrow the results to specific nodes. For example:
|
|
@@ -390,6 +390,25 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{ type: 'absint', infere
|
|
|
390
390
|
`;
|
|
391
391
|
}
|
|
392
392
|
});
|
|
393
|
+
(0, doc_query_1.registerQueryDocumentation)('taint', {
|
|
394
|
+
type: 'active',
|
|
395
|
+
shortDescription: 'Returns the taint values inferred for every expression.',
|
|
396
|
+
buildExplanation: async (shell, ctx) => {
|
|
397
|
+
const defs = ['normalization-constant'];
|
|
398
|
+
const exampleCode = `
|
|
399
|
+
x <- c(1 , 2 , 3 , 4 , 5)\n
|
|
400
|
+
y <- scale(x)\n
|
|
401
|
+
z <- mean(y)`;
|
|
402
|
+
return `
|
|
403
|
+
This query infers all taints for one or multiple analysis definitions within the code using taint analysis.
|
|
404
|
+
For example, you can use the following query to get the results of the normalization analysis:
|
|
405
|
+
${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
406
|
+
type: 'taint',
|
|
407
|
+
defs: defs
|
|
408
|
+
}], { showCode: true, collapseQuery: true, ctx })}
|
|
409
|
+
`;
|
|
410
|
+
}
|
|
411
|
+
});
|
|
393
412
|
(0, doc_query_1.registerQueryDocumentation)('compound', {
|
|
394
413
|
name: 'Compound Query',
|
|
395
414
|
type: 'virtual',
|