import { Joinpoint } from "@specs-feup/clava/api/Joinpoints.js"; import MISRARule from "../../MISRARule.js"; import { AnalysisType, MISRATransformationReport } from "../../MISRA.js"; /** * MISRA-C Rule 8.9: An object should be defined at block scope if its identifier only appears in a single function */ export default class Rule_8_9_BlockScopeDefinition extends MISRARule { /** * Scope of analysis */ readonly analysisType = AnalysisType.SYSTEM; /** * @returns Rule identifier according to MISRA-C:2012 */ get name(): string; /** * Checks if the provided joinpoint represents an object definition with internal linkage, whose identifier only appears in a single function. * * @param $jp - Joinpoint to analyze * @param logErrors - [logErrors=false] - Whether to log errors if a violation is detected * @returns Returns true if the joinpoint violates the rule, false otherwise */ match($jp: Joinpoint, logErrors?: boolean): boolean; /** * If the joinpoint represents the definition of an object with internal linkage used exclusively in one function, it is moved to that function's block scope. * * @param $jp - Joinpoint to transform * @returns Report detailing the transformation result */ apply($jp: Joinpoint): MISRATransformationReport; } //# sourceMappingURL=Rule_8_9_BlockScopeDefinition.d.ts.map