SPeCS Packages Documentation
    Preparing search index...

    Represents a MISRA Rule that detects and corrects violations in the code according to MISRA standards.

    Need to implement/define:

    • analysisType
    • name()
    • match($jp, logErrors)
    • apply($jp)

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    analysisType: AnalysisType

    Scope of analysis: single unit or entire system.

    appliesTo: Set<string> = ...

    Standards to which this rule applies to

    context: MISRAContext
    priority: number = Number.MAX_VALUE

    A positive integer starting from 1 that indicates the rule's priority, determining the order in which rules are applied. By default, a rule has the lowest priority unless overridden.

    Accessors

    • get dependencies(): Visit[]

      Returns Visit[]

      List of dependent visits, which is empty by default

    • get name(): string

      Returns string

      Rule identifier according to MISRA-C:2012

    • get ruleID(): string

      An alias for 'name'

      Returns string

    Methods

    • Verifies if the rule applies to the standard being used

      Returns boolean

    • Logs a MISRA-C rule violation error

      Parameters

      • $jp: Joinpoint

        The joinpoint where the violation occurred

      • msg: string

        Description of the violation

      Returns void

    • Checks if the joinpoint violates the guideline

      Parameters

      • $jp: Joinpoint

        Joinpoint to analyze

      • logErrors: boolean

        [logErrors=false] - Whether to log errors if a violation is detected

      Returns boolean

      Returns true if the joinpoint violates the guideline, false otherwise

    • Rebuilds the program based on the current AST, clears stored data in the shared context, and resets all caches

      Returns void