@eagleoutice/flowr - v2.13.2
    Preparing search index...

    Interface FlowrConfig

    The configuration file format for flowR.

    interface FlowrConfig {
        abstractInterpretation: {
            dataFrame: {
                maxColNames: number;
                readLoadedData: { maxReadLines: number; readExternalFiles: boolean };
            };
            wideningThreshold: number;
        };
        defaultEngine?: "tree-sitter"
        | "r-shell";
        defaultPlugins: ConfigPlugin<string>[];
        engines: EngineConfig[];
        gas: FlowrGasConfig;
        ignoreLoadCalls: boolean;
        ignoreSourceCalls: boolean;
        linter: { disabledRules: string[] };
        logLevel?:
            | "error"
            | "info"
            | "debug"
            | "trace"
            | "silly"
            | "warn"
            | "fatal";
        project: {
            basePackages?: string[];
            classification?: {
                notebookExtensions?: string[];
                shinyDescriptionTypes?: string[];
                shinyEntryFiles?: string[];
                shinyUsagePattern?: string;
            };
            discovery?: {
                full?: boolean;
                ignore?: string[];
                perKind?: Partial<
                    Record<ProjectKind, { exclude?: string[]; include?: string[] }>,
                >;
            };
            failOnInaccessiblePath?: boolean;
            implicitSources?: string[];
            resolveUnknownPathsOnDisk: boolean;
            useProjectType?: ProjectKind;
        };
        repl: {
            autoUseFileProtocol?: boolean;
            dfProcessorHeat: boolean;
            hints: boolean;
            plugins: ConfigPlugin<string>[];
            queryStats?: boolean;
            quickStats: boolean;
            showPlugins?: boolean;
        };
        semantics: {
            environment: {
                overwriteBuiltIns: {
                    definitions: BuiltInDefinition<
                        | Access
                        | Apply
                        | Assignment
                        | AssignmentLike
                        | DefineArgument
                        | Default
                        | DefaultReadAllArgs
                        | Eval
                        | ExpressionList
                        | ForLoop
                        | FunctionDefinition
                        | Get
                        | IfThenElse
                        | Library
                        | List
                        | Load
                        | Local
                        | NamespaceAccess
                        | Pipe
                        | PurrrFormula
                        | Quote
                        | Recall
                        | RegisterHook
                        | RepeatLoop
                        | Replacement
                        | Rm
                        | S3Dispatch
                        | S7NewGeneric
                        | S7Dispatch
                        | S7MakeConstructor
                        | Source
                        | SpecialBinOp
                        | StackEnv
                        | StopIfNot
                        | Try
                        | Attach
                        | NewEnv
                        | Vector
                        | WhileLoop
                        | With,
                    >[];
                    loadDefaults?: boolean;
                };
            };
        };
        solver: {
            evalStrings: boolean;
            instrument: {
                dataflowExtractors?: (
                    extractor: DataflowProcessors<ParentInformation>,
                    ctx: FlowrAnalyzerContext,
                ) => DataflowProcessors<ParentInformation>;
            };
            resolveSource?: FlowrLaxSourcingOptions;
            sigdb: {
                additionalPaths?: string[];
                assumedRVersion?: string;
                autoSync?: boolean;
                downloadRepo?: string;
                eagerlyLoad: boolean;
                eagerlyLoadExports: boolean;
                enabled: boolean;
                linkBaseR: boolean;
                linkBaseRCalls?: boolean;
                linkDescriptionDependencies: boolean;
                linkPackageCalls?: boolean;
                loadProjectDependencies: boolean;
                versionOverrides?: Record<string, string>;
                versionSelection?: VersionSelection;
                warmInBackground?: boolean;
            };
            slicer?: { autoExtend?: boolean; threshold?: number };
            trackEnvironments: boolean;
            variables: VariableResolve;
            versionManagement?: { linkedVersionGroups?: string[][] };
        };
        specializeConfig?: Partial<Record<ProjectKind, SpecializeConfigEntry>>;
        [key: string]: unknown;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: string]: unknown

    Hierarchy-Diagram

    UML class diagram of FlowrConfig
    Index

    Properties

    abstractInterpretation: {
        dataFrame: {
            maxColNames: number;
            readLoadedData: { maxReadLines: number; readExternalFiles: boolean };
        };
        wideningThreshold: number;
    }

    Configuration options for abstract interpretation

    Type Declaration

    • ReadonlydataFrame: {
          maxColNames: number;
          readLoadedData: { maxReadLines: number; readExternalFiles: boolean };
      }

      The configuration of the shape inference for data frames

      • ReadonlymaxColNames: number

        The maximum number of columns names to infer for data frames before over-approximating the column names to top

      • ReadonlyreadLoadedData: { maxReadLines: number; readExternalFiles: boolean }

        Configuration options for reading data frame shapes from loaded external data files, such as CSV files

        • ReadonlymaxReadLines: number

          The maximum number of lines to read when extracting data frame shapes from loaded files, such as CSV files

        • ReadonlyreadExternalFiles: boolean

          Whether data frame shapes should be extracted from loaded external data files, such as CSV files

    • ReadonlywideningThreshold: number

      The threshold for the number of visitations of a node at which widening should be performed to ensure the termination of the fixpoint iteration

    defaultEngine?: "tree-sitter" | "r-shell"

    The default engine to use for interacting with R code. If this is undefined, an arbitrary engine from engines will be used.

    defaultPlugins: ConfigPlugin<string>[]

    Plugins to load by default when creating a new FlowrAnalyzer

    engines: EngineConfig[]

    The engines to use for interacting with R code. Currently, supports TreeSitterEngineConfig and RShellEngineConfig. An empty array means all available engines will be used.

    Resource-usage guard (gas) configuration. Gas checks are disabled by default (all feature factors are 0). Set a feature factor > 0 to enable checking for that feature.

    ignoreLoadCalls: boolean

    Whether load calls should be ignored, causing processLoadCall's behavior to be skipped

    ignoreSourceCalls: boolean

    Whether source calls should be ignored, causing processSourceCall's behavior to be skipped

    linter: { disabledRules: string[] }

    Linter configuration, usually specialized per ProjectKind via FlowrConfig.specializeConfig.

    Type Declaration

    • ReadonlydisabledRules: string[]

      Rule names excluded from the default rule set (a rule requested explicitly still runs).

    logLevel?: "error" | "info" | "debug" | "trace" | "silly" | "warn" | "fatal"
    project: {
        basePackages?: string[];
        classification?: {
            notebookExtensions?: string[];
            shinyDescriptionTypes?: string[];
            shinyEntryFiles?: string[];
            shinyUsagePattern?: string;
        };
        discovery?: {
            full?: boolean;
            ignore?: string[];
            perKind?: Partial<
                Record<ProjectKind, { exclude?: string[]; include?: string[] }>,
            >;
        };
        failOnInaccessiblePath?: boolean;
        implicitSources?: string[];
        resolveUnknownPathsOnDisk: boolean;
        useProjectType?: ProjectKind;
    }

    Type Declaration

    • OptionalbasePackages?: string[]

      The packages considered part of R itself, used e.g. by the project query to classify dependencies. If unset, flowR derives them (for the assumed R version) from the signature database via baseRPackages.

    • Optionalclassification?: {
          notebookExtensions?: string[];
          shinyDescriptionTypes?: string[];
          shinyEntryFiles?: string[];
          shinyUsagePattern?: string;
      }

      Overrides for the signals flowR uses to classify the ProjectKind; unset fields keep the built-in defaults.

      • OptionalnotebookExtensions?: string[]

        File extensions marking a notebook (default ipynb, rmd, qmd, rnw).

      • OptionalshinyDescriptionTypes?: string[]

        DESCRIPTION Type: values that mark a shiny app (default shiny, shiny-app, shinyapp).

      • OptionalshinyEntryFiles?: string[]

        File names a shiny app is assembled from (default app.R, ui.R, server.R, global.R).

      • OptionalshinyUsagePattern?: string

        Regex source evidencing shiny usage in an entry file.

    • Optionaldiscovery?: {
          full?: boolean;
          ignore?: string[];
          perKind?: Partial<
              Record<ProjectKind, { exclude?: string[]; include?: string[] }>,
          >;
      }

      Scoping options for the default project discovery.

      • Optionalfull?: boolean

        Collect every file below the project root (greedy) instead of only the files the detected ProjectKind needs (default false).

      • Optionalignore?: string[]

        Case-insensitive globs that drop matching files from the intelligent discovery, regardless of kind (e.g. .Renviron to ignore environment files).

      • OptionalperKind?: Partial<Record<ProjectKind, { exclude?: string[]; include?: string[] }>>

        Per-ProjectKind include/exclude glob overrides layered on the default scoping.

    • OptionalfailOnInaccessiblePath?: boolean

      Whether a directory that cannot be traversed during file discovery (e.g. due to permissions) aborts the analysis; when false (the default) such paths are logged and skipped.

    • OptionalimplicitSources?: string[]

      Files a framework loads on its own, without any source() call (e.g. global.R in a shiny app), in load order. Entries are case-insensitive globs (R/*.R) matched against the path, a plain name matches any file with that name; entries matching nothing are warned about. Usually set per ProjectKind via FlowrConfig.specializeConfig.

    • resolveUnknownPathsOnDisk: boolean

      Whether to resolve unknown paths loaded by the r project disk when trying to source/analyze files

    • OptionaluseProjectType?: ProjectKind

      Overwrite the ProjectKind flowR would otherwise infer from the analyzed files, e.g. when auto-detection guesses wrong.

    repl: {
        autoUseFileProtocol?: boolean;
        dfProcessorHeat: boolean;
        hints: boolean;
        plugins: ConfigPlugin<string>[];
        queryStats?: boolean;
        quickStats: boolean;
        showPlugins?: boolean;
    }

    Configuration options for the REPL

    Type Declaration

    • OptionalautoUseFileProtocol?: boolean

      Automatically use the file protocol for inputs that look like paths (default true)

    • dfProcessorHeat: boolean

      This instruments the dataflow processors to count how often each processor is called

    • hints: boolean

      Whether to show dim inline hints (e.g. :help) on the empty prompt; automatically disabled on non-interactive terminals

    • plugins: ConfigPlugin<string>[]

      Plugins to load in REPL mode

    • OptionalqueryStats?: boolean

      Whether :query closes with the line stating how long the queries took (default true, :query* never prints it)

    • quickStats: boolean

      Whether to show quick stats in the REPL after each evaluation

    • OptionalshowPlugins?: boolean

      Whether :version grays out the plugins that did not activate during the last analysis (default false)

    semantics: {
        environment: {
            overwriteBuiltIns: {
                definitions: BuiltInDefinition<
                    | Access
                    | Apply
                    | Assignment
                    | AssignmentLike
                    | DefineArgument
                    | Default
                    | DefaultReadAllArgs
                    | Eval
                    | ExpressionList
                    | ForLoop
                    | FunctionDefinition
                    | Get
                    | IfThenElse
                    | Library
                    | List
                    | Load
                    | Local
                    | NamespaceAccess
                    | Pipe
                    | PurrrFormula
                    | Quote
                    | Recall
                    | RegisterHook
                    | RepeatLoop
                    | Replacement
                    | Rm
                    | S3Dispatch
                    | S7NewGeneric
                    | S7Dispatch
                    | S7MakeConstructor
                    | Source
                    | SpecialBinOp
                    | StackEnv
                    | StopIfNot
                    | Try
                    | Attach
                    | NewEnv
                    | Vector
                    | WhileLoop
                    | With,
                >[];
                loadDefaults?: boolean;
            };
        };
    }

    Configure language semantics and how flowR handles them

    Type Declaration

    solver: {
        evalStrings: boolean;
        instrument: {
            dataflowExtractors?: (
                extractor: DataflowProcessors<ParentInformation>,
                ctx: FlowrAnalyzerContext,
            ) => DataflowProcessors<ParentInformation>;
        };
        resolveSource?: FlowrLaxSourcingOptions;
        sigdb: {
            additionalPaths?: string[];
            assumedRVersion?: string;
            autoSync?: boolean;
            downloadRepo?: string;
            eagerlyLoad: boolean;
            eagerlyLoadExports: boolean;
            enabled: boolean;
            linkBaseR: boolean;
            linkBaseRCalls?: boolean;
            linkDescriptionDependencies: boolean;
            linkPackageCalls?: boolean;
            loadProjectDependencies: boolean;
            versionOverrides?: Record<string, string>;
            versionSelection?: VersionSelection;
            warmInBackground?: boolean;
        };
        slicer?: { autoExtend?: boolean; threshold?: number };
        trackEnvironments: boolean;
        variables: VariableResolve;
        versionManagement?: { linkedVersionGroups?: string[][] };
    }

    How to resolve constants, constraints, cells, …

    Type Declaration

    • ReadonlyevalStrings: boolean

      Should we include eval(parse(text="...")) calls in the dataflow graph?

    • Readonlyinstrument: {
          dataflowExtractors?: (
              extractor: DataflowProcessors<ParentInformation>,
              ctx: FlowrAnalyzerContext,
          ) => DataflowProcessors<ParentInformation>;
      }

      These keys are only intended for use within code, allowing to instrument the dataflow analyzer!

      • OptionaldataflowExtractors?: (
            extractor: DataflowProcessors<ParentInformation>,
            ctx: FlowrAnalyzerContext,
        ) => DataflowProcessors<ParentInformation>

        Modify the dataflow processors used during dataflow analysis. Make sure that all processors required for correct analysis are still present! This may have arbitrary consequences on the analysis precision and performance, consider focusing on decorating existing processors instead of replacing them.

    • Optional ReadonlyresolveSource?: FlowrLaxSourcingOptions

      If lax source calls are active, flowR searches for sourced files much more freely, based on the configurations you give it. This option is only in effect if ignoreSourceCalls is set to false.

    • Readonlysigdb: {
          additionalPaths?: string[];
          assumedRVersion?: string;
          autoSync?: boolean;
          downloadRepo?: string;
          eagerlyLoad: boolean;
          eagerlyLoadExports: boolean;
          enabled: boolean;
          linkBaseR: boolean;
          linkBaseRCalls?: boolean;
          linkDescriptionDependencies: boolean;
          linkPackageCalls?: boolean;
          loadProjectDependencies: boolean;
          versionOverrides?: Record<string, string>;
          versionSelection?: VersionSelection;
          warmInBackground?: boolean;
      }

      Resolving library()/use() exports from a signature database (e.g. the bundled flowr-sigdb).

      • Optional ReadonlyadditionalPaths?: string[]

        Extra directories (or bundle/manifest files) searched for signature databases, alongside the shipped default and $FLOWR_SIGDB_DIR. A downloaded full-history bundle placed here is mounted automatically.

      • Optional ReadonlyassumedRVersion?: string

        The R version analysis assumes when resolving versioned (base-R) package exports: a pin like "4.5", or "auto" to detect the locally installed R (falling back to DefaultAssumedRVersion when the engine reports none, e.g. the tree-sitter engine). Resolve it with resolveAssumedRVersion.

      • Optional ReadonlyautoSync?: boolean

        On startup, compare the cache against the committed sigdb.remote.json link file and re-download changed shards in the background (default false; needs network, so opt-in — a git pull that updates the pointer then re-syncs automatically).

      • Optional ReadonlydownloadRepo?: string

        GitHub owner/repo the full-history bundle is downloaded from (:signature download); default flowr-analysis/flowr, release tag sigdb-v<flowR-version>.

      • ReadonlyeagerlyLoad: boolean

        Parse the database up front rather than on the first package load (default false, ignored if disabled).

      • ReadonlyeagerlyLoadExports: boolean

        Add a vertex for every export on load rather than on demand (default false); keeps the graph small.

      • Readonlyenabled: boolean

        Resolve library exports from a signature database (default true); when false no database is consulted.

      • ReadonlylinkBaseR: boolean

        Eagerly attach base-R namespaces (from a signature database) so bare base calls resolve without library() (default false; changes every analysis; needs a base-R signature database).

      • Optional ReadonlylinkBaseRCalls?: boolean

        Add a lightweight Reads edge from a bare base-R call to its signature-database function vertex (built-in:pkg:fn); base-R qualification stays edge-free unless this is on (default false; adds edges to every base call).

      • ReadonlylinkDescriptionDependencies: boolean

        Eagerly attach the namespaces of the project's declared DESCRIPTION dependencies (Imports/Depends) so their exports resolve without an explicit library() (default false; changes every analysis; needs a signature database resolving the declared packages).

      • Optional ReadonlylinkPackageCalls?: boolean

        Add a lightweight Reads edge from a resolved package call (pkg::fn/attached export) to its signature-database function vertex (default false).

      • ReadonlyloadProjectDependencies: boolean

        Load the project's declared dependencies from its metadata files (DESCRIPTION Imports/Depends, rproject.toml, renv.lock, rv.lock) into the dependency context (default true); when false these files are not read, so neither the undefined-symbol linter nor linkDescriptionDependencies sees any project-declared dependency.

      • Optional ReadonlyversionOverrides?: Record<string, string>

        Force an exact version for specific packages (mapping a package name to a version), overriding both the project constraint and the versionSelection policy; a version missing from the database falls back with a warning (default {}).

      • Optional ReadonlyversionSelection?: VersionSelection

        When a project constrains a dependency, resolve to the newest (default) or oldest version satisfying the constraint, or the system-installed version (needs R; falls back to newest when unavailable). Base-R packages always resolve against the assumed R version.

      • Optional ReadonlywarmInBackground?: boolean

        Decompress the hot shards (base + most-downloaded) in a background task on startup, so the first library() lookup is warm (default false; useful for long-running servers/REPLs, not one-shot runs).

    • Optionalslicer?: { autoExtend?: boolean; threshold?: number }

      The configuration for flowR's slicer

      • Optional ReadonlyautoExtend?: boolean

        If set, the slicer will gain an additional post-pass

      • Optional Readonlythreshold?: number

        The maximum number of iterations to perform on a single function call during slicing

    • ReadonlytrackEnvironments: boolean

      Track user-created environments (new.env(), assign(..., envir=e), get(..., envir=e), local({}, envir=e), e$x <- v, attach(e)) with precise per-variable envState. When disabled all envir-style calls fall through to the conservative global treatment.

    • Readonlyvariables: VariableResolve

      How to resolve variables and their values

    • Optional ReadonlyversionManagement?: { linkedVersionGroups?: string[][] }

      Policies for reasoning about dependency versions (independent of how the signature database is loaded).

      • Optional ReadonlylinkedVersionGroups?: string[][]

        Groups of packages that must resolve to the same version (like the base packages, which share the R version); version guessing intersects each group so its members stay mutually compatible (default []).

    specializeConfig?: Partial<Record<ProjectKind, SpecializeConfigEntry>>

    Overwrite (parts of) this configuration depending on the ProjectKind flowR detects for the project, e.g. to give a shiny app its implicit sources. An entry may inherit another kind's overwrite (merged first, with the entry's own keys winning) to avoid repeating it. Resolve it with FlowrConfig.forKind.