CodeCompatibilityAnalysis
Code compatibility analysis results
Description
Use the CodeCompatibilityAnalysis
object to save or report
results from a code compatibility analysis. A list of all checks performed by the
MATLAB® Code Analyzer, including checks for compatibility issues, can be found
here, Index of Code Analyzer Checks.
Creation
Create a code compatibility analysis object using the analyzeCodeCompatibility
function.
Properties
Date
— Date of code compatibility analysis
datetime scalar
This property is read-only.
Date of code compatibility analysis, returned as a datetime scalar.
Data Types: datetime
MATLABVersion
— Version of MATLAB
string scalar
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 analyzed
string array
This 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 occurrence
table
This 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 code
table
This 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
Examples
Analyze Code in Current Folder
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]
Version History
Introduced in R2017b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other bat365 country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)