@eagleoutice/flowr 2.10.1 → 2.10.2
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 +27 -16
- package/abstract-interpretation/absint-visitor.d.ts +13 -8
- package/abstract-interpretation/absint-visitor.js +35 -26
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +1 -2
- package/abstract-interpretation/data-frame/dataframe-domain.js +14 -15
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +2 -15
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +11 -17
- package/abstract-interpretation/data-frame/mappers/arguments.js +18 -18
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +41 -15
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +74 -48
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -1
- package/abstract-interpretation/data-frame/semantics.d.ts +1 -1
- package/abstract-interpretation/data-frame/semantics.js +31 -35
- package/abstract-interpretation/data-frame/shape-inference.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +1 -0
- package/abstract-interpretation/domains/interval-domain.js +3 -0
- package/abstract-interpretation/domains/product-domain.d.ts +9 -0
- package/abstract-interpretation/domains/product-domain.js +26 -6
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +36 -22
- package/abstract-interpretation/domains/state-abstract-domain.js +169 -62
- package/abstract-interpretation/unsupported-functions.d.ts +10 -0
- package/abstract-interpretation/unsupported-functions.js +45 -0
- package/benchmark/slicer.js +10 -13
- package/cli/flowr.js +1 -1
- package/control-flow/control-flow-graph.js +13 -9
- package/control-flow/semantic-cfg-guided-visitor.d.ts +6 -0
- package/control-flow/semantic-cfg-guided-visitor.js +6 -0
- package/dataflow/environments/built-in-proc-name.d.ts +6 -0
- package/dataflow/environments/built-in-proc-name.js +6 -0
- package/dataflow/environments/built-in.d.ts +7 -5
- package/dataflow/environments/built-in.js +2 -0
- package/dataflow/environments/default-builtin-config.d.ts +442 -6
- package/dataflow/environments/default-builtin-config.js +158 -3
- package/dataflow/environments/overwrite.js +2 -5
- package/dataflow/graph/df-helper.d.ts +14 -4
- package/dataflow/graph/df-helper.js +36 -6
- package/dataflow/graph/graph.d.ts +10 -0
- package/dataflow/graph/graph.js +12 -0
- package/dataflow/instrument/instrument-dataflow-count.d.ts +10 -0
- package/dataflow/instrument/instrument-dataflow-count.js +10 -0
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -17
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.d.ts +23 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +80 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +41 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +179 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +7 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +62 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.d.ts +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +15 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/common.d.ts +2 -2
- package/dataflow/internal/process/functions/call/common.js +4 -3
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -2
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +2 -2
- package/documentation/wiki-absint.js +6 -5
- package/documentation/wiki-analyzer.js +0 -2
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-normalized-ast.js +7 -7
- package/linter/linter-rules.d.ts +24 -1
- package/linter/linter-rules.js +3 -1
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +3 -4
- package/linter/rules/roxygen-arguments.d.ts +35 -0
- package/linter/rules/roxygen-arguments.js +100 -0
- package/package.json +2 -3
- package/project/context/flowr-analyzer-context.d.ts +1 -8
- package/project/context/flowr-analyzer-context.js +1 -7
- package/project/context/flowr-analyzer-environment-context.d.ts +5 -0
- package/project/context/flowr-analyzer-environment-context.js +6 -0
- package/project/context/flowr-analyzer-files-context.d.ts +6 -0
- package/project/context/flowr-analyzer-files-context.js +4 -2
- package/project/flowr-analyzer-builder.js +1 -4
- 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 +10 -5
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/library-functions.js +2 -0
- package/queries/catalog/df-shape-query/df-shape-query-format.js +7 -2
- package/queries/catalog/files-query/files-query-executor.js +0 -1
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +2 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.js +2 -0
- package/r-bridge/data/data.d.ts +2 -2
- package/r-bridge/data/data.js +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +13 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +14 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +13 -0
- package/r-bridge/lang-4.x/ast/model/versions.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/versions.js +3 -1
- package/r-bridge/roxygen2/documentation-provider.js +15 -6
- package/r-bridge/roxygen2/roxygen-ast.d.ts +3 -1
- package/search/flowr-search-builder.js +3 -2
- package/util/mermaid/ast.js +2 -1
- package/util/record.d.ts +23 -0
- package/util/record.js +33 -0
- package/util/version.js +1 -1
- package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +0 -41
- package/abstract-interpretation/domains/mapped-abstract-domain.js +0 -213
|
@@ -2,7 +2,7 @@ import { type DataflowProcessorInformation } from '../../../../../processor';
|
|
|
2
2
|
import type { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
5
|
-
import { type
|
|
5
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
import type { KnownHooks } from '../../../../../hooks';
|
|
8
8
|
export interface RegisterHookConfig {
|
|
@@ -31,4 +31,4 @@ export interface RegisterHookConfig {
|
|
|
31
31
|
/**
|
|
32
32
|
* Process a hook such as `on.exit`
|
|
33
33
|
*/
|
|
34
|
-
export declare function processRegisterHook<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
34
|
+
export declare function processRegisterHook<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: RegisterHookConfig): DataflowInformation;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
2
|
import { type DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import { type
|
|
4
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
/**
|
|
@@ -12,4 +12,4 @@ import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/proce
|
|
|
12
12
|
* @param data - Additional dataflow processor information.
|
|
13
13
|
* @returns - The resulting dataflow information after processing the repeat loop.
|
|
14
14
|
*/
|
|
15
|
-
export declare function processRepeatLoop<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
15
|
+
export declare function processRepeatLoop<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
|
|
@@ -3,7 +3,7 @@ import { DataflowInformation } from '../../../../../info';
|
|
|
3
3
|
import { type ForceArguments } from '../common';
|
|
4
4
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
|
-
import { type
|
|
6
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
7
7
|
import { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
8
8
|
/**
|
|
9
9
|
* Process a replacement function call like `<-`, `[[<-`, `$<-`, etc.
|
|
@@ -11,7 +11,7 @@ import { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function processReplacementFunction<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>,
|
|
13
13
|
/** The last one has to be the value */
|
|
14
|
-
args: readonly
|
|
14
|
+
args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: {
|
|
15
15
|
makeMaybe?: boolean;
|
|
16
16
|
constructName?: 's7';
|
|
17
17
|
assignmentOperator?: '<-' | '<<-';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
2
|
import type { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import { type
|
|
4
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
/**
|
|
8
8
|
* Process an `rm` call.
|
|
9
9
|
*/
|
|
10
|
-
export declare function processRm<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
10
|
+
export declare function processRm<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
2
|
import type { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import { type
|
|
4
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
/** Used to separate S7 dispatch info in identifiers */
|
|
@@ -9,4 +9,4 @@ export declare const S7DispatchSeparator = "\uFE55s3\uFE55";
|
|
|
9
9
|
/**
|
|
10
10
|
* Process an S7 generic dispatch call like `S7_dispatch`.
|
|
11
11
|
*/
|
|
12
|
-
export declare function processS7Dispatch<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
12
|
+
export declare function processS7Dispatch<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
2
|
import type { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import { type
|
|
4
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
/** e.g. new_generic(name, dispatch_args, fun=NULL) */
|
|
@@ -15,5 +15,5 @@ interface S7GenericDispatchConfig {
|
|
|
15
15
|
/**
|
|
16
16
|
* Process an S7 new generic dispatch call like `new_generic` or `setGeneric`.
|
|
17
17
|
*/
|
|
18
|
-
export declare function processS7NewGeneric<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
18
|
+
export declare function processS7NewGeneric<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: S7GenericDispatchConfig): DataflowInformation;
|
|
19
19
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
2
|
import { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import { type
|
|
4
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
/** e.g. UseMethod(generic, object) */
|
|
@@ -16,5 +16,5 @@ interface S3DispatchConfig {
|
|
|
16
16
|
/**
|
|
17
17
|
* Process an S3 dispatch call like `UseMethod`.
|
|
18
18
|
*/
|
|
19
|
-
export declare function processS3Dispatch<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
19
|
+
export declare function processS3Dispatch<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: S3DispatchConfig): DataflowInformation;
|
|
20
20
|
export {};
|
|
@@ -3,7 +3,7 @@ import { DataflowInformation } from '../../../../../info';
|
|
|
3
3
|
import { type FlowrLaxSourcingOptions, InferWorkingDirectory } from '../../../../../../config';
|
|
4
4
|
import { type RParseRequest } from '../../../../../../r-bridge/retriever';
|
|
5
5
|
import { type IdGenerator, type ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
6
|
-
import { type
|
|
6
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
7
7
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
8
8
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
9
9
|
import type { NoInfo } from '../../../../../../r-bridge/lang-4.x/ast/model/model';
|
|
@@ -35,7 +35,7 @@ export declare function findSource(resolveSource: FlowrLaxSourcingOptions | unde
|
|
|
35
35
|
/**
|
|
36
36
|
* Processes a named function call (i.e., not an anonymous function)
|
|
37
37
|
*/
|
|
38
|
-
export declare function processSourceCall<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
38
|
+
export declare function processSourceCall<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: {
|
|
39
39
|
/** should this produce an explicit source function call in the graph? */
|
|
40
40
|
includeFunctionCall?: boolean;
|
|
41
41
|
/** should this function call be followed, even when the configuration disables it? */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
2
|
import type { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import type {
|
|
4
|
+
import type { PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
import type { ForceArguments } from '../common';
|
|
@@ -10,7 +10,7 @@ import type { ForceArguments } from '../common';
|
|
|
10
10
|
* For example, the logical AND `&&` and OR `||` operators only evaluate their right-hand side if necessary.
|
|
11
11
|
* Please note that this is not (directly) related to R's special binary operators like `%in%`.
|
|
12
12
|
*/
|
|
13
|
-
export declare function processSpecialBinOp<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
13
|
+
export declare function processSpecialBinOp<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: {
|
|
14
14
|
lazy: boolean;
|
|
15
15
|
evalRhsWhen: boolean;
|
|
16
16
|
} & ForceArguments): DataflowInformation;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
2
|
import type { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import type {
|
|
4
|
+
import type { PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
/**
|
|
@@ -18,4 +18,4 @@ import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/proce
|
|
|
18
18
|
* })
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export declare function processStopIfNot<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
21
|
+
export declare function processStopIfNot<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
2
|
import type { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import { type
|
|
4
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
/**
|
|
8
8
|
* Process a built-in try-catch or similar handler.
|
|
9
9
|
*/
|
|
10
|
-
export declare function processTryCatch<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
10
|
+
export declare function processTryCatch<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: {
|
|
11
11
|
block: string;
|
|
12
12
|
handlers: {
|
|
13
13
|
error?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
2
2
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
@@ -12,4 +12,4 @@ import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
|
12
12
|
* c(1, 2, 3, 4)
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
export declare function processVector<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
15
|
+
export declare function processVector<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
2
|
import { type DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import { type
|
|
4
|
+
import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
/**
|
|
8
8
|
* Process a while loop like `while(cond) { ... }`.
|
|
9
9
|
*/
|
|
10
|
-
export declare function processWhileLoop<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
10
|
+
export declare function processWhileLoop<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
|
|
@@ -2,7 +2,7 @@ import { type DataflowInformation } from '../../../../info';
|
|
|
2
2
|
import { type DataflowProcessorInformation } from '../../../../processor';
|
|
3
3
|
import type { RNode } from '../../../../../r-bridge/lang-4.x/ast/model/model';
|
|
4
4
|
import type { ParentInformation } from '../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
|
-
import { EmptyArgument, type
|
|
5
|
+
import { EmptyArgument, type PotentiallyEmptyRArgument } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
6
6
|
import type { DataflowGraph, FunctionArgument } from '../../../../graph/graph';
|
|
7
7
|
import type { NodeId } from '../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
8
8
|
import type { REnvironmentInformation } from '../../../../environments/environment';
|
|
@@ -15,7 +15,7 @@ export interface ForceArguments {
|
|
|
15
15
|
}
|
|
16
16
|
export interface ProcessAllArgumentInput<OtherInfo> extends ForceArguments {
|
|
17
17
|
readonly functionName: DataflowInformation;
|
|
18
|
-
readonly args: readonly (RNode<OtherInfo & ParentInformation> |
|
|
18
|
+
readonly args: readonly (RNode<OtherInfo & ParentInformation> | PotentiallyEmptyRArgument<OtherInfo & ParentInformation>)[];
|
|
19
19
|
readonly data: DataflowProcessorInformation<OtherInfo & ParentInformation>;
|
|
20
20
|
readonly finalGraph: DataflowGraph;
|
|
21
21
|
readonly functionRootId: NodeId;
|
|
@@ -89,15 +89,16 @@ function processAllArguments({ functionName, args, data, finalGraph, functionRoo
|
|
|
89
89
|
let i = -1;
|
|
90
90
|
for (const arg of args) {
|
|
91
91
|
i++;
|
|
92
|
+
data = { ...data, environment: argEnv };
|
|
92
93
|
data = patchData?.(data, i) ?? data;
|
|
93
94
|
if (arg === r_function_call_1.EmptyArgument) {
|
|
94
95
|
callArgs.push(r_function_call_1.EmptyArgument);
|
|
95
96
|
processedArguments.push(undefined);
|
|
96
97
|
continue;
|
|
97
98
|
}
|
|
98
|
-
const processed = (0, processor_1.processDataflowFor)(arg,
|
|
99
|
+
const processed = (0, processor_1.processDataflowFor)(arg, data);
|
|
99
100
|
if (r_argument_1.RArgument.isWithValue(arg) && (forceArgs === 'all' || forceArgs[i]) && !model_1.RConstant.is(arg.value)) {
|
|
100
|
-
forceVertexArgumentValueReferences(functionRootId, processed, processed.graph,
|
|
101
|
+
forceVertexArgumentValueReferences(functionRootId, processed, processed.graph, data.environment);
|
|
101
102
|
}
|
|
102
103
|
processedArguments.push(processed);
|
|
103
104
|
finalEnv = (0, overwrite_1.overwriteEnvironment)(finalEnv, processed.environment);
|
|
@@ -108,7 +109,7 @@ function processAllArguments({ functionName, args, data, finalGraph, functionRoo
|
|
|
108
109
|
// check if it is called directly
|
|
109
110
|
const inId = ingoing.nodeId;
|
|
110
111
|
const refType = finalGraph.getVertex(inId)?.tag === vertex_1.VertexType.FunctionCall ? identifier_1.ReferenceType.Function : identifier_1.ReferenceType.Unknown;
|
|
111
|
-
const tryToResolve = ingoing.name ? (0, resolve_by_name_1.resolveByName)(ingoing.name,
|
|
112
|
+
const tryToResolve = ingoing.name ? (0, resolve_by_name_1.resolveByName)(ingoing.name, data.environment, refType) : undefined;
|
|
112
113
|
if (tryToResolve === undefined) {
|
|
113
114
|
remainingReadInArgs.push(ingoing);
|
|
114
115
|
}
|
|
@@ -3,7 +3,7 @@ import type { DataflowInformation } from '../../../../info';
|
|
|
3
3
|
import { type ForceArguments } from './common';
|
|
4
4
|
import type { RSymbol } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
5
5
|
import type { ParentInformation } from '../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
6
|
-
import type {
|
|
6
|
+
import type { PotentiallyEmptyRArgument } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
7
7
|
import type { NodeId } from '../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
8
8
|
import type { RNode } from '../../../../../r-bridge/lang-4.x/ast/model/model';
|
|
9
9
|
import { type IdentifierReference } from '../../../../environments/identifier';
|
|
@@ -14,7 +14,7 @@ export interface ProcessKnownFunctionCallInput<OtherInfo> extends ForceArguments
|
|
|
14
14
|
/** The name of the function being called. */
|
|
15
15
|
readonly name: RSymbol<OtherInfo & ParentInformation>;
|
|
16
16
|
/** The arguments to the function call. */
|
|
17
|
-
readonly args: readonly (RNode<OtherInfo & ParentInformation> |
|
|
17
|
+
readonly args: readonly (RNode<OtherInfo & ParentInformation> | PotentiallyEmptyRArgument<OtherInfo & ParentInformation>)[];
|
|
18
18
|
/** The node ID to use for the function call vertex. */
|
|
19
19
|
readonly rootId: NodeId;
|
|
20
20
|
/** The dataflow processor information at the point of the function call. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../processor';
|
|
2
2
|
import { DataflowInformation } from '../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import type {
|
|
4
|
+
import type { PotentiallyEmptyRArgument } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
import type { DataflowGraph } from '../../../../graph/graph';
|
|
@@ -13,4 +13,4 @@ export declare function markAsOnlyBuiltIn(graph: DataflowGraph, rootId: NodeId):
|
|
|
13
13
|
* Processes a named function call within the dataflow analysis.
|
|
14
14
|
* For example, `myFunction(arg1, arg2)`, resolves against the environment.
|
|
15
15
|
*/
|
|
16
|
-
export declare function processNamedCall<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly
|
|
16
|
+
export declare function processNamedCall<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
|
|
@@ -4,15 +4,16 @@ exports.WikiAbsint = void 0;
|
|
|
4
4
|
const absint_visitor_1 = require("../abstract-interpretation/absint-visitor");
|
|
5
5
|
const abstract_domain_1 = require("../abstract-interpretation/domains/abstract-domain");
|
|
6
6
|
const interval_domain_1 = require("../abstract-interpretation/domains/interval-domain");
|
|
7
|
+
const lattice_1 = require("../abstract-interpretation/domains/lattice");
|
|
7
8
|
const state_abstract_domain_1 = require("../abstract-interpretation/domains/state-abstract-domain");
|
|
8
9
|
const semantic_cfg_guided_visitor_1 = require("../control-flow/semantic-cfg-guided-visitor");
|
|
10
|
+
const identifier_1 = require("../dataflow/environments/identifier");
|
|
9
11
|
const cfg_kind_1 = require("../project/cfg-kind");
|
|
10
12
|
const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
|
|
11
13
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
12
14
|
const doc_code_1 = require("./doc-util/doc-code");
|
|
13
15
|
const doc_structure_1 = require("./doc-util/doc-structure");
|
|
14
16
|
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
15
|
-
const identifier_1 = require("../dataflow/environments/identifier");
|
|
16
17
|
class IntervalInferenceVisitor extends absint_visitor_1.AbstractInterpretationVisitor {
|
|
17
18
|
onNumberConstant({ vertex, node }) {
|
|
18
19
|
super.onNumberConstant({ vertex, node });
|
|
@@ -51,12 +52,12 @@ async function inferIntervals() {
|
|
|
51
52
|
const dfg = (await analyzer.dataflow()).graph;
|
|
52
53
|
const cfg = await analyzer.controlflow(undefined, cfg_kind_1.CfgKind.NoFunctionDefs);
|
|
53
54
|
const ctx = analyzer.inspectContext();
|
|
54
|
-
const inference = new IntervalInferenceVisitor({ controlFlow: cfg, dfg: dfg, normalizedAst: ast, ctx: ctx });
|
|
55
|
+
const inference = new IntervalInferenceVisitor({ controlFlow: cfg, dfg: dfg, normalizedAst: ast, ctx: ctx }, interval_domain_1.IntervalDomain.top());
|
|
55
56
|
inference.start();
|
|
56
57
|
const result = inference.getEndState();
|
|
57
|
-
return result.value.entries().toArray()
|
|
58
|
+
return result.isValue() ? result.value.entries().toArray()
|
|
58
59
|
.map(([id, value]) => `${nodeIdToSlicingCriterion(id, ast.idMap)} -> ${value.toString()}`)
|
|
59
|
-
.join('\n');
|
|
60
|
+
.join('\n') : lattice_1.BottomSymbol;
|
|
60
61
|
}
|
|
61
62
|
function nodeIdToSlicingCriterion(id, idMap) {
|
|
62
63
|
const node = idMap.get(id);
|
|
@@ -135,7 +136,7 @@ If we now want to run the interval inference, we can write the following code:
|
|
|
135
136
|
|
|
136
137
|
${ctx.code(inferIntervals, { dropLinesStart: 1, dropLinesEnd: 5 })}
|
|
137
138
|
|
|
138
|
-
We first need a ${ctx.linkPage('wiki/Analyzer', 'flowR analyzer')} (in this case, using the ${ctx.linkPage('wiki/Engines', 'tree-sitter engine')}). In this example, we want to analyze a small example code that assigns \`42\` to the variable \`x\`, randomly assigns \`6\` or \`12\` to the variable \`y\`, and assignes the sum of \`x\` and \`y\` to the variable \`z\`. For the abstract interpretation visitor, we need to retrieve the ${ctx.linkPage('wiki/Normalized AST', 'normalized AST')}, ${ctx.linkPage('wiki/Dataflow Graph', 'dataflow graph')}, ${ctx.linkPage('wiki/Control Flow Graph', 'control flow graph')},
|
|
139
|
+
We first need a ${ctx.linkPage('wiki/Analyzer', 'flowR analyzer')} (in this case, using the ${ctx.linkPage('wiki/Engines', 'tree-sitter engine')}). In this example, we want to analyze a small example code that assigns \`42\` to the variable \`x\`, randomly assigns \`6\` or \`12\` to the variable \`y\`, and assignes the sum of \`x\` and \`y\` to the variable \`z\`. For the abstract interpretation visitor, we need to retrieve the ${ctx.linkPage('wiki/Normalized AST', 'normalized AST')}, ${ctx.linkPage('wiki/Dataflow Graph', 'dataflow graph')}, ${ctx.linkPage('wiki/Control Flow Graph', 'control flow graph')}, context of the flowR anaylzer, and provide a value domain for the state domain. For performance reasons, we construct the control flow graph without simplification passes, data flow information, and function definitions. We then create a new ${ctx.link(IntervalInferenceVisitor)} using the control flow graph, dataflow graph, normalized AST, and analyzer context, and start the visitor using ${ctx.linkM(absint_visitor_1.AbstractInterpretationVisitor, 'start', { hideClass: true })}. After the visitor is finished, we retrieve the inferred abstract state at the end of the program using ${ctx.linkM(absint_visitor_1.AbstractInterpretationVisitor, 'getEndState', { hideClass: true })}.
|
|
139
140
|
|
|
140
141
|
If we now print the inferred abstract state at the end of the program, we get the following output:
|
|
141
142
|
|
|
@@ -355,8 +355,6 @@ ${ctx.link(flowr_analyzer_context_1.contextFromSources)} to create a context fro
|
|
|
355
355
|
|
|
356
356
|
If for whatever reason you need to reset the context during an analysis, you can use
|
|
357
357
|
${ctx.linkM(flowr_analyzer_context_1.FlowrAnalyzerContext, 'reset')}.
|
|
358
|
-
To pre-compute all possible information in the context before starting the main analysis, you can use
|
|
359
|
-
${ctx.linkM(flowr_analyzer_context_1.FlowrAnalyzerContext, 'resolvePreAnalysis')}.
|
|
360
358
|
|
|
361
359
|
${(0, doc_structure_1.section)('Files Context', 3)}
|
|
362
360
|
|
|
@@ -123,6 +123,7 @@ df[6, "value"]
|
|
|
123
123
|
rule(knownParser, 'dead-code', 'DeadCodeConfig', 'DEAD_CODE', 'lint-dead-code', 'if(TRUE) 1 else 2', tagTypes);
|
|
124
124
|
rule(knownParser, 'useless-loop', 'UselessLoopConfig', 'USELESS_LOOP', 'lint-useless-loop', 'for(i in c(1)) { print(i) }', tagTypes);
|
|
125
125
|
rule(knownParser, 'stop-call', 'StopWithCallConfig', 'STOP_WITH_CALL_ARG', 'lint-stop-call', 'stop(42)', tagTypes);
|
|
126
|
+
rule(knownParser, 'roxygen-arguments', 'RoxygenArgsConfig', 'ROXYGEN_ARGS', 'lint-roxygen-arguments', '#\' A function with two parameters, but only only one documented\n#\' @param a A variable\nf = function(a, b){return a;}', tagTypes);
|
|
126
127
|
rule(knownParser, 'problematic-eval', 'ProblematicEvalConfig', 'PROBLEMATIC_EVAL', 'lint-problematic-eval', `
|
|
127
128
|
function(x) {
|
|
128
129
|
eval(x)
|
|
@@ -6,7 +6,6 @@ const doc_normalized_ast_1 = require("./doc-util/doc-normalized-ast");
|
|
|
6
6
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
7
7
|
const doc_cli_option_1 = require("./doc-util/doc-cli-option");
|
|
8
8
|
const doc_structure_1 = require("./doc-util/doc-structure");
|
|
9
|
-
const retriever_1 = require("../r-bridge/retriever");
|
|
10
9
|
const normalized_ast_fold_1 = require("../abstract-interpretation/normalized-ast-fold");
|
|
11
10
|
const flowr_analyzer_1 = require("../project/flowr-analyzer");
|
|
12
11
|
const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
|
|
@@ -17,6 +16,12 @@ const r_binary_op_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-binary-op"
|
|
|
17
16
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
18
17
|
const r_project_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-project");
|
|
19
18
|
const r_expression_list_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-expression-list");
|
|
19
|
+
async function simpleNormalizedAst(code) {
|
|
20
|
+
const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder().build();
|
|
21
|
+
analyzer.addRequest(code);
|
|
22
|
+
const result = await analyzer.normalize();
|
|
23
|
+
return result.ast;
|
|
24
|
+
}
|
|
20
25
|
async function quickNormalizedAstMultipleFiles() {
|
|
21
26
|
const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
|
|
22
27
|
.setEngine('tree-sitter')
|
|
@@ -141,12 +146,7 @@ The following segments intend to give you an overview of how to work with the no
|
|
|
141
146
|
As explained alongside the [Interface](${doc_files_1.FlowrWikiBaseRef}/Interface#creating-flowr-analyses) wiki page, you can use an instance of
|
|
142
147
|
${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} to get the ${ctx.link('NormalizedAst')}:
|
|
143
148
|
|
|
144
|
-
${(
|
|
145
|
-
async function getAst(code: string): Promise<RNode> {
|
|
146
|
-
const analyzer = await new FlowrAnalyzerBuilder(${retriever_1.requestFromInput.name}(code.trim())).build();
|
|
147
|
-
const result = analyzer.normalizedAst();
|
|
148
|
-
return result.ast;
|
|
149
|
-
}`)}
|
|
149
|
+
${ctx.code(simpleNormalizedAst, { dropLinesStart: 1, dropLinesEnd: 2, hideDefinedAt: true })}
|
|
150
150
|
|
|
151
151
|
From the REPL, you can use the ${(0, doc_cli_option_1.getReplCommand)('normalize')} command.
|
|
152
152
|
|
package/linter/linter-rules.d.ts
CHANGED
|
@@ -202,7 +202,7 @@ export declare const LintingRules: {
|
|
|
202
202
|
};
|
|
203
203
|
};
|
|
204
204
|
readonly 'dataframe-access-validation': {
|
|
205
|
-
readonly createSearch: () => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", [
|
|
205
|
+
readonly createSearch: () => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", [], 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>[]>>;
|
|
206
206
|
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: {
|
|
207
207
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
208
208
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
@@ -329,6 +329,29 @@ export declare const LintingRules: {
|
|
|
329
329
|
readonly defaultConfig: {};
|
|
330
330
|
};
|
|
331
331
|
};
|
|
332
|
+
readonly 'roxygen-arguments': {
|
|
333
|
+
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>[]>>>;
|
|
334
|
+
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("../util/objects").MergeableRecord, { normalize }: {
|
|
335
|
+
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
336
|
+
dataflow: import("../dataflow/info").DataflowInformation;
|
|
337
|
+
cfg: import("../control-flow/control-flow-graph").ControlFlowInformation;
|
|
338
|
+
analyzer: import("../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
|
|
339
|
+
}) => {
|
|
340
|
+
results: import("ts-essentials").Writable<import("./rules/roxygen-arguments").RoxygenArgsResult>[];
|
|
341
|
+
'.meta': {};
|
|
342
|
+
};
|
|
343
|
+
readonly prettyPrint: {
|
|
344
|
+
readonly query: (result: import("./rules/roxygen-arguments").RoxygenArgsResult) => string;
|
|
345
|
+
readonly full: (result: import("./rules/roxygen-arguments").RoxygenArgsResult) => string;
|
|
346
|
+
};
|
|
347
|
+
readonly info: {
|
|
348
|
+
readonly name: "Roxygen Arguments";
|
|
349
|
+
readonly tags: readonly [import("./linter-tags").LintingRuleTag.Smell, import("./linter-tags").LintingRuleTag.Documentation, import("./linter-tags").LintingRuleTag.Style];
|
|
350
|
+
readonly certainty: import("./linter-format").LintingRuleCertainty.BestEffort;
|
|
351
|
+
readonly description: "Checks whether a function has undocumented or overdocumented parameters";
|
|
352
|
+
readonly defaultConfig: {};
|
|
353
|
+
};
|
|
354
|
+
};
|
|
332
355
|
};
|
|
333
356
|
export type LintingRuleNames = keyof typeof LintingRules;
|
|
334
357
|
export type LintingRuleMetadata<Name extends LintingRuleNames> = typeof LintingRules[Name] extends LintingRule<infer _Result, infer Metadata, infer _Config, infer _Info, infer _Elements> ? Metadata : never;
|
package/linter/linter-rules.js
CHANGED
|
@@ -12,6 +12,7 @@ const dataframe_access_validation_1 = require("./rules/dataframe-access-validati
|
|
|
12
12
|
const useless_loop_1 = require("./rules/useless-loop");
|
|
13
13
|
const network_functions_1 = require("./rules/network-functions");
|
|
14
14
|
const stop_with_call_arg_1 = require("./rules/stop-with-call-arg");
|
|
15
|
+
const roxygen_arguments_1 = require("./rules/roxygen-arguments");
|
|
15
16
|
const problematic_eval_1 = require("./rules/problematic-eval");
|
|
16
17
|
/**
|
|
17
18
|
* The registry of currently supported linting rules.
|
|
@@ -29,6 +30,7 @@ exports.LintingRules = {
|
|
|
29
30
|
'dead-code': dead_code_1.DEAD_CODE,
|
|
30
31
|
'useless-loop': useless_loop_1.USELESS_LOOP,
|
|
31
32
|
'problematic-eval': problematic_eval_1.PROBLEMATIC_EVAL,
|
|
32
|
-
'stop-call': stop_with_call_arg_1.STOP_WITH_CALL_ARG
|
|
33
|
+
'stop-call': stop_with_call_arg_1.STOP_WITH_CALL_ARG,
|
|
34
|
+
'roxygen-arguments': roxygen_arguments_1.ROXYGEN_ARGS
|
|
33
35
|
};
|
|
34
36
|
//# sourceMappingURL=linter-rules.js.map
|
|
@@ -29,7 +29,7 @@ export interface DataFrameAccessValidationMetadata extends MergeableRecord {
|
|
|
29
29
|
totalAccessed: number;
|
|
30
30
|
}
|
|
31
31
|
export declare const DATA_FRAME_ACCESS_VALIDATION: {
|
|
32
|
-
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", [
|
|
32
|
+
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", [], ParentInformation, FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>>;
|
|
33
33
|
readonly processSearchResult: (elements: FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>, config: DataFrameAccessValidationConfig, data: {
|
|
34
34
|
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
35
35
|
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
@@ -3,18 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DATA_FRAME_ACCESS_VALIDATION = void 0;
|
|
4
4
|
const shape_inference_1 = require("../../abstract-interpretation/data-frame/shape-inference");
|
|
5
5
|
const satisfiable_domain_1 = require("../../abstract-interpretation/domains/satisfiable-domain");
|
|
6
|
+
const config_1 = require("../../config");
|
|
7
|
+
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
6
8
|
const cfg_kind_1 = require("../../project/cfg-kind");
|
|
7
9
|
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
8
10
|
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
9
|
-
const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
|
|
10
11
|
const logic_1 = require("../../util/logic");
|
|
11
12
|
const range_1 = require("../../util/range");
|
|
12
13
|
const linter_format_1 = require("../linter-format");
|
|
13
14
|
const linter_tags_1 = require("../linter-tags");
|
|
14
|
-
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
15
|
-
const config_1 = require("../../config");
|
|
16
15
|
exports.DATA_FRAME_ACCESS_VALIDATION = {
|
|
17
|
-
createSearch: () => flowr_search_builder_1.Q.all()
|
|
16
|
+
createSearch: () => flowr_search_builder_1.Q.all(),
|
|
18
17
|
processSearchResult: async (elements, config, data) => {
|
|
19
18
|
let ctx = data.analyzer.inspectContext();
|
|
20
19
|
ctx = {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type LintingResult, LintingRuleCertainty } from '../linter-format';
|
|
2
|
+
import { SourceLocation } from '../../util/range';
|
|
3
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
4
|
+
import { LintingRuleTag } from '../linter-tags';
|
|
5
|
+
import type { Writable } from 'ts-essentials';
|
|
6
|
+
export interface RoxygenArgsResult extends LintingResult {
|
|
7
|
+
readonly loc: SourceLocation;
|
|
8
|
+
readonly overDocumented?: string[];
|
|
9
|
+
readonly underDocumented?: string[];
|
|
10
|
+
}
|
|
11
|
+
export type RoxygenArgsConfig = MergeableRecord;
|
|
12
|
+
export type RoxygenArgsMetadata = MergeableRecord;
|
|
13
|
+
export declare const ROXYGEN_ARGS: {
|
|
14
|
+
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>[]>>>;
|
|
15
|
+
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: MergeableRecord, { normalize }: {
|
|
16
|
+
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
17
|
+
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
18
|
+
cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation;
|
|
19
|
+
analyzer: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
|
|
20
|
+
}) => {
|
|
21
|
+
results: Writable<RoxygenArgsResult>[];
|
|
22
|
+
'.meta': {};
|
|
23
|
+
};
|
|
24
|
+
readonly prettyPrint: {
|
|
25
|
+
readonly query: (result: RoxygenArgsResult) => string;
|
|
26
|
+
readonly full: (result: RoxygenArgsResult) => string;
|
|
27
|
+
};
|
|
28
|
+
readonly info: {
|
|
29
|
+
readonly name: "Roxygen Arguments";
|
|
30
|
+
readonly tags: readonly [LintingRuleTag.Smell, LintingRuleTag.Documentation, LintingRuleTag.Style];
|
|
31
|
+
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
32
|
+
readonly description: "Checks whether a function has undocumented or overdocumented parameters";
|
|
33
|
+
readonly defaultConfig: {};
|
|
34
|
+
};
|
|
35
|
+
};
|