UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

56 lines (55 loc) 3.35 kB
import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate'; import type { FlowrSearchElements } from '../../search/flowr-search'; import { type MergeableRecord } from '../../util/objects'; import { SourceRange } from '../../util/range'; import { LintingRuleCertainty, type LintingResult } from '../linter-format'; import { LintingRuleTag } from '../linter-tags'; export interface DataFrameAccessValidationResult extends LintingResult { /** The type of the data frame access ("column" or "row") */ type: 'column' | 'row'; /** The name or index of the column or row being accessed in the data frame */ accessed: string | number; /** The name of the function/operation used for the access (e.g. `$`, `[`, `[[`, but also `filter`, `select`, ...) */ access: string; /** The variable/symbol name of the accessed data frame operand (`undefined` if operand is no symbol) */ operand?: string; /** The source range in the code where the access occurs */ range: SourceRange; } export interface DataFrameAccessValidationConfig extends MergeableRecord { /** Whether data frame shapes should be extracted from loaded external data files, such as CSV files (defaults to the option in the flowR config if `undefined`) */ readLoadedData?: boolean; } export interface DataFrameAccessValidationMetadata extends MergeableRecord { /** The number of data frame functions and operations containing inferred column or row accesses */ numOperations: number; /** The number of inferred abstract column or row access operations */ numAccesses: number; /** The total number of inferred accessed columns and rows */ totalAccessed: number; } export declare const DATA_FRAME_ACCESS_VALIDATION: { readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with"], ParentInformation, Promise<FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>>>; readonly processSearchResult: (elements: FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>, config: DataFrameAccessValidationConfig, data: { normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst; dataflow: import("../../dataflow/info").DataflowInformation; cfg: import("../../control-flow/control-flow-graph").ControlFlowInformation; analyzer: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider; }) => Promise<{ results: DataFrameAccessValidationResult[]; '.meta': DataFrameAccessValidationMetadata; }>; readonly prettyPrint: { readonly query: (result: DataFrameAccessValidationResult) => string; readonly full: (result: DataFrameAccessValidationResult) => string; }; readonly info: { readonly name: "Dataframe Access Validation"; readonly tags: readonly [LintingRuleTag.Bug, LintingRuleTag.Usability, LintingRuleTag.Reproducibility]; readonly certainty: LintingRuleCertainty.BestEffort; readonly description: "Validates the existence of accessed columns and rows of dataframes."; readonly defaultConfig: { readonly readLoadedData: false; }; }; };