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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)