Exposes the central analyses and information provided by the FlowrAnalyzer to the linter, search, and query APIs. This allows us to exchange the underlying implementation of the analyzer without affecting the APIs.

interface FlowrAnalysisProvider {
    context(): FlowrAnalyzerContext;
    controlflow(
        simplifications?: readonly (
            | "unique-cf-sets"
            | "analyze-dead-code"
            | "remove-dead-code"
            | "to-basic-blocks"
        )[],
        useDataflow?: boolean,
        force?: boolean,
    ): Promise<ControlFlowInformation<CfgSimpleVertex>>;
    controlflowQuick(
        force?: boolean,
    ): Promise<ControlFlowInformation<CfgSimpleVertex>>;
    dataflow(
        force?: boolean,
    ): Promise<DataflowInformation & PipelinePerStepMetaInformation>;
    flowrConfig: FlowrConfigOptions;
    inspectContext(): ReadOnlyFlowrAnalyzerContext;
    normalize(
        force?: boolean,
    ): Promise<
        NormalizedAst<ParentInformation, RNode<ParentInformation>> & PipelinePerStepMetaInformation,
    >;
    parse(
        force?: boolean,
    ): Promise<ParseStepOutput<string | Tree> & PipelinePerStepMetaInformation>;
    parserName(): string;
    query<
        Types extends
            | "config"
            | "origin"
            | "dataflow"
            | "search"
            | "dependencies"
            | "call-context"
            | "control-flow"
            | "dataflow-lens"
            | "df-shape"
            | "normalized-ast"
            | "id-map"
            | "dataflow-cluster"
            | "static-slice"
            | "lineage"
            | "location-map"
            | "happens-before"
            | "resolve-value"
            | "project"
            | "linter" = | "config"
        | "origin"
        | "dataflow"
        | "search"
        | "dependencies"
        | "call-context"
        | "control-flow"
        | "dataflow-lens"
        | "df-shape"
        | "normalized-ast"
        | "id-map"
        | "dataflow-cluster"
        | "static-slice"
        | "lineage"
        | "location-map"
        | "happens-before"
        | "resolve-value"
        | "project"
        | "linter",
    >(
        query: Queries<Types>,
    ): Promise<QueryResults<Types>>;
    reset(): void;
    runFull(force?: boolean): Promise<void>;
    runSearch<Search extends FlowrSearchLike>(
        search: Search,
    ): Promise<GetSearchElements<SearchOutput<Search>>>;
}

Implemented by

Properties

flowrConfig: FlowrConfigOptions

This is the config used for the analyzer

Methods

  • Get the control flow graph (CFG) for the request.

    Parameters

    • Optionalsimplifications: readonly (
          | "unique-cf-sets"
          | "analyze-dead-code"
          | "remove-dead-code"
          | "to-basic-blocks"
      )[]

      Simplification passes to be applied to the CFG.

    • OptionaluseDataflow: boolean

      Whether to use the dataflow graph for the creation of the CFG.

    • Optionalforce: boolean

      Do not use the cache, instead force new analyses.

    Returns Promise<ControlFlowInformation<CfgSimpleVertex>>

  • Access the query API for the request.

    Type Parameters

    • Types extends
          | "config"
          | "origin"
          | "dataflow"
          | "search"
          | "dependencies"
          | "call-context"
          | "control-flow"
          | "dataflow-lens"
          | "df-shape"
          | "normalized-ast"
          | "id-map"
          | "dataflow-cluster"
          | "static-slice"
          | "lineage"
          | "location-map"
          | "happens-before"
          | "resolve-value"
          | "project"
          | "linter" =
          | "config"
          | "origin"
          | "dataflow"
          | "search"
          | "dependencies"
          | "call-context"
          | "control-flow"
          | "dataflow-lens"
          | "df-shape"
          | "normalized-ast"
          | "id-map"
          | "dataflow-cluster"
          | "static-slice"
          | "lineage"
          | "location-map"
          | "happens-before"
          | "resolve-value"
          | "project"
          | "linter"

    Parameters

    Returns Promise<QueryResults<Types>>

  • This executes all steps of the core analysis (parse, normalize, dataflow).

    Parameters

    • Optionalforce: boolean

    Returns Promise<void>