@eagleoutice/flowr 1.3.14 → 1.4.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 +3 -3
- package/abstract-interpretation/domain.d.ts +27 -0
- package/abstract-interpretation/domain.js +146 -0
- package/abstract-interpretation/handler/binop/binop.d.ts +16 -0
- package/abstract-interpretation/handler/binop/binop.js +40 -0
- package/abstract-interpretation/handler/binop/operators.d.ts +2 -0
- package/abstract-interpretation/handler/binop/operators.js +42 -0
- package/abstract-interpretation/handler/handler.d.ts +6 -0
- package/abstract-interpretation/handler/handler.js +3 -0
- package/abstract-interpretation/processor.d.ts +10 -0
- package/abstract-interpretation/processor.js +84 -0
- package/benchmark/slicer.d.ts +6 -8
- package/benchmark/slicer.js +5 -15
- package/benchmark/stats/print.d.ts +1 -1
- package/benchmark/stats/print.js +0 -2
- package/benchmark/stats/stats.d.ts +3 -4
- package/benchmark/stats/stats.js +1 -1
- package/cli/benchmark-app.d.ts +1 -0
- package/cli/benchmark-app.js +21 -6
- package/cli/benchmark-helper-app.d.ts +2 -0
- package/cli/benchmark-helper-app.js +15 -6
- package/cli/common/features.d.ts +1 -1
- package/cli/common/options.d.ts +1 -1
- package/cli/common/options.js +4 -1
- package/cli/common/script.d.ts +1 -1
- package/cli/common/scripts-info.d.ts +3 -2
- package/cli/common/scripts-info.js +15 -1
- package/cli/export-quads-app.js +1 -5
- package/cli/repl/commands/cfg.d.ts +1 -1
- package/cli/repl/commands/cfg.js +3 -3
- package/cli/repl/commands/commands.d.ts +4 -2
- package/cli/repl/commands/commands.js +67 -28
- package/cli/repl/commands/dataflow.d.ts +1 -1
- package/cli/repl/commands/dataflow.js +2 -2
- package/cli/repl/commands/execute.d.ts +2 -2
- package/cli/repl/commands/main.d.ts +2 -2
- package/cli/repl/commands/normalize.d.ts +1 -1
- package/cli/repl/commands/normalize.js +2 -2
- package/cli/repl/commands/parse.d.ts +1 -1
- package/cli/repl/commands/parse.js +12 -12
- package/cli/repl/commands/quit.d.ts +1 -1
- package/cli/repl/commands/quit.js +4 -1
- package/cli/repl/commands/version.d.ts +1 -1
- package/cli/repl/core.d.ts +5 -3
- package/cli/repl/core.js +63 -7
- package/cli/repl/execute.d.ts +1 -1
- package/cli/repl/execute.js +3 -3
- package/cli/repl/server/connection.d.ts +2 -2
- package/cli/repl/server/connection.js +4 -8
- package/cli/repl/server/messages/analysis.d.ts +3 -3
- package/cli/repl/server/messages/analysis.js +12 -32
- package/cli/repl/server/messages/error.d.ts +1 -1
- package/cli/repl/server/messages/hello.d.ts +2 -2
- package/cli/repl/server/messages/messages.d.ts +5 -5
- package/cli/repl/server/messages/repl.d.ts +1 -1
- package/cli/repl/server/messages/slice.d.ts +3 -3
- package/cli/repl/server/net.d.ts +16 -0
- package/cli/repl/server/net.js +42 -3
- package/cli/repl/server/send.d.ts +2 -2
- package/cli/repl/server/server.d.ts +2 -2
- package/cli/repl/server/validate.d.ts +3 -3
- package/cli/statistics-helper-app.js +2 -3
- package/cli/summarizer-app.js +1 -2
- package/config.d.ts +16 -0
- package/config.js +75 -0
- package/core/input.d.ts +5 -5
- package/core/output.d.ts +1 -1
- package/core/print/dataflow-printer.d.ts +3 -3
- package/core/print/normalize-printer.d.ts +2 -2
- package/core/print/parse-printer.d.ts +2 -3
- package/core/print/parse-printer.js +6 -4
- package/core/print/print.d.ts +1 -1
- package/core/print/slice-diff-ansi.d.ts +1 -1
- package/core/slicer.d.ts +5 -4
- package/core/slicer.js +2 -2
- package/core/steps.d.ts +10 -9
- package/core/steps.js +5 -4
- package/dataflow/environments/append.d.ts +1 -1
- package/dataflow/environments/environment.d.ts +4 -4
- package/dataflow/environments/environment.js +8 -0
- package/dataflow/environments/overwrite.d.ts +1 -1
- package/dataflow/environments/register.d.ts +2 -2
- package/dataflow/environments/register.js +1 -0
- package/dataflow/environments/resolve-by-name.d.ts +2 -2
- package/dataflow/environments/scoping.d.ts +1 -1
- package/dataflow/extractor.d.ts +5 -5
- package/dataflow/extractor.js +10 -2
- package/dataflow/graph/diff.d.ts +3 -3
- package/dataflow/graph/graph.d.ts +8 -7
- package/dataflow/graph/quads.d.ts +2 -2
- package/dataflow/graph/vertex.d.ts +5 -5
- package/dataflow/internal/info.d.ts +2 -2
- package/dataflow/internal/linker.d.ts +3 -3
- package/dataflow/internal/process/access.d.ts +3 -3
- package/dataflow/internal/process/expression-list.d.ts +3 -3
- package/dataflow/internal/process/expression-list.js +0 -4
- package/dataflow/internal/process/functions/argument.d.ts +4 -4
- package/dataflow/internal/process/functions/exit-points.d.ts +1 -1
- package/dataflow/internal/process/functions/function-call.d.ts +3 -3
- package/dataflow/internal/process/functions/function-call.js +7 -1
- package/dataflow/internal/process/functions/function-definition.d.ts +3 -3
- package/dataflow/internal/process/functions/parameter.d.ts +3 -3
- package/dataflow/internal/process/functions/source.d.ts +8 -0
- package/dataflow/internal/process/functions/source.js +81 -0
- package/dataflow/internal/process/if-then-else.d.ts +3 -3
- package/dataflow/internal/process/loops/for-loop.d.ts +3 -3
- package/dataflow/internal/process/loops/repeat-loop.d.ts +3 -3
- package/dataflow/internal/process/loops/while-loop.d.ts +3 -3
- package/dataflow/internal/process/operators/assignment.d.ts +3 -3
- package/dataflow/internal/process/operators/non-assignment-binary-op.d.ts +3 -3
- package/dataflow/internal/process/operators/pipe.d.ts +3 -3
- package/dataflow/internal/process/operators/unary-op.d.ts +3 -3
- package/dataflow/internal/process/symbol.d.ts +3 -3
- package/dataflow/internal/process/uninteresting-leaf.d.ts +2 -2
- package/dataflow/processor.d.ts +12 -3
- package/flowr.d.ts +5 -2
- package/flowr.js +19 -12
- package/package.json +50 -18
- package/r-bridge/lang-4.x/ast/index.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/index.js +3 -0
- package/r-bridge/lang-4.x/ast/model/collect.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/model.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/info/index.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/operators.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +4 -2
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +6 -1
- package/r-bridge/lang-4.x/ast/model/processing/fold.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/json/format.d.ts +14 -0
- package/r-bridge/lang-4.x/ast/parser/json/format.js +26 -0
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +7 -0
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +57 -0
- package/r-bridge/lang-4.x/ast/parser/xml/data.d.ts +4 -7
- package/r-bridge/lang-4.x/ast/parser/xml/hooks.d.ts +5 -5
- package/r-bridge/lang-4.x/ast/parser/xml/index.d.ts +0 -2
- package/r-bridge/lang-4.x/ast/parser/xml/index.js +0 -2
- package/r-bridge/lang-4.x/ast/parser/xml/input-format.d.ts +6 -2
- package/r-bridge/lang-4.x/ast/parser/xml/input-format.js +7 -10
- package/r-bridge/lang-4.x/ast/parser/xml/internal/access.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/access.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then-else.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then-else.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/expression.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/expression.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/argument.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/argument.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/call.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/call.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/definition.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/definition.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/parameter.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/parameter.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/index.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/parser/xml/internal/index.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/break.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/break.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/for.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/for.js +3 -6
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/next.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/next.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/repeat.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/repeat.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/while.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/while.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/meta.d.ts +9 -14
- package/r-bridge/lang-4.x/ast/parser/xml/internal/meta.js +15 -23
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/binary.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/binary.js +6 -6
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/special.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/unary.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/unary.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/comment.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/comment.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/line-directive.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/line-directive.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/elements.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/elements.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/root.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/root.js +3 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/single-element.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/single-element.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/number.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/number.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/string.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/string.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/symbol.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/symbol.js +4 -4
- package/r-bridge/lang-4.x/values.d.ts +0 -1
- package/r-bridge/lang-4.x/values.js +14 -6
- package/r-bridge/retriever.d.ts +26 -22
- package/r-bridge/retriever.js +73 -23
- package/r-bridge/shell-executor.d.ts +11 -0
- package/r-bridge/shell-executor.js +50 -0
- package/r-bridge/shell.d.ts +12 -31
- package/r-bridge/shell.js +36 -94
- package/reconstruct/reconstruct.d.ts +1 -1
- package/slicing/criterion/collect-all.d.ts +3 -3
- package/slicing/criterion/filters/all-variables.d.ts +1 -1
- package/slicing/criterion/parse.d.ts +1 -1
- package/slicing/static/static-slicer.d.ts +3 -3
- package/statistics/features/common-syntax-probability.d.ts +3 -2
- package/statistics/features/common-syntax-probability.js +0 -3
- package/statistics/features/feature.d.ts +6 -6
- package/statistics/features/post-processing.d.ts +2 -2
- package/statistics/features/supported/assignments/assignments.d.ts +2 -2
- package/statistics/features/supported/assignments/post-process.d.ts +2 -2
- package/statistics/features/supported/assignments/post-process.js +6 -6
- package/statistics/features/supported/comments/comments.d.ts +2 -2
- package/statistics/features/supported/comments/post-process.d.ts +2 -2
- package/statistics/features/supported/comments/post-process.js +2 -2
- package/statistics/features/supported/control-flow/control-flow.d.ts +2 -2
- package/statistics/features/supported/control-flow/post-process.d.ts +2 -2
- package/statistics/features/supported/data-access/data-access.d.ts +3 -3
- package/statistics/features/supported/data-access/post-process.d.ts +2 -2
- package/statistics/features/supported/data-access/post-process.js +4 -4
- package/statistics/features/supported/defined-functions/defined-functions.d.ts +4 -4
- package/statistics/features/supported/defined-functions/post-process.d.ts +2 -2
- package/statistics/features/supported/defined-functions/post-process.js +4 -4
- package/statistics/features/supported/expression-list/expression-list.d.ts +2 -2
- package/statistics/features/supported/expression-list/post-process.d.ts +2 -2
- package/statistics/features/supported/expression-list/post-process.js +3 -3
- package/statistics/features/supported/loops/loops.d.ts +2 -2
- package/statistics/features/supported/loops/post-process.d.ts +2 -2
- package/statistics/features/supported/loops/post-process.js +3 -3
- package/statistics/features/supported/used-functions/post-process.d.ts +2 -2
- package/statistics/features/supported/used-functions/post-process.js +5 -5
- package/statistics/features/supported/used-functions/used-functions.d.ts +3 -3
- package/statistics/features/supported/used-packages/post-process.d.ts +2 -2
- package/statistics/features/supported/used-packages/post-process.js +5 -5
- package/statistics/features/supported/used-packages/used-packages.d.ts +2 -2
- package/statistics/features/supported/values/post-process.d.ts +2 -2
- package/statistics/features/supported/values/post-process.js +3 -3
- package/statistics/features/supported/values/values.d.ts +2 -2
- package/statistics/features/supported/variables/post-process.d.ts +3 -3
- package/statistics/features/supported/variables/post-process.js +3 -3
- package/statistics/features/supported/variables/variables.d.ts +2 -2
- package/statistics/meta-statistics.d.ts +1 -1
- package/statistics/output/ansi.js +1 -1
- package/statistics/output/print-stats.d.ts +2 -2
- package/statistics/output/statistics-file.d.ts +1 -1
- package/statistics/statistics.d.ts +4 -4
- package/statistics/statistics.js +7 -8
- package/util/args.d.ts +8 -4
- package/util/args.js +11 -4
- package/util/{cfg.d.ts → cfg/cfg.d.ts} +18 -6
- package/util/{cfg.js → cfg/cfg.js} +42 -37
- package/util/cfg/visitor.d.ts +14 -0
- package/util/cfg/visitor.js +64 -0
- package/util/diff.d.ts +1 -1
- package/util/files.d.ts +7 -1
- package/util/files.js +11 -1
- package/util/log.js +3 -0
- package/util/mermaid/ast.d.ts +1 -1
- package/util/mermaid/cfg.d.ts +2 -2
- package/util/mermaid/dfg.d.ts +3 -3
- package/util/objects.d.ts +1 -1
- package/util/quads.d.ts +2 -2
- package/util/summarizer/benchmark/data.d.ts +1 -1
- package/util/summarizer/benchmark/first-phase/input.d.ts +2 -1
- package/util/summarizer/benchmark/first-phase/input.js +20 -4
- package/util/summarizer/benchmark/first-phase/process.d.ts +4 -3
- package/util/summarizer/benchmark/first-phase/process.js +14 -5
- package/util/summarizer/benchmark/second-phase/graph.d.ts +1 -1
- package/util/summarizer/benchmark/second-phase/graph.js +1 -1
- package/util/summarizer/benchmark/second-phase/process.d.ts +3 -1
- package/util/summarizer/benchmark/second-phase/process.js +48 -11
- package/util/summarizer/benchmark/summarizer.d.ts +3 -6
- package/util/summarizer/benchmark/summarizer.js +16 -11
- package/util/summarizer/statistics/first-phase/process.js +8 -8
- package/util/summarizer/statistics/post-process/clusterer.d.ts +2 -2
- package/util/summarizer/statistics/post-process/file-based-count.d.ts +1 -1
- package/util/summarizer/statistics/post-process/histogram.d.ts +2 -2
- package/util/summarizer/statistics/post-process/post-process-output.d.ts +2 -2
- package/util/summarizer/statistics/post-process/post-process-output.js +4 -5
- package/util/summarizer/statistics/second-phase/process.d.ts +2 -2
- package/util/summarizer/statistics/summarizer.d.ts +3 -2
- package/util/summarizer/summarizer.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/xml/config.d.ts +0 -25
- package/r-bridge/lang-4.x/ast/parser/xml/config.js +0 -16
- package/r-bridge/lang-4.x/ast/parser/xml/internal/xml-to-json.d.ts +0 -9
- package/r-bridge/lang-4.x/ast/parser/xml/internal/xml-to-json.js +0 -51
- package/r-bridge/lang-4.x/ast/parser/xml/parser.d.ts +0 -17
- package/r-bridge/lang-4.x/ast/parser/xml/parser.js +0 -30
package/r-bridge/shell.js
CHANGED
|
@@ -26,16 +26,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.RShell = exports.DEFAULT_R_SHELL_OPTIONS = exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = void 0;
|
|
29
|
+
exports.RShell = exports.DEFAULT_R_SHELL_OPTIONS = exports.DEFAULT_R_SHELL_EXEC_OPTIONS = exports.DEFAULT_R_PATH = exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = void 0;
|
|
30
30
|
const child_process_1 = require("child_process");
|
|
31
31
|
const objects_1 = require("../util/objects");
|
|
32
|
-
const readline = __importStar(require("
|
|
32
|
+
const readline = __importStar(require("readline"));
|
|
33
33
|
const lang_4_x_1 = require("./lang-4.x");
|
|
34
34
|
const log_1 = require("../util/log");
|
|
35
35
|
const preload_1 = __importDefault(require("semver/preload"));
|
|
36
36
|
const os_1 = require("../util/os");
|
|
37
37
|
const fs_1 = __importDefault(require("fs"));
|
|
38
|
-
const
|
|
38
|
+
const config_1 = require("../config");
|
|
39
39
|
exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = {
|
|
40
40
|
from: 'stdout',
|
|
41
41
|
postamble: `🐧${'-'.repeat(5)}🐧`,
|
|
@@ -47,14 +47,18 @@ exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = {
|
|
|
47
47
|
automaticallyTrimOutput: true,
|
|
48
48
|
errorStopsWaiting: true
|
|
49
49
|
};
|
|
50
|
-
exports.
|
|
51
|
-
|
|
52
|
-
pathToRExecutable: (0,
|
|
50
|
+
exports.DEFAULT_R_PATH = (0, os_1.getPlatform)() === 'windows' ? 'R.exe' : 'R';
|
|
51
|
+
exports.DEFAULT_R_SHELL_EXEC_OPTIONS = {
|
|
52
|
+
pathToRExecutable: (0, config_1.getConfig)().rPath ?? exports.DEFAULT_R_PATH,
|
|
53
53
|
commandLineOptions: ['--vanilla', '--quiet', '--no-echo', '--no-save'],
|
|
54
54
|
cwd: process.cwd(),
|
|
55
55
|
env: process.env,
|
|
56
56
|
eol: '\n',
|
|
57
|
-
homeLibPath: (0, os_1.getPlatform)() === 'windows' ? undefined : '~/.r-libs'
|
|
57
|
+
homeLibPath: (0, os_1.getPlatform)() === 'windows' ? undefined : '~/.r-libs'
|
|
58
|
+
};
|
|
59
|
+
exports.DEFAULT_R_SHELL_OPTIONS = {
|
|
60
|
+
...exports.DEFAULT_R_SHELL_EXEC_OPTIONS,
|
|
61
|
+
sessionName: 'default',
|
|
58
62
|
revive: 'never',
|
|
59
63
|
onRevive: () => { }
|
|
60
64
|
};
|
|
@@ -71,7 +75,6 @@ class RShell {
|
|
|
71
75
|
session;
|
|
72
76
|
log;
|
|
73
77
|
versionCache = null;
|
|
74
|
-
tokenMapCache = null;
|
|
75
78
|
// should never be more than one, but let's be sure
|
|
76
79
|
tempDirs = new Set();
|
|
77
80
|
constructor(options) {
|
|
@@ -113,30 +116,28 @@ class RShell {
|
|
|
113
116
|
this.versionCache = preload_1.default.coerce(result[0]);
|
|
114
117
|
return result.length === 1 ? this.versionCache : null;
|
|
115
118
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
* @note For multiple calls, this makes use of caching
|
|
120
|
-
*/
|
|
121
|
-
async tokenMap() {
|
|
122
|
-
if (this.tokenMapCache === null) {
|
|
123
|
-
this.tokenMapCache = await this.retrieveTokenMap();
|
|
124
|
-
}
|
|
125
|
-
return this.tokenMapCache;
|
|
119
|
+
injectLibPaths(...paths) {
|
|
120
|
+
this.log.debug(`injecting lib paths ${JSON.stringify(paths)}`);
|
|
121
|
+
this._sendCommand(`.libPaths(c(.libPaths(), ${paths.map(lang_4_x_1.ts2r).join(',')}))`);
|
|
126
122
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
tryToInjectHomeLibPath() {
|
|
124
|
+
// ensure the path exists first
|
|
125
|
+
if (this.options.homeLibPath === undefined) {
|
|
126
|
+
this.log.debug('ensuring home lib path exists (automatic inject)');
|
|
127
|
+
this.sendCommand('if(!dir.exists(Sys.getenv("R_LIBS_USER"))) { dir.create(path=Sys.getenv("R_LIBS_USER"),showWarnings=FALSE,recursive=TRUE) }');
|
|
128
|
+
this.sendCommand('.libPaths(c(.libPaths(), Sys.getenv("R_LIBS_USER")))');
|
|
133
129
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
for (const [key, value] of parsed) {
|
|
137
|
-
cache[value] = (0, retriever_1.removeTokenMapQuotationMarks)(key);
|
|
130
|
+
else {
|
|
131
|
+
this.injectLibPaths(this.options.homeLibPath);
|
|
138
132
|
}
|
|
139
|
-
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* checks if a given package is already installed on the system!
|
|
136
|
+
*/
|
|
137
|
+
async isPackageInstalled(packageName) {
|
|
138
|
+
this.log.debug(`checking if package "${packageName}" is installed`);
|
|
139
|
+
const result = await this.sendCommandWithOutput(`cat(system.file(package="${packageName}")!="","${this.options.eol}")`);
|
|
140
|
+
return result.length === 1 && result[0] === 'TRUE';
|
|
140
141
|
}
|
|
141
142
|
/**
|
|
142
143
|
* Send a command and collect the output
|
|
@@ -194,69 +195,6 @@ class RShell {
|
|
|
194
195
|
this.log.info('continue in case of Errors');
|
|
195
196
|
this._sendCommand('options(error=function() {})');
|
|
196
197
|
}
|
|
197
|
-
injectLibPaths(...paths) {
|
|
198
|
-
this.log.debug(`injecting lib paths ${JSON.stringify(paths)}`);
|
|
199
|
-
this._sendCommand(`.libPaths(c(.libPaths(), ${paths.map(lang_4_x_1.ts2r).join(',')}))`);
|
|
200
|
-
}
|
|
201
|
-
tryToInjectHomeLibPath() {
|
|
202
|
-
// ensure the path exists first
|
|
203
|
-
if (this.options.homeLibPath === undefined) {
|
|
204
|
-
this.log.debug('ensuring home lib path exists (automatic inject)');
|
|
205
|
-
this.sendCommand('if(!dir.exists(Sys.getenv("R_LIBS_USER"))) { dir.create(path=Sys.getenv("R_LIBS_USER"),showWarnings=FALSE,recursive=TRUE) }');
|
|
206
|
-
this.sendCommand('.libPaths(c(.libPaths(), Sys.getenv("R_LIBS_USER")))');
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
this.injectLibPaths(this.options.homeLibPath);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* checks if a given package is already installed on the system!
|
|
214
|
-
*/
|
|
215
|
-
async isPackageInstalled(packageName) {
|
|
216
|
-
this.log.debug(`checking if package "${packageName}" is installed`);
|
|
217
|
-
const result = await this.sendCommandWithOutput(`cat(system.file(package="${packageName}")!="","${this.options.eol}")`);
|
|
218
|
-
return result.length === 1 && result[0] === 'TRUE';
|
|
219
|
-
}
|
|
220
|
-
async allInstalledPackages() {
|
|
221
|
-
this.log.debug('getting all installed packages');
|
|
222
|
-
const [packages] = await this.sendCommandWithOutput(`cat(paste0(installed.packages()[,1], collapse=","),"${this.options.eol}")`);
|
|
223
|
-
return packages.split(',');
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Installs the package using a temporary location
|
|
227
|
-
*
|
|
228
|
-
* @param packageName - The package to install
|
|
229
|
-
* @param autoload - If true, the package will be loaded after installation
|
|
230
|
-
* @param force - If true, the package will be installed no if it is already on the system and ready to be loaded
|
|
231
|
-
*/
|
|
232
|
-
async ensurePackageInstalled(packageName, autoload = false, force = false) {
|
|
233
|
-
const packageExistedAlready = await this.isPackageInstalled(packageName);
|
|
234
|
-
if (!force && packageExistedAlready) {
|
|
235
|
-
this.log.info(`package "${packageName}" is already installed`);
|
|
236
|
-
if (autoload) {
|
|
237
|
-
this.sendCommand(`library(${(0, lang_4_x_1.ts2r)(packageName)})`);
|
|
238
|
-
}
|
|
239
|
-
return {
|
|
240
|
-
packageName,
|
|
241
|
-
packageExistedAlready: true
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
// obtain a temporary directory
|
|
245
|
-
const tempdir = await this.obtainTmpDir();
|
|
246
|
-
this.log.debug(`using temporary directory: "${tempdir}" to install package "${packageName}"`);
|
|
247
|
-
await this.sendCommandWithOutput(`install.packages(${(0, lang_4_x_1.ts2r)(packageName)},repos="https://cloud.r-project.org/",quiet=FALSE,lib=temp)`, {
|
|
248
|
-
ms: 750_000,
|
|
249
|
-
resetOnNewData: true
|
|
250
|
-
});
|
|
251
|
-
if (autoload) {
|
|
252
|
-
this.sendCommand(`library(${(0, lang_4_x_1.ts2r)(packageName)},lib.loc=temp)`);
|
|
253
|
-
}
|
|
254
|
-
return {
|
|
255
|
-
packageName,
|
|
256
|
-
libraryLocation: tempdir,
|
|
257
|
-
packageExistedAlready
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
198
|
/**
|
|
261
199
|
* Obtain the temporary directory used by R.
|
|
262
200
|
* Additionally, this marks the directory for removal when the shell exits.
|
|
@@ -304,7 +242,9 @@ class RShellSession {
|
|
|
304
242
|
input: this.bareSession.stderr,
|
|
305
243
|
terminal: false
|
|
306
244
|
});
|
|
307
|
-
this.onExit(() => {
|
|
245
|
+
this.onExit(() => {
|
|
246
|
+
this.end();
|
|
247
|
+
});
|
|
308
248
|
this.options = options;
|
|
309
249
|
this.log = log;
|
|
310
250
|
this.setupRSessionLoggers();
|
|
@@ -348,7 +288,9 @@ class RShellSession {
|
|
|
348
288
|
this.collectionTimeout = makeTimer();
|
|
349
289
|
}
|
|
350
290
|
};
|
|
351
|
-
error = () => {
|
|
291
|
+
error = () => {
|
|
292
|
+
resolve(result);
|
|
293
|
+
};
|
|
352
294
|
this.onExit(error);
|
|
353
295
|
this.on(from, 'line', handler);
|
|
354
296
|
action?.();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* as the file itself is way too long). See {@link reconstructToCode}.
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { NormalizedAst, NodeId, ParentInformation, RNode } from '../r-bridge';
|
|
6
|
+
import type { NormalizedAst, NodeId, ParentInformation, RNode } from '../r-bridge';
|
|
7
7
|
type Selection = Set<NodeId>;
|
|
8
8
|
export declare const reconstructLogger: import("tslog").Logger<import("tslog").ILogObj>;
|
|
9
9
|
/** The structure of the predicate that should be used to determine if a given normalized node should be included in the reconstructed code independent of if it is selected by the slice or not */
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* This module provides a function to collect all slicing criteria.
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { MergeableRecord } from '../../util/objects';
|
|
7
|
-
import { NodeId, RNodeWithParent } from '../../r-bridge';
|
|
8
|
-
import { SlicingCriteria } from './parse';
|
|
6
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
7
|
+
import type { NodeId, RNodeWithParent } from '../../r-bridge';
|
|
8
|
+
import type { SlicingCriteria } from './parse';
|
|
9
9
|
/**
|
|
10
10
|
* Defines the filter for collecting all possible slicing criteria.
|
|
11
11
|
* @see DefaultAllVariablesFilter
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SlicingCriteriaFilter } from '../collect-all';
|
|
1
|
+
import type { SlicingCriteriaFilter } from '../collect-all';
|
|
2
2
|
export declare const DefaultAllVariablesFilter: SlicingCriteriaFilter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalizedAst, NodeId, NoInfo, ParentInformation } from '../../r-bridge';
|
|
1
|
+
import type { NormalizedAst, NodeId, NoInfo, ParentInformation } from '../../r-bridge';
|
|
2
2
|
/** Either `line:column`, `line@variable-name`, or `$id` */
|
|
3
3
|
export type SingleSlicingCriterion = `${number}:${number}` | `${number}@${string}` | `$${number}`;
|
|
4
4
|
export type SlicingCriteria = SingleSlicingCriterion[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DataflowGraph } from '../../dataflow';
|
|
2
|
-
import { NodeId, NormalizedAst } from '../../r-bridge';
|
|
3
|
-
import { DecodedCriteria, SlicingCriteria } from '../criterion';
|
|
1
|
+
import type { DataflowGraph } from '../../dataflow';
|
|
2
|
+
import type { NodeId, NormalizedAst } from '../../r-bridge';
|
|
3
|
+
import type { DecodedCriteria, SlicingCriteria } from '../criterion';
|
|
4
4
|
export declare const slicerLogger: import("tslog").Logger<import("tslog").ILogObj>;
|
|
5
5
|
/**
|
|
6
6
|
* The result of the slice step
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Defines the type of syntax constructs that we track (e.g., true, false, 0, 1, T, F, conditions...)
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import type { RNodeWithParent } from '../../r-bridge';
|
|
5
|
+
import { RFalse, RTrue } from '../../r-bridge';
|
|
6
|
+
import type { SummarizedMeasurement } from '../../util/summarizer/benchmark/data';
|
|
6
7
|
export interface CommonSyntaxTypeCounts<Measurement = bigint> {
|
|
7
8
|
total: Measurement;
|
|
8
9
|
multiple: Measurement;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.summarizeCommonSyntaxTypeCounter = exports.appendCommonSyntaxTypeCounter = exports.updateCommonSyntaxTypeCounts = exports.emptyCommonSyntaxTypeCounts = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Defines the type of syntax constructs that we track (e.g., true, false, 0, 1, T, F, conditions...)
|
|
6
|
-
*/
|
|
7
4
|
const r_bridge_1 = require("../../r-bridge");
|
|
8
5
|
const process_1 = require("../../util/summarizer/benchmark/first-phase/process");
|
|
9
6
|
const numbers_1 = require("../../util/numbers");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EvalOptions } from 'xpath-ts2/src/parse-api';
|
|
2
|
-
import { MergeableRecord } from '../../util/objects';
|
|
3
|
-
import { NormalizedAst } from '../../r-bridge';
|
|
4
|
-
import { DataflowInformation } from '../../dataflow/internal/info';
|
|
5
|
-
import { MetaStatistics } from '../meta-statistics';
|
|
6
|
-
import { StatisticsSummarizerConfiguration } from '../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { EvalOptions } from 'xpath-ts2/src/parse-api';
|
|
2
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
3
|
+
import type { NormalizedAst } from '../../r-bridge';
|
|
4
|
+
import type { DataflowInformation } from '../../dataflow/internal/info';
|
|
5
|
+
import type { MetaStatistics } from '../meta-statistics';
|
|
6
|
+
import type { StatisticsSummarizerConfiguration } from '../../util/summarizer/statistics/summarizer';
|
|
7
7
|
/**
|
|
8
8
|
* Maps each sub-feature name to the number of occurrences of that sub-feature.
|
|
9
9
|
* Allows for one nesting level to denote hierarchical features.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MergeableRecord } from '../../util/objects';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export interface SummarizedWithProject<Uniques = Set<string>, Count = number[]> {
|
|
4
4
|
uniqueProjects: Uniques;
|
|
5
5
|
uniqueFiles: Uniques;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
declare const initialAssignmentInfo: {
|
|
4
4
|
assignmentOperator: Record<string, bigint>;
|
|
5
5
|
assigned: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.postProcess = void 0;
|
|
7
7
|
const common_syntax_probability_1 = require("../../common-syntax-probability");
|
|
8
8
|
const numbers_1 = require("../../../../util/numbers");
|
|
9
|
-
const
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
11
|
const data_1 = require("../../../../util/summarizer/benchmark/data");
|
|
12
12
|
const process_1 = require("../../../../util/summarizer/benchmark/first-phase/process");
|
|
@@ -35,7 +35,7 @@ function retrieveUsageCombinationCounts(collected) {
|
|
|
35
35
|
return new Map();
|
|
36
36
|
}
|
|
37
37
|
const allCombinations = [...(0, arrays_1.getUniqueCombinationsOfSize)(ops, 1)];
|
|
38
|
-
const store = new Map;
|
|
38
|
+
const store = new Map();
|
|
39
39
|
for (const combs of allCombinations) {
|
|
40
40
|
if (combs.length === 1) {
|
|
41
41
|
// we can just copy the information
|
|
@@ -61,7 +61,7 @@ function retrieveUsageCombinationCounts(collected) {
|
|
|
61
61
|
function writeOperatorCombinationsUsageToCsv(collected, outputPath) {
|
|
62
62
|
// now to get all projects exhausted with _only_ a given subset (e.g., all projects only using '=')
|
|
63
63
|
const operators = retrieveUsageCombinationCounts(collected);
|
|
64
|
-
const out =
|
|
64
|
+
const out = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'assignments-assigned-combinations.csv'));
|
|
65
65
|
out.write('assignment,unique-projects,unique-files\n');
|
|
66
66
|
for (const [key, val] of operators.entries()) {
|
|
67
67
|
out.write(`${JSON.stringify(key)},${val.uniqueProjects},${val.uniqueFiles}\n`);
|
|
@@ -69,7 +69,7 @@ function writeOperatorCombinationsUsageToCsv(collected, outputPath) {
|
|
|
69
69
|
out.close();
|
|
70
70
|
}
|
|
71
71
|
function writeAssignmentMetadataToCsv(outputPath, collected) {
|
|
72
|
-
const out =
|
|
72
|
+
const out = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'assignments-meta.csv'));
|
|
73
73
|
out.write(`kind,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
74
74
|
const summarizedDeepestNesting = (0, process_1.summarizeMeasurement)(collected.deepestNesting.flat());
|
|
75
75
|
out.write(`deepest-nesting,${(0, data_1.summarizedMeasurement2Csv)(summarizedDeepestNesting)}\n`);
|
|
@@ -78,7 +78,7 @@ function writeAssignmentMetadataToCsv(outputPath, collected) {
|
|
|
78
78
|
out.close();
|
|
79
79
|
}
|
|
80
80
|
function writeAssignedTypesToCsv(outputPath, collected) {
|
|
81
|
-
const out =
|
|
81
|
+
const out = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'assignments-assigned.csv'));
|
|
82
82
|
out.write(`kind,name,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
83
83
|
for (const [entryName, values] of Object.entries(collected.assigned)) {
|
|
84
84
|
if (Array.isArray(values)) {
|
|
@@ -93,7 +93,7 @@ function writeAssignedTypesToCsv(outputPath, collected) {
|
|
|
93
93
|
out.close();
|
|
94
94
|
}
|
|
95
95
|
function writeAssignmentOperatorsToCsv(outputPath, collected) {
|
|
96
|
-
const fnOutStream =
|
|
96
|
+
const fnOutStream = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'assignments-assignment-operators.csv'));
|
|
97
97
|
fnOutStream.write(`assignment,unique-projects,unique-files,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
98
98
|
for (const [key, val] of Object.entries(collected.assignmentOperator)) {
|
|
99
99
|
const { uniqueProjects, uniqueFiles, counts } = val;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
export declare const initialCommentInfo: {
|
|
4
4
|
totalAmount: number;
|
|
5
5
|
roxygenComments: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -7,7 +7,7 @@ exports.postProcess = void 0;
|
|
|
7
7
|
const data_1 = require("../../../../util/summarizer/benchmark/data");
|
|
8
8
|
const comments_1 = require("./comments");
|
|
9
9
|
const assert_1 = require("../../../../util/assert");
|
|
10
|
-
const
|
|
10
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
11
|
const path_1 = __importDefault(require("path"));
|
|
12
12
|
const process_1 = require("../../../../util/summarizer/benchmark/first-phase/process");
|
|
13
13
|
// monoids would be helpful :c
|
|
@@ -37,7 +37,7 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
37
37
|
for (const [filepath, feature] of info.entries()) {
|
|
38
38
|
appendCommentsPostProcessing(collected, feature.comments, feature.stats.lines[0].length, filepath, config.projectSkip);
|
|
39
39
|
}
|
|
40
|
-
const fnOutStream =
|
|
40
|
+
const fnOutStream = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'comments.csv'));
|
|
41
41
|
fnOutStream.write(`kind,unique-projects,unique-files,${(0, data_1.summarizedMeasurement2CsvHeader)('count')},${(0, data_1.summarizedMeasurement2CsvHeader)('frac-of-lines')}\n`);
|
|
42
42
|
for (const [key, val] of Object.entries(collected)) {
|
|
43
43
|
const { count, uniqueProjects, uniqueFiles, fracOfLines } = val;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
declare const initialControlflowInfo: {
|
|
4
4
|
ifThen: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
5
5
|
thenBody: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
3
|
-
import { CommonSyntaxTypeCounts } from '../../common-syntax-probability';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
|
+
import type { CommonSyntaxTypeCounts } from '../../common-syntax-probability';
|
|
4
4
|
declare const initialDataAccessInfo: {
|
|
5
5
|
singleBracket: Record<number, bigint | CommonSyntaxTypeCounts<bigint>>;
|
|
6
6
|
doubleBracket: Record<number, bigint | CommonSyntaxTypeCounts<bigint>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -8,7 +8,7 @@ const data_1 = require("../../../../util/summarizer/benchmark/data");
|
|
|
8
8
|
const common_syntax_probability_1 = require("../../common-syntax-probability");
|
|
9
9
|
const post_processing_1 = require("../../post-processing");
|
|
10
10
|
const numbers_1 = require("../../../../util/numbers");
|
|
11
|
-
const
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
12
|
const path_1 = __importDefault(require("path"));
|
|
13
13
|
const process_1 = require("../../../../util/summarizer/benchmark/first-phase/process");
|
|
14
14
|
function addToList(data, dataAccess, filepath, config) {
|
|
@@ -37,7 +37,7 @@ function summarizeForBracket(dataAccess, data, filepath, config) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
function writeSingleOrDoubleEmpty(outputPath, key, name, vals) {
|
|
40
|
-
const out =
|
|
40
|
+
const out = fs_1.default.createWriteStream(path_1.default.join(outputPath, `data-access-type-${key}-${name}.csv`));
|
|
41
41
|
// name is for fields like number etc. to allow to group multiple entries
|
|
42
42
|
out.write(`kind,unique-projects,unique-files,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
43
43
|
out.write(`"0",${vals.uniqueProjects.size},${vals.uniqueFiles.size},${(0, data_1.summarizedMeasurement2Csv)((0, process_1.summarizeMeasurement)(vals.count))}\n`);
|
|
@@ -51,7 +51,7 @@ function writeSingleOrDoubleBrackets(data, outputPath, key) {
|
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
53
|
// non-0-column
|
|
54
|
-
const out =
|
|
54
|
+
const out = fs_1.default.createWriteStream(path_1.default.join(outputPath, `data-access-type-${key}-${name}.csv`));
|
|
55
55
|
// name is for fields like number etc. to allow to group multiple entries
|
|
56
56
|
out.write(`kind,name,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
57
57
|
for (const [entryName, values] of Object.entries(vals)) {
|
|
@@ -91,7 +91,7 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
91
91
|
summarizeForBracket(dataAccess.singleBracket, summarize.singleBracket, filepath, config);
|
|
92
92
|
summarizeForBracket(dataAccess.doubleBracket, summarize.doubleBracket, filepath, config);
|
|
93
93
|
}
|
|
94
|
-
const metaOut =
|
|
94
|
+
const metaOut = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'data-access-meta.csv'));
|
|
95
95
|
metaOut.write(`kind,unique-projects,unique-files,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
96
96
|
for (const [key, value] of Object.entries(summarize)) {
|
|
97
97
|
const data = value;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
3
|
-
import { SourcePosition } from '../../../../util/range';
|
|
4
|
-
import { MergeableRecord } from '../../../../util/objects';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
|
+
import type { SourcePosition } from '../../../../util/range';
|
|
4
|
+
import type { MergeableRecord } from '../../../../util/objects';
|
|
5
5
|
declare const initialFunctionDefinitionInfo: {
|
|
6
6
|
/** all, anonymous, assigned, non-assigned, ... */
|
|
7
7
|
total: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
/**
|
|
4
4
|
* Note: the summary does not contain a 0 for each function that is _not_ called by a file. Hence, the minimum can not be 0 (division for mean etc. will still be performed on total file count)
|
|
5
5
|
*/
|
|
@@ -8,7 +8,7 @@ const data_1 = require("../../../../util/summarizer/benchmark/data");
|
|
|
8
8
|
const process_1 = require("../../../../util/summarizer/benchmark/first-phase/process");
|
|
9
9
|
const files_1 = require("../../../../util/files");
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
12
|
const time_1 = require("../../../../util/time");
|
|
13
13
|
const defined_functions_1 = require("./defined-functions");
|
|
14
14
|
const post_processing_1 = require("../../post-processing");
|
|
@@ -42,7 +42,7 @@ function retrievePerFileDefinitionInformation(featureRoot, info, config, outputP
|
|
|
42
42
|
// we collect only `all-calls`
|
|
43
43
|
(0, files_1.readLineByLineSync)(path_1.default.join(featureRoot, `${defined_functions_1.AllDefinitionsFileBase}.txt`), (line, lineNumber) => processNextLine(definitionsPerFile, lineNumber, info, JSON.parse(String(line))));
|
|
44
44
|
console.log(` [${(0, time_1.date2string)(new Date())}] Defined functions process completed, start to write out function info`);
|
|
45
|
-
const fnOutStream =
|
|
45
|
+
const fnOutStream = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'function-definitions.csv'));
|
|
46
46
|
const prefixes = ['total', 'params', 'length-lines', 'length-chars', 'length-non-ws-chars', 'return-explicit', 'return-implicit', 'return-only-explicit', 'return-only-implicit', 'exit-points-line-crac', 'def-line-frac'];
|
|
47
47
|
const others = prefixes.flatMap(data_1.summarizedMeasurement2CsvHeader).join(',');
|
|
48
48
|
fnOutStream.write(`counter,${others}\n`);
|
|
@@ -84,7 +84,7 @@ function retrieveMetaInformation(info, config, outputPath) {
|
|
|
84
84
|
addToList(data.deepestNesting, us.deepestNesting, filepath, config);
|
|
85
85
|
}
|
|
86
86
|
console.log(` [${(0, time_1.date2string)(new Date())}] Defined functions metadata reading completed, summarizing and writing to file`);
|
|
87
|
-
const out =
|
|
87
|
+
const out = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'function-definitions-meta.csv'));
|
|
88
88
|
out.write(`kind,unique-projects,unique-files,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
89
89
|
for (const [key, val] of Object.entries(data)) {
|
|
90
90
|
const data = val;
|
|
@@ -107,7 +107,7 @@ function retrieveAssignedFunctionNames(featureRoot, config, outputPath) {
|
|
|
107
107
|
addToList(get, count, context ?? '', config);
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
-
const varNamesOut =
|
|
110
|
+
const varNamesOut = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'function-definitions-var-names.csv'));
|
|
111
111
|
varNamesOut.write(`name,unique-projects,unique-files,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
112
112
|
for (const [key, val] of varNames.entries()) {
|
|
113
113
|
varNamesOut.write(`${JSON.stringify(key)},${val.uniqueProjects.size},${val.uniqueFiles.size},${(0, data_1.summarizedMeasurement2Csv)((0, process_1.summarizeMeasurement)(val.count))}\n`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Writable } from 'ts-essentials';
|
|
2
|
-
import { Feature } from '../../feature';
|
|
1
|
+
import type { Writable } from 'ts-essentials';
|
|
2
|
+
import type { Feature } from '../../feature';
|
|
3
3
|
declare const initialExpressionListInfo: {
|
|
4
4
|
allExpressionLists: number;
|
|
5
5
|
deepestNesting: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -5,13 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.postProcess = void 0;
|
|
7
7
|
const post_processing_1 = require("../../post-processing");
|
|
8
|
-
const
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const data_1 = require("../../../../util/summarizer/benchmark/data");
|
|
11
11
|
const process_1 = require("../../../../util/summarizer/benchmark/first-phase/process");
|
|
12
12
|
function postProcess(featureRoot, info, outputPath, config) {
|
|
13
13
|
const collected = {};
|
|
14
|
-
const deepestNestingOut =
|
|
14
|
+
const deepestNestingOut = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'deepest-nesting-per-file.csv'));
|
|
15
15
|
deepestNestingOut.write('file,deepest-nesting\n');
|
|
16
16
|
for (const [filepath, data] of info.entries()) {
|
|
17
17
|
const value = data.expressionList;
|
|
@@ -31,7 +31,7 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
deepestNestingOut.close();
|
|
34
|
-
const variablesOutStream =
|
|
34
|
+
const variablesOutStream = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'used-expression-lists.csv'));
|
|
35
35
|
variablesOutStream.write(`kind,unique-projects,unique-files,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
36
36
|
for (const [key, val] of Object.entries(collected)) {
|
|
37
37
|
const data = val;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
declare const initialLoopInfo: {
|
|
4
4
|
forLoops: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
5
5
|
forLoopVar: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -8,7 +8,7 @@ const post_processing_1 = require("../../post-processing");
|
|
|
8
8
|
const common_syntax_probability_1 = require("../../common-syntax-probability");
|
|
9
9
|
const numbers_1 = require("../../../../util/numbers");
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
12
|
const data_1 = require("../../../../util/summarizer/benchmark/data");
|
|
13
13
|
const process_1 = require("../../../../util/summarizer/benchmark/first-phase/process");
|
|
14
14
|
function postProcess(featureRoot, info, outputPath, config) {
|
|
@@ -41,7 +41,7 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const metaOut =
|
|
44
|
+
const metaOut = fs_1.default.createWriteStream(path_1.default.join(outputPath, 'loops-meta.csv'));
|
|
45
45
|
metaOut.write(`kind,unique-projects,unique-files,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
46
46
|
for (const [key, val] of Object.entries(collected)) {
|
|
47
47
|
const data = val;
|
|
@@ -50,7 +50,7 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
52
|
// new file for each :D
|
|
53
|
-
const out =
|
|
53
|
+
const out = fs_1.default.createWriteStream(path_1.default.join(outputPath, `loops-type-${key}.csv`));
|
|
54
54
|
// name is for fields like number etc to allow to group multiple entries
|
|
55
55
|
out.write(`kind,name,${(0, data_1.summarizedMeasurement2CsvHeader)()}\n`);
|
|
56
56
|
for (const [name, vals] of Object.entries(data)) {
|