Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

codeCompatibilityReport

Create code compatibility report

Syntax

codeCompatibilityReport
codeCompatibilityReport(names)
codeCompatibilityReport(___,'IncludeSubfolders',tf)
codeCompatibilityReport(cca)

Description

example

codeCompatibilityReport creates a code compatibility report for the current working folder and subfolders. The code compatibility report opens in the MATLAB® Web Browser. After you upgrade to a newer version of MATLAB, you can use this report to identify potential compatibility issues in your existing code.

codeCompatibilityReport(names) creates a report for the files or folders specified by names.

codeCompatibilityReport(___,'IncludeSubfolders',tf) specifies whether to report on subfolders. By default, subfolders are included in the analysis. Use this syntax with any of the arguments in previous syntaxes.

example

codeCompatibilityReport(cca) creates a report from an existing code compatibility result, specified as a CodeCompatibilityAnalysis object.

Examples

collapse all

Create a code compatibility report for code in your current folder and subfolders. The report opens in the MATLAB Web Browser.

codeCompatibilityReport

Create another report, but omit subfolders from the analysis.

codeCompatibilityReport('IncludeSubfolders',false)

Generate compatibility analysis results for code in your current working folder and subfolders.

r = analyzeCodeCompatibility;

Create a report from the results. The report opens in the MATLAB Web Browser.

codeCompatibilityReport(r)

Input Arguments

collapse all

Name of files or folders to analyze, specified as a character vector, cell array of character vectors, string scalar, or string array.

Example: '../thisFile.m'

Example: {'folderA','folderB','fileA'}

Data Types: char | string

Subfolder analysis indicator, specified as true, false, 0, or 1. By default, analyzeCodeCompatibility includes subfolders in the analysis. To omit subfolders, set tf to false or 0.

Code compatibility analysis results, specified as a CodeCompatibilityAnalysis object.

More About

collapse all

Code Compatibility Report

The code compatibility report contains information to help you upgrade your code to a new version of MATLAB. It contains these sections.

  • Incompatibility and Syntax Errors—Table with details about syntax errors and incompatibility considerations in the analyzed code. For example, Using ~ to ignore a value is not permitted in this context or 'wavfinfo' has been removed. Use 'AUDIOINFO' instead. The table includes the following information.

    Report ColumnDescription
    RowOrdered list of incompatibilities and syntax errors found in analyzed code.
    FilenameName of file that contains flagged check.
    LineLine number indicating location in file of flagged check.

    Description

    Description of check. Description is same as code analyzer message.

    Details

    Link to more information in documentation.

  • Warnings and Other Recommendations—Table with details about warnings and other opportunities to improve your code. For example, "Programmatic use of DISPLAY is not recommended. Use DISP or FPRINTF instead." The table includes the following information.

    Report ColumnDescription
    RowOrdered list of incompatibilities and syntax errors found in analyzed code.
    FilenameName of file that contains flagged check.
    LineLine number indicating location in file of flagged check.

    Description

    Description of check. Description is same as code analyzer message.

    Details

    Link to more information in documentation.

  • Checks Performed—Details the checks performed on the specified code. It includes the following information.

    Report ColumnDescription

    Occurrences

    In analyzed code, total number of occurrences where a particular check is flagged.

    Files

    In the analyzed code, number of files where a particular check is flagged.

    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.

    Severity

    Severity of check. For example, Error or Warning. Errors might indicate syntax errors or use of functionality that is no longer supported. Warnings might indicate opportunities to improve your code.

    Identifier

    Identifier for MATLAB code analyzer messages.

    Details

    Link to more information in documentation.

  • Files—List of files that MATLAB analyzed for code compatibility.

Tips

Introduced in R2017b

Was this topic helpful?