Class CodeModuleInstructionAnalyzer
Abstract base class for an Analyzer to be invoked by CodeModule
Inherited Members
Namespace: Unity.ProjectAuditor .Editor.Core
Assembly: Unity.ProjectAuditor.Editor.dll
Syntax
public abstract class CodeModuleInstructionAnalyzer : ModuleAnalyzer
Properties
opCodes
A collection of Mono.Cecil OpCodes which are used by this analyzer.
Declaration
public abstract IReadOnlyCollection<OpCode> opCodes { get; }
Property Value
Type | Description |
---|---|
IRead |
Remarks
To speed up the code analysis process, each CodeModuleInstructionAnalyzer must provide a list of the Instruction OpCodes it's interested in. Project Auditor will only invoke an InstructionAnalyzer if the OpCode of the Instruction currently under analysis matches one of the OpCodes in this list. For more details, refer to the Mono.Cecil Github page.
Methods
Analyze(InstructionAnalysisContext)
Implement this method to detect Issues in a code instruction, and construct a ReportItemBuilder object with basic information about a ReportItem object to describe the issue.
Declaration
public abstract ReportItemBuilder Analyze(InstructionAnalysisContext context)
Parameters
Type | Name | Description |
---|---|---|
Instruction |
context | Context object containing information necessary to perform analysis |
Returns
Type | Description |
---|---|
Report |
A ReportItemBuilder containing a partially-constructed ReportItem |
Remarks
When Instruction Analyzers detect an issue, they should call Create