-
Notifications
You must be signed in to change notification settings - Fork 8
Analyzer
This document was generated from 'src/documentation/print-analyzer-wiki.ts' on 2025-09-29, 19:41:24 UTC presenting an overview of flowR's analyzer (v2.5.0, using R v4.5.0). Please do not edit this file/wiki page directly.
We are currently working on documenting the capabilities of the analyzer (with the plugins, their loading order, etc.). In general, the code documentation
starting with the FlowrAnalyzer
and the FlowrAnalyzerBuilder
should be the best starting point.
No matter whether you want to analyze a single R script, a couple of R notebooks, or a complete project,
your journey starts with the FlowrAnalyzerBuilder
(further described in Builder Configuration below).
This builder allows you to configure the analysis in many different ways, for example, by specifying which files to analyze, which plugins to use, or
what Engine to use for the analysis.
Note
If you want to quickly try out the analyzer, you can use the following code snippet that analyzes a simple R expression:
const analyzer = await new FlowrAnalyzerBuilder()
.addRequestFromInput('x <- 1; print(x)')
.setEngine('tree-sitter')
.build();
// get the dataflow
const df = await analyzer.dataflow();
// obtain the identified loading order
console.log(analyzer.inspectContext().files.loadingOrder.getLoadingOrder());
// run a dependency query
const results = await analyzer.query([{ type: 'dependencies' }]);
TODO: mention Context
TODO also explain buildSync and that TreeSitter has to be initialized for this
During the construction of a new FlowrAnalyzer
, plugins of different types are applied at different stages of the analysis.
These plugins are grouped by their PluginType
and are applied in the following order (as shown in the documentation of the PluginType
):
┌───────────┐ ┌───────────────────┐ ┌─────────────┐ ┌───────────────┐ ┌───────┐
│ │ │ │ │ │ │ │ │ │
│ *Builder* ├──>│ Project Discovery ├──>│ File Loader ├──>│ Dependencies ├──>│ *DFA* │
│ │ │ (if necessary) │ │ │ │ (static) │ │ │
└───────────┘ └───────────────────┘ └──────┬──────┘ └───────────────┘ └───────┘
│ ▲
│ ┌───────────────┐ │
│ │ │ │
└─────────>│ Loading Order ├───────┘
│ │
└───────────────┘
We describe the different plugin types in more detail below.
Currently maintained by Florian Sihler at Ulm University
Email | GitHub | Penguins | Portfolio
- 🧑💻 Developer Onboarding
- 💻 Setup
- 👓 Overview
- 🪟 Interfacing with flowR
- 🌋 Core
- 🧹 Linting & Testing (Benchmark Page)
⁉️ FAQ- ℹ️ Extra Information