UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

48 lines (47 loc) 3 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 { 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") */ readonly type: 'column' | 'row'; /** The name or index of the column or row being accessed in the data frame */ readonly accessed: string | number; /** The name of the function/operation used for the access (e.g. `$`, `[`, `[[`, but also `filter`, `select`, ...) */ readonly access: string; /** The variable/symbol name of the accessed data frame operand (`undefined` if operand is no symbol) */ readonly operand?: string; } 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", [], ParentInformation, FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>>; readonly processSearchResult: (elements: FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>, config: DataFrameAccessValidationConfig, data: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>) => 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; }; }; };