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
This property is read-only.
Date of code compatibility analysis, returned as a datetime scalar.
Data Types: datetime
This property is read-only.
Version of MATLAB used for code compatibility analysis, returned as a string scalar.
Data Types: string
This property is read-only.
List of files analyzed by for code compatibility, returned as a string array.
Data Types: string
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
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
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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)