Code compatibility analysis results
Use the CodeCompatibilityAnalysis
object to save or report
results from a code compatibility analysis.
Create a code compatibility analysis object using the analyzeCodeCompatibility
function.
Date
— Date of code compatibility analysisThis property is read-only.
Date of code compatibility analysis, returned as a datetime scalar.
Data Types: datetime
MATLABVersion
— Version of MATLAB®This property is read-only.
Version of MATLAB used for code compatibility analysis, returned as a string scalar.
Data Types: string
Files
— List of files analyzedThis property is read-only.
List of files analyzed by for code compatibility, returned as a string array.
Data Types: string
ChecksPerformed
— List of checks performed and frequency of occurrenceThis property is read-only.
List of the checks performed and the frequency of occurrence in the analyzed files, returned as a table with these columns.
Table Column | Description |
---|---|
Identifier |
Identifier for MATLAB code analyzer messages. |
Description |
Description of check. For example, Use a newline, semicolon, or comma before this statement or STRMATCH is not recommended. Use STRNCMP or VALIDATESTRING instead. Description is same as code analyzer message. |
Documentation |
Command to open more information in documentation. |
Severity |
Severity of check. For example, |
NumOccurrences |
In analyzed code, total number of occurrences where a particular check is flagged. |
NumFiles |
In analyzed code, number of files where a particular check is flagged. |
Data Types: table
Recommendations
— Recommendations to update codeThis property is read-only.
Recommendations to update code based on the analysis, returned as a table with the following columns.
Table Column | Description |
---|---|
Identifier |
Identifier for MATLAB code analyzer messages. |
Description |
Description of check. For example, Use a newline, semicolon, or comma before this statement or STRMATCH is not recommended. Use STRNCMP or VALIDATESTRING instead. Description is same as code analyzer message. |
Documentation |
Command to open more information in documentation. |
Severity |
Severity of check. For example, |
File | Name of file that contains flagged check. |
LineNumber | Line number indicating location in file of flagged check. |
ColumnRange | Column range indicating location in file of flagged check. |
Data Types: table
Create code compatibility analysis results for code in your current folder and subfolders.
r = analyzeCodeCompatibility
r = CodeCompatibilityAnalysis with properties: Date: 20-Apr-2017 15:06:06 MATLABVersion: "R2017b" Files: [92×1 string] ChecksPerformed: [299×6 table] Recommendations: [28×7 table]
Analyze the code again and omit subfolders from the analysis.
r = analyzeCodeCompatibility('IncludeSubfolders',false)
r = CodeCompatibilityAnalysis with properties: Date: 20-Apr-2017 15:06:56 MATLABVersion: "R2017b" Files: [5×1 string] ChecksPerformed: [299×6 table] Recommendations: [1×7 table]