import { Joinpoint } from "@specs-feup/clava/api/Joinpoints.js"; import MISRARule from "../../MISRARule.js"; import { AnalysisType, MISRATransformationReport } from "../../MISRA.js"; /** * MISRA-C Rule 2.7: There should be no unused parameters in functions. */ export default class Rule_2_7_UnusedParameters extends MISRARule { #private; /** * Scope of analysis */ readonly analysisType = AnalysisType.SINGLE_TRANSLATION_UNIT; /** * @returns Rule identifier according to MISRA-C:2012 */ get name(): string; /** * Checks if the program contains function with unused parameters. * A parameter is considered unused if it is never referenced anywhere in the 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; /** * Removes all unused parameters from functions in the program * * @param $jp - Joinpoint to transform * @returns Report detailing the transformation result */ apply($jp: Joinpoint): MISRATransformationReport; /** * Gets all unused parameters from a function joinpoint * * @param func - Function joinpoint to analyze * @returns Returns a list of all unused parameters from a function. */ private getUnusedParams; /** * Gets all used parameters from a function joinpoint * * @param func - Function joinpoint to analyze * @returns Returns a list of parameters that are used within a function. */ private getUsedParams; /** * Returns the positions (indexes) of parameters that are used in the given function joinpoint. * * @param func - Function joinpoint to analyze * @returns returns a list of numbers representing the indexes of used parameters. */ private getUnusedParamsPositions; } //# sourceMappingURL=Rule_2_7_UnusedParameters.d.ts.map