@eagleoutice/flowr 2.5.0 → 2.6.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 +57 -42
- package/cli/flowr.js +3 -29
- package/cli/repl/commands/repl-cfg.d.ts +5 -5
- package/cli/repl/commands/repl-cfg.js +21 -22
- package/cli/repl/commands/repl-commands.d.ts +3 -3
- package/cli/repl/commands/repl-commands.js +2 -0
- package/cli/repl/commands/repl-dataflow.d.ts +5 -5
- package/cli/repl/commands/repl-dataflow.js +27 -30
- package/cli/repl/commands/repl-execute.js +1 -0
- package/cli/repl/commands/repl-lineage.js +1 -0
- package/cli/repl/commands/repl-main.d.ts +34 -3
- package/cli/repl/commands/repl-normalize.d.ts +3 -3
- package/cli/repl/commands/repl-normalize.js +15 -19
- package/cli/repl/commands/repl-parse.d.ts +2 -2
- package/cli/repl/commands/repl-parse.js +13 -8
- package/cli/repl/commands/repl-query.d.ts +3 -3
- package/cli/repl/commands/repl-query.js +29 -19
- package/cli/repl/commands/repl-quit.js +1 -0
- package/cli/repl/commands/repl-version.js +1 -0
- package/cli/repl/core.d.ts +4 -1
- package/cli/repl/core.js +21 -1
- package/cli/repl/server/connection.d.ts +7 -3
- package/cli/repl/server/connection.js +40 -48
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/slicer-app.js +1 -1
- package/config.d.ts +1 -1
- package/config.js +4 -1
- package/control-flow/extract-cfg.d.ts +1 -1
- package/control-flow/extract-cfg.js +1 -1
- package/core/pipeline-executor.d.ts +5 -0
- package/core/pipeline-executor.js +5 -0
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/core/steps/pipeline/default-pipelines.d.ts +42 -42
- package/core/steps/pipeline/default-pipelines.js +4 -1
- package/dataflow/graph/dataflowgraph-builder.d.ts +11 -12
- package/dataflow/graph/dataflowgraph-builder.js +6 -6
- package/documentation/doc-util/doc-query.d.ts +3 -6
- package/documentation/doc-util/doc-query.js +5 -17
- package/documentation/doc-util/doc-search.js +7 -10
- package/documentation/doc-util/doc-structure.d.ts +4 -0
- package/documentation/doc-util/doc-structure.js +28 -0
- package/documentation/doc-util/doc-types.d.ts +5 -1
- package/documentation/doc-util/doc-types.js +29 -3
- package/documentation/print-analyzer-wiki.d.ts +1 -0
- package/documentation/print-analyzer-wiki.js +137 -0
- package/documentation/print-core-wiki.d.ts +2 -1
- package/documentation/print-core-wiki.js +58 -4
- package/documentation/print-dataflow-graph-wiki.js +15 -22
- package/documentation/print-interface-wiki.js +18 -1
- package/documentation/print-linter-wiki.js +5 -1
- package/documentation/print-normalized-ast-wiki.js +6 -8
- package/engines.d.ts +9 -0
- package/engines.js +38 -0
- package/linter/linter-executor.d.ts +2 -8
- package/linter/linter-executor.js +9 -4
- package/linter/linter-format.d.ts +8 -9
- package/linter/linter-rules.d.ts +57 -15
- package/linter/linter-rules.js +2 -0
- package/linter/rules/absolute-path.d.ts +1 -0
- package/linter/rules/dataframe-access-validation.d.ts +4 -3
- package/linter/rules/dataframe-access-validation.js +7 -4
- package/linter/rules/dead-code.d.ts +2 -1
- package/linter/rules/deprecated-functions.d.ts +15 -28
- package/linter/rules/deprecated-functions.js +5 -43
- package/linter/rules/file-path-validity.d.ts +2 -1
- package/linter/rules/file-path-validity.js +1 -1
- package/linter/rules/function-finder-util.d.ts +51 -0
- package/linter/rules/function-finder-util.js +77 -0
- package/linter/rules/naming-convention.d.ts +2 -1
- package/linter/rules/network-functions.d.ts +40 -0
- package/linter/rules/network-functions.js +24 -0
- package/linter/rules/seeded-randomness.d.ts +2 -1
- package/linter/rules/unused-definition.d.ts +2 -1
- package/linter/rules/useless-loop.d.ts +3 -2
- package/linter/rules/useless-loop.js +4 -6
- package/package.json +2 -1
- package/project/cache/flowr-analyzer-cache.d.ts +93 -0
- package/project/cache/flowr-analyzer-cache.js +156 -0
- package/project/cache/flowr-cache.d.ts +28 -0
- package/project/cache/flowr-cache.js +49 -0
- package/project/context/abstract-flowr-analyzer-context.d.ts +35 -0
- package/project/context/abstract-flowr-analyzer-context.js +46 -0
- package/project/context/flowr-analyzer-context.d.ts +48 -0
- package/project/context/flowr-analyzer-context.js +47 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +38 -0
- package/project/context/flowr-analyzer-dependencies-context.js +39 -0
- package/project/context/flowr-analyzer-files-context.d.ts +86 -0
- package/project/context/flowr-analyzer-files-context.js +130 -0
- package/project/context/flowr-analyzer-loading-order-context.d.ts +76 -0
- package/project/context/flowr-analyzer-loading-order-context.js +90 -0
- package/project/context/flowr-file.d.ts +89 -0
- package/project/context/flowr-file.js +78 -0
- package/project/flowr-analyzer-builder.d.ts +106 -0
- package/project/flowr-analyzer-builder.js +197 -0
- package/project/flowr-analyzer.d.ts +125 -0
- package/project/flowr-analyzer.js +81 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +17 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +28 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +21 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +34 -0
- package/project/plugins/file-plugins/flowr-description-file.d.ts +24 -0
- package/project/plugins/file-plugins/flowr-description-file.js +38 -0
- package/project/plugins/flowr-analyzer-plugin.d.ts +90 -0
- package/project/plugins/flowr-analyzer-plugin.js +82 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +14 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +56 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.d.ts +13 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +14 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +41 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +29 -0
- package/project/plugins/package-version-plugins/package.d.ts +15 -0
- package/project/plugins/package-version-plugins/package.js +56 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +15 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +44 -0
- package/queries/base-query-format.d.ts +2 -8
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +20 -13
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -3
- package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-executor.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -54
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
- package/queries/catalog/config-query/config-query-executor.js +5 -5
- package/queries/catalog/config-query/config-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-format.js +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -3
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -54
- package/queries/catalog/control-flow-query/control-flow-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -54
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -54
- package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +19 -12
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +7 -56
- package/queries/catalog/dependencies-query/dependencies-query-format.js +7 -4
- package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +4 -4
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -54
- package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -54
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -1
- package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-executor.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -54
- package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
- package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-executor.js +2 -2
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -54
- package/queries/catalog/lineage-query/lineage-query-format.js +1 -1
- package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-executor.js +2 -3
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -54
- package/queries/catalog/linter-query/linter-query-format.js +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.js +3 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -54
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -1
- package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -54
- package/queries/catalog/origin-query/origin-query-format.js +1 -1
- package/queries/catalog/project-query/project-query-executor.d.ts +1 -1
- package/queries/catalog/project-query/project-query-executor.js +2 -2
- package/queries/catalog/project-query/project-query-format.d.ts +1 -54
- package/queries/catalog/project-query/project-query-format.js +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -54
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
- package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
- package/queries/catalog/search-query/search-query-executor.js +3 -3
- package/queries/catalog/search-query/search-query-format.d.ts +1 -54
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -54
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -1
- package/queries/query-print.d.ts +4 -4
- package/queries/query-print.js +12 -12
- package/queries/query.d.ts +29 -885
- package/queries/query.js +1 -1
- package/r-bridge/retriever.d.ts +6 -5
- package/r-bridge/retriever.js +9 -5
- package/search/flowr-search-executor.d.ts +3 -5
- package/search/flowr-search-executor.js +6 -4
- package/search/flowr-search-filters.d.ts +12 -6
- package/search/flowr-search-filters.js +1 -1
- package/search/flowr-search.d.ts +5 -16
- package/search/flowr-search.js +14 -5
- package/search/search-executor/search-enrichers.d.ts +37 -36
- package/search/search-executor/search-enrichers.js +4 -4
- package/search/search-executor/search-generators.d.ts +12 -12
- package/search/search-executor/search-generators.js +27 -19
- package/search/search-executor/search-mappers.d.ts +5 -5
- package/search/search-executor/search-transformer.d.ts +17 -17
- package/search/search-executor/search-transformer.js +14 -7
- package/util/collections/arrays.d.ts +1 -0
- package/util/collections/arrays.js +15 -0
- package/util/collections/objectmap.d.ts +17 -0
- package/util/collections/objectmap.js +28 -0
- package/util/containers.d.ts +0 -1
- package/util/containers.js +0 -1
- package/util/files.d.ts +17 -0
- package/util/files.js +65 -0
- package/util/formats/adapter.d.ts +4 -2
- package/util/formats/adapter.js +11 -4
- package/util/version.js +1 -1
package/linter/linter-rules.d.ts
CHANGED
|
@@ -5,18 +5,22 @@ import type { LintingRule } from './linter-format';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const LintingRules: {
|
|
7
7
|
readonly 'deprecated-functions': {
|
|
8
|
-
readonly createSearch: (config: import("./rules/
|
|
9
|
-
readonly processSearchResult:
|
|
8
|
+
readonly createSearch: (config: import("./rules/function-finder-util").FunctionsToDetectConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with", "filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
9
|
+
readonly processSearchResult: <T extends import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>(elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, T>, _config: import("./rules/function-finder-util").FunctionsToDetectConfig, _data: {
|
|
10
|
+
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
11
|
+
dataflow: import("../dataflow/info").DataflowInformation;
|
|
12
|
+
config: import("../config").FlowrConfigOptions;
|
|
13
|
+
}, refineSearch?: (elements: T) => T) => {
|
|
10
14
|
results: {
|
|
11
|
-
certainty: import("./linter-format").LintingResultCertainty
|
|
15
|
+
certainty: import("./linter-format").LintingResultCertainty;
|
|
12
16
|
function: import("../dataflow/environments/identifier").Identifier;
|
|
13
17
|
range: import("../util/range").SourceRange;
|
|
14
18
|
}[];
|
|
15
|
-
'.meta': import("./rules/
|
|
19
|
+
'.meta': import("./rules/function-finder-util").FunctionsMetadata;
|
|
16
20
|
};
|
|
17
21
|
readonly prettyPrint: {
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
query: (result: import("./rules/function-finder-util").FunctionsResult) => string;
|
|
23
|
+
full: (result: import("./rules/function-finder-util").FunctionsResult) => string;
|
|
20
24
|
};
|
|
21
25
|
readonly info: {
|
|
22
26
|
readonly name: "Deprecated Functions";
|
|
@@ -24,15 +28,16 @@ export declare const LintingRules: {
|
|
|
24
28
|
readonly certainty: import("./linter-format").LintingRuleCertainty.BestEffort;
|
|
25
29
|
readonly description: "Marks deprecated functions that should not be used anymore.";
|
|
26
30
|
readonly defaultConfig: {
|
|
27
|
-
readonly
|
|
31
|
+
readonly fns: readonly ["all_equal", "arrange_all", "distinct_all", "filter_all", "group_by_all", "summarise_all", "mutate_all", "select_all", "vars", "all_vars", "id", "failwith", "select_vars", "rename_vars", "select_var", "current_vars", "bench_tbls", "compare_tbls", "compare_tbls2", "eval_tbls", "eval_tbls2", "location", "changes", "combine", "do", "funs", "add_count_", "add_tally_", "arrange_", "count_", "distinct_", "do_", "filter_", "funs_", "group_by_", "group_indices_", "mutate_", "tally_", "transmute_", "rename_", "rename_vars_", "select_", "select_vars_", "slice_", "summarise_", "summarize_", "summarise_each", "src_local", "tbl_df", "add_rownames", "group_nest", "group_split", "with_groups", "nest_by", "progress_estimated", "recode", "sample_n", "top_n", "transmute", "fct_explicit_na", "aes_", "aes_auto", "annotation_logticks", "is.Coord", "coord_flip", "coord_map", "is.facet", "fortify", "is.ggproto", "guide_train", "is.ggplot", "qplot", "is.theme", "gg_dep", "liply", "isplit2", "list_along", "cross", "invoke", "at_depth", "prepend", "rerun", "splice", "`%@%`", "rbernoulli", "rdunif", "when", "update_list", "map_raw", "accumulate", "reduce_right", "flatten", "map_dfr", "as_vector", "transpose", "melt_delim", "melt_fwf", "melt_table", "read_table2", "str_interp", "as_tibble", "data_frame", "tibble_", "data_frame_", "lst_", "as_data_frame", "as.tibble", "frame_data", "trunc_mat", "is.tibble", "tidy_names", "set_tidy_names", "repair_names", "extract_numeric", "complete_", "drop_na_", "expand_", "crossing_", "nesting_", "extract_", "fill_", "gather_", "nest_", "separate_rows_", "separate_", "spread_", "unite_", "unnest_", "extract", "gather", "nest_legacy", "separate_rows", "separate", "spread"];
|
|
28
32
|
};
|
|
29
33
|
};
|
|
30
34
|
};
|
|
31
35
|
readonly 'file-path-validity': {
|
|
32
|
-
readonly createSearch: (config: import("./rules/file-path-validity").FilePathValidityConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"from-query", ["with"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]
|
|
36
|
+
readonly createSearch: (config: import("./rules/file-path-validity").FilePathValidityConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"from-query", ["with"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
33
37
|
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("./rules/file-path-validity").FilePathValidityConfig, data: {
|
|
34
38
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
35
39
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
40
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
36
41
|
config: import("../config").FlowrConfigOptions;
|
|
37
42
|
}) => {
|
|
38
43
|
results: import("./rules/file-path-validity").FilePathValidityResult[];
|
|
@@ -55,10 +60,11 @@ export declare const LintingRules: {
|
|
|
55
60
|
};
|
|
56
61
|
};
|
|
57
62
|
readonly 'seeded-randomness': {
|
|
58
|
-
readonly createSearch: (config: import("./rules/seeded-randomness").SeededRandomnessConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with", "filter", "with"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]
|
|
63
|
+
readonly createSearch: (config: import("./rules/seeded-randomness").SeededRandomnessConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with", "filter", "with"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
59
64
|
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("./rules/seeded-randomness").SeededRandomnessConfig, { dataflow }: {
|
|
60
65
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
61
66
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
67
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
62
68
|
config: import("../config").FlowrConfigOptions;
|
|
63
69
|
}) => {
|
|
64
70
|
results: {
|
|
@@ -94,6 +100,7 @@ export declare const LintingRules: {
|
|
|
94
100
|
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("./rules/absolute-path").AbsoluteFilePathConfig, data: {
|
|
95
101
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
96
102
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
103
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
97
104
|
config: import("../config").FlowrConfigOptions;
|
|
98
105
|
}) => {
|
|
99
106
|
results: import("./rules/absolute-path").AbsoluteFilePathResult[];
|
|
@@ -120,10 +127,11 @@ export declare const LintingRules: {
|
|
|
120
127
|
};
|
|
121
128
|
};
|
|
122
129
|
readonly 'unused-definitions': {
|
|
123
|
-
readonly createSearch: (config: import("./rules/unused-definition").UnusedDefinitionConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]
|
|
130
|
+
readonly createSearch: (config: import("./rules/unused-definition").UnusedDefinitionConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
124
131
|
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("./rules/unused-definition").UnusedDefinitionConfig, data: {
|
|
125
132
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
126
133
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
134
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
127
135
|
config: import("../config").FlowrConfigOptions;
|
|
128
136
|
}) => {
|
|
129
137
|
results: import("./rules/unused-definition").UnusedDefinitionResult[];
|
|
@@ -144,10 +152,11 @@ export declare const LintingRules: {
|
|
|
144
152
|
};
|
|
145
153
|
};
|
|
146
154
|
readonly 'naming-convention': {
|
|
147
|
-
readonly createSearch: (_config: import("./rules/naming-convention").NamingConventionConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]
|
|
155
|
+
readonly createSearch: (_config: import("./rules/naming-convention").NamingConventionConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
148
156
|
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("./rules/naming-convention").NamingConventionConfig, data: {
|
|
149
157
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
150
158
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
159
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
151
160
|
config: import("../config").FlowrConfigOptions;
|
|
152
161
|
}) => {
|
|
153
162
|
results: {
|
|
@@ -177,11 +186,42 @@ export declare const LintingRules: {
|
|
|
177
186
|
};
|
|
178
187
|
};
|
|
179
188
|
};
|
|
189
|
+
readonly 'network-functions': {
|
|
190
|
+
readonly createSearch: (config: import("./rules/network-functions").NetworkFunctionsConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with", "filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
191
|
+
readonly processSearchResult: (e: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, c: import("./rules/network-functions").NetworkFunctionsConfig, d: {
|
|
192
|
+
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
193
|
+
dataflow: import("../dataflow/info").DataflowInformation;
|
|
194
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
195
|
+
config: import("../config").FlowrConfigOptions;
|
|
196
|
+
}) => {
|
|
197
|
+
results: {
|
|
198
|
+
certainty: import("./linter-format").LintingResultCertainty;
|
|
199
|
+
function: import("../dataflow/environments/identifier").Identifier;
|
|
200
|
+
range: import("../util/range").SourceRange;
|
|
201
|
+
}[];
|
|
202
|
+
'.meta': import("./rules/function-finder-util").FunctionsMetadata;
|
|
203
|
+
};
|
|
204
|
+
readonly prettyPrint: {
|
|
205
|
+
query: (result: import("./rules/function-finder-util").FunctionsResult) => string;
|
|
206
|
+
full: (result: import("./rules/function-finder-util").FunctionsResult) => string;
|
|
207
|
+
};
|
|
208
|
+
readonly info: {
|
|
209
|
+
readonly name: "Network Functions";
|
|
210
|
+
readonly tags: readonly [import("./linter-tags").LintingRuleTag.Reproducibility, import("./linter-tags").LintingRuleTag.Security, import("./linter-tags").LintingRuleTag.Performance, import("./linter-tags").LintingRuleTag.Smell];
|
|
211
|
+
readonly certainty: import("./linter-format").LintingRuleCertainty.BestEffort;
|
|
212
|
+
readonly description: "Marks network functions that execute network operations, such as downloading files or making HTTP requests.";
|
|
213
|
+
readonly defaultConfig: {
|
|
214
|
+
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", "source", "load", "curl_download", "curl_fetch_memory", "getURL", "getForm", "read_html", "html_nodes", "html_text", "fromJSON", "read.xlsx", "drive_download", "drive_get", "s3read_using", "s3write_using", "storage_download", "AnnotationHub", "ExperimentHub"];
|
|
215
|
+
readonly onlyTriggerWithArgument: RegExp;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
180
219
|
readonly 'dataframe-access-validation': {
|
|
181
|
-
readonly createSearch: () => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]
|
|
220
|
+
readonly createSearch: () => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
182
221
|
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("./rules/dataframe-access-validation").DataFrameAccessValidationConfig, data: {
|
|
183
222
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
184
223
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
224
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
185
225
|
config: import("../config").FlowrConfigOptions;
|
|
186
226
|
}) => {
|
|
187
227
|
results: import("./rules/dataframe-access-validation").DataFrameAccessValidationResult[];
|
|
@@ -202,10 +242,11 @@ export declare const LintingRules: {
|
|
|
202
242
|
};
|
|
203
243
|
};
|
|
204
244
|
readonly 'dead-code': {
|
|
205
|
-
readonly createSearch: (config: import("./rules/dead-code").DeadCodeConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]
|
|
245
|
+
readonly createSearch: (config: import("./rules/dead-code").DeadCodeConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
206
246
|
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: import("./rules/dead-code").DeadCodeConfig, _data: {
|
|
207
247
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
208
248
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
249
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
209
250
|
config: import("../config").FlowrConfigOptions;
|
|
210
251
|
}) => {
|
|
211
252
|
results: {
|
|
@@ -227,10 +268,11 @@ export declare const LintingRules: {
|
|
|
227
268
|
};
|
|
228
269
|
};
|
|
229
270
|
readonly 'useless-loop': {
|
|
230
|
-
readonly createSearch: () => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]
|
|
231
|
-
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>,
|
|
271
|
+
readonly createSearch: () => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
272
|
+
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, useLessLoopConfig: import("./rules/useless-loop").UselessLoopConfig, { config, dataflow, normalize, cfg }: {
|
|
232
273
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
233
274
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
275
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
234
276
|
config: import("../config").FlowrConfigOptions;
|
|
235
277
|
}) => {
|
|
236
278
|
results: {
|
package/linter/linter-rules.js
CHANGED
|
@@ -10,6 +10,7 @@ const seeded_randomness_1 = require("./rules/seeded-randomness");
|
|
|
10
10
|
const naming_convention_1 = require("./rules/naming-convention");
|
|
11
11
|
const dataframe_access_validation_1 = require("./rules/dataframe-access-validation");
|
|
12
12
|
const useless_loop_1 = require("./rules/useless-loop");
|
|
13
|
+
const network_functions_1 = require("./rules/network-functions");
|
|
13
14
|
/**
|
|
14
15
|
* The registry of currently supported linting rules.
|
|
15
16
|
* A linting rule can be executed on a dataflow pipeline result using {@link executeLintingRule}.
|
|
@@ -21,6 +22,7 @@ exports.LintingRules = {
|
|
|
21
22
|
'absolute-file-paths': absolute_path_1.ABSOLUTE_PATH,
|
|
22
23
|
'unused-definitions': unused_definition_1.UNUSED_DEFINITION,
|
|
23
24
|
'naming-convention': naming_convention_1.NAMING_CONVENTION,
|
|
25
|
+
'network-functions': network_functions_1.NETWORK_FUNCTIONS,
|
|
24
26
|
'dataframe-access-validation': dataframe_access_validation_1.DATA_FRAME_ACCESS_VALIDATION,
|
|
25
27
|
'dead-code': dead_code_1.DEAD_CODE,
|
|
26
28
|
'useless-loop': useless_loop_1.USELESS_LOOP
|
|
@@ -40,6 +40,7 @@ export declare const ABSOLUTE_PATH: {
|
|
|
40
40
|
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: AbsoluteFilePathConfig, data: {
|
|
41
41
|
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
42
42
|
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
43
|
+
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
43
44
|
config: FlowrConfigOptions;
|
|
44
45
|
}) => {
|
|
45
46
|
results: AbsoluteFilePathResult[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
1
|
+
import type { NormalizedAst, ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
2
2
|
import type { FlowrSearchElements } from '../../search/flowr-search';
|
|
3
3
|
import { type MergeableRecord } from '../../util/objects';
|
|
4
4
|
import { type SourceRange } from '../../util/range';
|
|
@@ -30,10 +30,11 @@ export interface DataFrameAccessValidationMetadata extends MergeableRecord {
|
|
|
30
30
|
totalAccessed: number;
|
|
31
31
|
}
|
|
32
32
|
export declare const DATA_FRAME_ACCESS_VALIDATION: {
|
|
33
|
-
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with"], ParentInformation, FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]
|
|
33
|
+
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with"], ParentInformation, Promise<FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>>>;
|
|
34
34
|
readonly processSearchResult: (elements: FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>, config: DataFrameAccessValidationConfig, data: {
|
|
35
|
-
normalize:
|
|
35
|
+
normalize: NormalizedAst;
|
|
36
36
|
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
37
|
+
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
37
38
|
config: import("../../config").FlowrConfigOptions;
|
|
38
39
|
}) => {
|
|
39
40
|
results: DataFrameAccessValidationResult[];
|
|
@@ -24,7 +24,7 @@ exports.DATA_FRAME_ACCESS_VALIDATION = {
|
|
|
24
24
|
});
|
|
25
25
|
const cfg = (0, extract_cfg_1.extractCfg)(data.normalize, flowrConfig, data.dataflow.graph);
|
|
26
26
|
(0, shape_inference_1.inferDataFrameShapes)(cfg, data.dataflow.graph, data.normalize, flowrConfig);
|
|
27
|
-
const accessOperations = getAccessOperations(elements);
|
|
27
|
+
const accessOperations = getAccessOperations(elements, data.normalize);
|
|
28
28
|
const accesses = [];
|
|
29
29
|
for (const [nodeId, operations] of accessOperations) {
|
|
30
30
|
const access = { nodeId };
|
|
@@ -84,9 +84,12 @@ exports.DATA_FRAME_ACCESS_VALIDATION = {
|
|
|
84
84
|
defaultConfig: { readLoadedData: false }
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
function getAccessOperations(elements) {
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
function getAccessOperations(elements, normalize) {
|
|
88
|
+
const nodes = elements.getElements().map(element => {
|
|
89
|
+
const id = element.node.info.id;
|
|
90
|
+
return normalize.idMap.get(id);
|
|
91
|
+
}).filter(n => n !== undefined);
|
|
92
|
+
return new Map(nodes
|
|
90
93
|
.filter(absint_info_1.hasDataFrameExpressionInfo)
|
|
91
94
|
.map(node => [node.info.id, node.info.dataFrame.operations
|
|
92
95
|
.filter(({ operation }) => operation === 'accessCols' || operation === 'accessRows')
|
|
@@ -17,10 +17,11 @@ export interface DeadCodeMetadata extends MergeableRecord {
|
|
|
17
17
|
consideredNodes: number;
|
|
18
18
|
}
|
|
19
19
|
export declare const DEAD_CODE: {
|
|
20
|
-
readonly createSearch: (config: DeadCodeConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with"], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]
|
|
20
|
+
readonly createSearch: (config: DeadCodeConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with"], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
21
21
|
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: DeadCodeConfig, _data: {
|
|
22
22
|
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
23
23
|
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
24
|
+
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
24
25
|
config: import("../../config").FlowrConfigOptions;
|
|
25
26
|
}) => {
|
|
26
27
|
results: {
|
|
@@ -1,36 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LintingResultCertainty, LintingRuleCertainty } from '../linter-format';
|
|
3
|
-
import type { MergeableRecord } from '../../util/objects';
|
|
4
|
-
import type { SourceRange } from '../../util/range';
|
|
5
|
-
import type { Identifier } from '../../dataflow/environments/identifier';
|
|
1
|
+
import { LintingRuleCertainty } from '../linter-format';
|
|
6
2
|
import { LintingRuleTag } from '../linter-tags';
|
|
7
|
-
|
|
8
|
-
function: string;
|
|
9
|
-
range: SourceRange;
|
|
10
|
-
}
|
|
11
|
-
export interface DeprecatedFunctionsConfig extends MergeableRecord {
|
|
12
|
-
/**
|
|
13
|
-
* The list of function names that should be marked as deprecated.
|
|
14
|
-
*/
|
|
15
|
-
deprecatedFunctions: string[];
|
|
16
|
-
}
|
|
17
|
-
export interface DeprecatedFunctionsMetadata extends MergeableRecord {
|
|
18
|
-
totalDeprecatedCalls: number;
|
|
19
|
-
totalDeprecatedFunctionDefinitions: number;
|
|
20
|
-
}
|
|
3
|
+
import type { FunctionsMetadata, FunctionsResult, FunctionsToDetectConfig } from './function-finder-util';
|
|
21
4
|
export declare const DEPRECATED_FUNCTIONS: {
|
|
22
|
-
readonly createSearch: (config:
|
|
23
|
-
readonly processSearchResult:
|
|
5
|
+
readonly createSearch: (config: FunctionsToDetectConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with", "filter"], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
6
|
+
readonly processSearchResult: <T extends import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>(elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, T>, _config: FunctionsToDetectConfig, _data: {
|
|
7
|
+
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
8
|
+
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
9
|
+
config: import("../../config").FlowrConfigOptions;
|
|
10
|
+
}, refineSearch?: (elements: T) => T) => {
|
|
24
11
|
results: {
|
|
25
|
-
certainty: LintingResultCertainty
|
|
26
|
-
function: Identifier;
|
|
27
|
-
range: SourceRange;
|
|
12
|
+
certainty: import("../linter-format").LintingResultCertainty;
|
|
13
|
+
function: import("../../dataflow/environments/identifier").Identifier;
|
|
14
|
+
range: import("../../util/range").SourceRange;
|
|
28
15
|
}[];
|
|
29
|
-
'.meta':
|
|
16
|
+
'.meta': FunctionsMetadata;
|
|
30
17
|
};
|
|
31
18
|
readonly prettyPrint: {
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
query: (result: FunctionsResult) => string;
|
|
20
|
+
full: (result: FunctionsResult) => string;
|
|
34
21
|
};
|
|
35
22
|
readonly info: {
|
|
36
23
|
readonly name: "Deprecated Functions";
|
|
@@ -38,7 +25,7 @@ export declare const DEPRECATED_FUNCTIONS: {
|
|
|
38
25
|
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
39
26
|
readonly description: "Marks deprecated functions that should not be used anymore.";
|
|
40
27
|
readonly defaultConfig: {
|
|
41
|
-
readonly
|
|
28
|
+
readonly fns: readonly ["all_equal", "arrange_all", "distinct_all", "filter_all", "group_by_all", "summarise_all", "mutate_all", "select_all", "vars", "all_vars", "id", "failwith", "select_vars", "rename_vars", "select_var", "current_vars", "bench_tbls", "compare_tbls", "compare_tbls2", "eval_tbls", "eval_tbls2", "location", "changes", "combine", "do", "funs", "add_count_", "add_tally_", "arrange_", "count_", "distinct_", "do_", "filter_", "funs_", "group_by_", "group_indices_", "mutate_", "tally_", "transmute_", "rename_", "rename_vars_", "select_", "select_vars_", "slice_", "summarise_", "summarize_", "summarise_each", "src_local", "tbl_df", "add_rownames", "group_nest", "group_split", "with_groups", "nest_by", "progress_estimated", "recode", "sample_n", "top_n", "transmute", "fct_explicit_na", "aes_", "aes_auto", "annotation_logticks", "is.Coord", "coord_flip", "coord_map", "is.facet", "fortify", "is.ggproto", "guide_train", "is.ggplot", "qplot", "is.theme", "gg_dep", "liply", "isplit2", "list_along", "cross", "invoke", "at_depth", "prepend", "rerun", "splice", "`%@%`", "rbernoulli", "rdunif", "when", "update_list", "map_raw", "accumulate", "reduce_right", "flatten", "map_dfr", "as_vector", "transpose", "melt_delim", "melt_fwf", "melt_table", "read_table2", "str_interp", "as_tibble", "data_frame", "tibble_", "data_frame_", "lst_", "as_data_frame", "as.tibble", "frame_data", "trunc_mat", "is.tibble", "tidy_names", "set_tidy_names", "repair_names", "extract_numeric", "complete_", "drop_na_", "expand_", "crossing_", "nesting_", "extract_", "fill_", "gather_", "nest_", "separate_rows_", "separate_", "spread_", "unite_", "unnest_", "extract", "gather", "nest_legacy", "separate_rows", "separate", "spread"];
|
|
42
29
|
};
|
|
43
30
|
};
|
|
44
31
|
};
|
|
@@ -2,50 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEPRECATED_FUNCTIONS = void 0;
|
|
4
4
|
const linter_format_1 = require("../linter-format");
|
|
5
|
-
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
6
|
-
const dfg_1 = require("../../util/mermaid/dfg");
|
|
7
|
-
const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
|
|
8
|
-
const flowr_search_filters_1 = require("../../search/flowr-search-filters");
|
|
9
5
|
const linter_tags_1 = require("../linter-tags");
|
|
6
|
+
const function_finder_util_1 = require("./function-finder-util");
|
|
10
7
|
exports.DEPRECATED_FUNCTIONS = {
|
|
11
|
-
createSearch: (config) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
name: flowr_search_filters_1.FlowrFilter.MatchesEnrichment,
|
|
15
|
-
args: {
|
|
16
|
-
enrichment: search_enrichers_1.Enrichment.CallTargets,
|
|
17
|
-
test: (0, flowr_search_filters_1.testFunctionsIgnoringPackage)(config.deprecatedFunctions)
|
|
18
|
-
}
|
|
19
|
-
}),
|
|
20
|
-
processSearchResult: (elements) => {
|
|
21
|
-
const metadata = {
|
|
22
|
-
totalDeprecatedCalls: 0,
|
|
23
|
-
totalDeprecatedFunctionDefinitions: 0
|
|
24
|
-
};
|
|
25
|
-
return {
|
|
26
|
-
results: elements.getElements()
|
|
27
|
-
.flatMap(element => {
|
|
28
|
-
metadata.totalDeprecatedCalls++;
|
|
29
|
-
return (0, search_enrichers_1.enrichmentContent)(element, search_enrichers_1.Enrichment.CallTargets).targets.map(target => {
|
|
30
|
-
metadata.totalDeprecatedFunctionDefinitions++;
|
|
31
|
-
return {
|
|
32
|
-
range: element.node.info.fullRange,
|
|
33
|
-
target: target
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
})
|
|
37
|
-
.map(element => ({
|
|
38
|
-
certainty: linter_format_1.LintingResultCertainty.Certain,
|
|
39
|
-
function: element.target,
|
|
40
|
-
range: element.range
|
|
41
|
-
})),
|
|
42
|
-
'.meta': metadata
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
prettyPrint: {
|
|
46
|
-
[linter_format_1.LintingPrettyPrintContext.Query]: result => `Function \`${result.function}\` at ${(0, dfg_1.formatRange)(result.range)}`,
|
|
47
|
-
[linter_format_1.LintingPrettyPrintContext.Full]: result => `Function \`${result.function}\` called at ${(0, dfg_1.formatRange)(result.range)} is deprecated`
|
|
48
|
-
},
|
|
8
|
+
createSearch: (config) => function_finder_util_1.functionFinderUtil.createSearch(config.fns),
|
|
9
|
+
processSearchResult: function_finder_util_1.functionFinderUtil.processSearchResult,
|
|
10
|
+
prettyPrint: function_finder_util_1.functionFinderUtil.prettyPrint('deprecated'),
|
|
49
11
|
info: {
|
|
50
12
|
name: 'Deprecated Functions',
|
|
51
13
|
tags: [linter_tags_1.LintingRuleTag.Deprecated, linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Usability, linter_tags_1.LintingRuleTag.Reproducibility],
|
|
@@ -53,7 +15,7 @@ exports.DEPRECATED_FUNCTIONS = {
|
|
|
53
15
|
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
54
16
|
description: 'Marks deprecated functions that should not be used anymore.',
|
|
55
17
|
defaultConfig: {
|
|
56
|
-
|
|
18
|
+
fns: ['all_equal', 'arrange_all', 'distinct_all', 'filter_all', 'group_by_all', 'summarise_all', 'mutate_all', 'select_all', 'vars', 'all_vars', 'id', 'failwith', 'select_vars', 'rename_vars', 'select_var', 'current_vars', 'bench_tbls', 'compare_tbls', 'compare_tbls2', 'eval_tbls', 'eval_tbls2', 'location', 'changes', 'combine', 'do', 'funs', 'add_count_', 'add_tally_', 'arrange_', 'count_', 'distinct_', 'do_', 'filter_', 'funs_', 'group_by_', 'group_indices_', 'mutate_', 'tally_', 'transmute_', 'rename_', 'rename_vars_', 'select_', 'select_vars_', 'slice_', 'summarise_', 'summarize_', 'summarise_each', 'src_local', 'tbl_df', 'add_rownames', 'group_nest', 'group_split', 'with_groups', 'nest_by', 'progress_estimated', 'recode', 'sample_n', 'top_n', 'transmute', 'fct_explicit_na', 'aes_', 'aes_auto', 'annotation_logticks', 'is.Coord', 'coord_flip', 'coord_map', 'is.facet', 'fortify', 'is.ggproto', 'guide_train', 'is.ggplot', 'qplot', 'is.theme', 'gg_dep', 'liply', 'isplit2', 'list_along', 'cross', 'invoke', 'at_depth', 'prepend', 'rerun', 'splice', '`%@%`', 'rbernoulli', 'rdunif', 'when', 'update_list', 'map_raw', 'accumulate', 'reduce_right', 'flatten', 'map_dfr', 'as_vector', 'transpose', 'melt_delim', 'melt_fwf', 'melt_table', 'read_table2', 'str_interp', 'as_tibble', 'data_frame', 'tibble_', 'data_frame_', 'lst_', 'as_data_frame', 'as.tibble', 'frame_data', 'trunc_mat', 'is.tibble', 'tidy_names', 'set_tidy_names', 'repair_names', 'extract_numeric', 'complete_', 'drop_na_', 'expand_', 'crossing_', 'nesting_', 'extract_', 'fill_', 'gather_', 'nest_', 'separate_rows_', 'separate_', 'spread_', 'unite_', 'unnest_', 'extract', 'gather', 'nest_legacy', 'separate_rows', 'separate', 'spread',]
|
|
57
19
|
}
|
|
58
20
|
}
|
|
59
21
|
};
|
|
@@ -31,10 +31,11 @@ export interface FilePathValidityMetadata extends MergeableRecord {
|
|
|
31
31
|
totalValid: number;
|
|
32
32
|
}
|
|
33
33
|
export declare const FILE_PATH_VALIDITY: {
|
|
34
|
-
readonly createSearch: (config: FilePathValidityConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from-query", ["with"], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]
|
|
34
|
+
readonly createSearch: (config: FilePathValidityConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from-query", ["with"], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
|
|
35
35
|
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: FilePathValidityConfig, data: {
|
|
36
36
|
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
37
37
|
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
38
|
+
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
38
39
|
config: import("../../config").FlowrConfigOptions;
|
|
39
40
|
}) => {
|
|
40
41
|
results: FilePathValidityResult[];
|
|
@@ -26,9 +26,9 @@ exports.FILE_PATH_VALIDITY = {
|
|
|
26
26
|
totalWritesBeforeAlways: 0,
|
|
27
27
|
totalValid: 0
|
|
28
28
|
};
|
|
29
|
+
const results = elements.enrichmentContent(search_enrichers_1.Enrichment.QueryData).queries['dependencies'];
|
|
29
30
|
return {
|
|
30
31
|
results: elements.getElements().flatMap(element => {
|
|
31
|
-
const results = elements.enrichmentContent(search_enrichers_1.Enrichment.QueryData).queries['dependencies'];
|
|
32
32
|
const matchingRead = results.read.find(r => r.nodeId == element.node.info.id);
|
|
33
33
|
if (!matchingRead) {
|
|
34
34
|
return [];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { SourceRange } from '../../util/range';
|
|
2
|
+
import type { Identifier } from '../../dataflow/environments/identifier';
|
|
3
|
+
import type { LintingResult } from '../linter-format';
|
|
4
|
+
import { LintingResultCertainty } from '../linter-format';
|
|
5
|
+
import type { FlowrSearchElement, FlowrSearchElements } from '../../search/flowr-search';
|
|
6
|
+
import type { NormalizedAst, ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
7
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
8
|
+
import type { DataflowInformation } from '../../dataflow/info';
|
|
9
|
+
import type { FlowrConfigOptions } from '../../config';
|
|
10
|
+
import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info';
|
|
11
|
+
export interface FunctionsResult extends LintingResult {
|
|
12
|
+
function: string;
|
|
13
|
+
range: SourceRange;
|
|
14
|
+
}
|
|
15
|
+
export interface FunctionsMetadata extends MergeableRecord {
|
|
16
|
+
totalCalls: number;
|
|
17
|
+
totalFunctionDefinitions: number;
|
|
18
|
+
}
|
|
19
|
+
export interface FunctionsToDetectConfig extends MergeableRecord {
|
|
20
|
+
/**
|
|
21
|
+
* The list of function names that should be marked in the given context.
|
|
22
|
+
*/
|
|
23
|
+
fns: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This helper object collects utility functions used to create linting rules that search for specific functions.
|
|
27
|
+
*/
|
|
28
|
+
export declare const functionFinderUtil: {
|
|
29
|
+
createSearch: (functions: readonly string[]) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with", "filter"], ParentInformation, Promise<FlowrSearchElements<ParentInformation, [] | FlowrSearchElement<ParentInformation>[]>>>;
|
|
30
|
+
processSearchResult: <T extends FlowrSearchElement<ParentInformation>[]>(elements: FlowrSearchElements<ParentInformation, T>, _config: FunctionsToDetectConfig, _data: {
|
|
31
|
+
normalize: NormalizedAst;
|
|
32
|
+
dataflow: DataflowInformation;
|
|
33
|
+
config: FlowrConfigOptions;
|
|
34
|
+
}, refineSearch?: (elements: T) => T) => {
|
|
35
|
+
results: {
|
|
36
|
+
certainty: LintingResultCertainty;
|
|
37
|
+
function: Identifier;
|
|
38
|
+
range: SourceRange;
|
|
39
|
+
}[];
|
|
40
|
+
'.meta': FunctionsMetadata;
|
|
41
|
+
};
|
|
42
|
+
prettyPrint: (functionType: string) => {
|
|
43
|
+
query: (result: FunctionsResult) => string;
|
|
44
|
+
full: (result: FunctionsResult) => string;
|
|
45
|
+
};
|
|
46
|
+
requireArgumentValue(element: FlowrSearchElement<ParentInformation>, pool: readonly FunctionInfo[], data: {
|
|
47
|
+
normalize: NormalizedAst;
|
|
48
|
+
dataflow: DataflowInformation;
|
|
49
|
+
config: FlowrConfigOptions;
|
|
50
|
+
}, requireValue: RegExp | string | undefined): boolean;
|
|
51
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.functionFinderUtil = void 0;
|
|
4
|
+
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
5
|
+
const flowr_search_filters_1 = require("../../search/flowr-search-filters");
|
|
6
|
+
const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
|
|
7
|
+
const linter_format_1 = require("../linter-format");
|
|
8
|
+
const dfg_1 = require("../../util/mermaid/dfg");
|
|
9
|
+
const assert_1 = require("../../util/assert");
|
|
10
|
+
const resolve_argument_1 = require("../../dataflow/eval/resolve/resolve-argument");
|
|
11
|
+
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
12
|
+
const dependencies_query_format_1 = require("../../queries/catalog/dependencies-query/dependencies-query-format");
|
|
13
|
+
/**
|
|
14
|
+
* This helper object collects utility functions used to create linting rules that search for specific functions.
|
|
15
|
+
*/
|
|
16
|
+
exports.functionFinderUtil = {
|
|
17
|
+
createSearch: (functions) => {
|
|
18
|
+
return (flowr_search_builder_1.Q.all()
|
|
19
|
+
.with(search_enrichers_1.Enrichment.CallTargets, { onlyBuiltin: true })
|
|
20
|
+
.filter({
|
|
21
|
+
name: flowr_search_filters_1.FlowrFilter.MatchesEnrichment,
|
|
22
|
+
args: {
|
|
23
|
+
enrichment: search_enrichers_1.Enrichment.CallTargets,
|
|
24
|
+
test: (0, flowr_search_filters_1.testFunctionsIgnoringPackage)(functions)
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
},
|
|
28
|
+
processSearchResult: (elements, _config, _data, refineSearch = e => e) => {
|
|
29
|
+
const metadata = {
|
|
30
|
+
totalCalls: 0,
|
|
31
|
+
totalFunctionDefinitions: 0
|
|
32
|
+
};
|
|
33
|
+
const results = refineSearch(elements.getElements())
|
|
34
|
+
.flatMap(element => {
|
|
35
|
+
metadata.totalCalls++;
|
|
36
|
+
return (0, search_enrichers_1.enrichmentContent)(element, search_enrichers_1.Enrichment.CallTargets).targets.map(target => {
|
|
37
|
+
metadata.totalFunctionDefinitions++;
|
|
38
|
+
return {
|
|
39
|
+
node: element.node,
|
|
40
|
+
range: element.node.info.fullRange,
|
|
41
|
+
target: target
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
results: results.map(element => ({
|
|
47
|
+
certainty: linter_format_1.LintingResultCertainty.Certain,
|
|
48
|
+
function: element.target,
|
|
49
|
+
range: element.range
|
|
50
|
+
})),
|
|
51
|
+
'.meta': metadata
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
prettyPrint: (functionType) => {
|
|
55
|
+
return {
|
|
56
|
+
[linter_format_1.LintingPrettyPrintContext.Query]: (result) => `Function \`${result.function}\` at ${(0, dfg_1.formatRange)(result.range)}`,
|
|
57
|
+
[linter_format_1.LintingPrettyPrintContext.Full]: (result) => `Function \`${result.function}\` called at ${(0, dfg_1.formatRange)(result.range)} is related to ${functionType}`
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
requireArgumentValue(element, pool, data, requireValue) {
|
|
61
|
+
const info = pool.find(f => f.name === element.node.lexeme);
|
|
62
|
+
/* if we have no additional info, we assume they always access the network */
|
|
63
|
+
if (info === undefined) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
const vert = data.dataflow.graph.getVertex(element.node.info.id);
|
|
67
|
+
if ((0, vertex_1.isFunctionCallVertex)(vert)) {
|
|
68
|
+
const args = (0, resolve_argument_1.getArgumentStringValue)(data.config.solver.variables, data.dataflow.graph, vert, info.argIdx, info.argName, info.resolveValue);
|
|
69
|
+
// we obtain all values, at least one of them has to trigger for the request
|
|
70
|
+
const argValues = args ? args.values().flatMap(v => [...v]).filter(assert_1.isNotUndefined).toArray() : [];
|
|
71
|
+
/* if there are no arguments we assume they may access the network, otherwise we check for the flag */
|
|
72
|
+
return argValues.length === 0 || argValues.some(v => v === dependencies_query_format_1.Unknown || (requireValue instanceof RegExp ? requireValue.test(v) : v === requireValue));
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=function-finder-util.js.map
|