UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

49 lines (48 loc) 2.48 kB
import type { LintingResult } from '../linter-format'; import type { MergeableRecord } from '../../util/objects'; import type { SourceRange } from '../../util/range'; import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate'; import type { FlowrSearchElementFromQuery } from '../../search/flowr-search'; import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info'; export interface FilePathValidityResult extends LintingResult { filePath: string; range: SourceRange; } export interface FilePathValidityConfig extends MergeableRecord { /** * The set of functions that should additionally be considered as reading a file path. * Entries in this array use the {@link FunctionInfo} format from the dependencies query. */ additionalReadFunctions: FunctionInfo[]; /** * The set of functions that should additionally be considered as writing to a file path. * Entries in this array use the {@link FunctionInfo} format from the dependencies query. */ additionalWriteFunctions: FunctionInfo[]; /** * Whether unknown file paths should be included as linting results. */ includeUnknown: boolean; } export interface FilePathValidityMetadata extends MergeableRecord { totalReads: number; totalUnknown: number; totalWritesBeforeAlways: number; totalValid: number; } export declare const R2_FILE_PATH_VALIDITY: { readonly createSearch: (config: FilePathValidityConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from-query", [], ParentInformation, import("../../search/flowr-search").FlowrSearchElements<ParentInformation, FlowrSearchElementFromQuery<ParentInformation>[]>>; readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, FlowrSearchElementFromQuery<ParentInformation>[]>, config: FilePathValidityConfig, data: { normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst; dataflow: import("../../dataflow/info").DataflowInformation; }) => { results: FilePathValidityResult[]; ".meta": FilePathValidityMetadata; }; readonly prettyPrint: (result: FilePathValidityResult) => string; readonly defaultConfig: { readonly additionalReadFunctions: []; readonly additionalWriteFunctions: []; readonly includeUnknown: false; }; };