Main Content

matlab.codeanalysis.validateConfiguration

Validate Code Analyzer configuration file

Since R2023a

    Description

    issuesTable = matlab.codeanalysis.validateConfiguration validates the Code Analyzer configuration file, codeAnalyzerConfiguration.json, in the current folder and returns a table containing any identified issues.

    For more information about Code Analyzer configuration, see Configure Code Analyzer.

    issuesTable = matlab.codeanalysis.validateConfiguration(pathname) validates the Code Analyzer configuration file in the folder or the codeAnalyzerConfiguration.json file specified by pathname.

    example

    Examples

    collapse all

    Validate the Code Analyzer configuration file in the resources folder of C:\MyCode.

    issuesTable = matlab.codeanalysis.validateConfiguration("C:\MyCode")
    issuesTable =
    
      1×9 table
    
                    Location                Severity                                             Message                                               MessageID       LineStart    LineEnd    ColumnStart    ColumnEnd                        FullFilename                    
        ________________________________    ________    _________________________________________________________________________________________    ______________    _________    _______    ___________    _________    ____________________________________________________
    
        "codeAnalyzerConfiguration.json"    warning     "Check name "MyOwnCheck" not found, or "rule" field is missing to create a custom check."    UnknownCheckId       20          20            9            20        "C:\MyCode\resources\codeAnalyzerConfiguration.json"
    

    Input Arguments

    collapse all

    Configuration file location, specified as a string scalar or character vector. The location can contain a partial or full path to a configuration file or folder containing a configuration file.

    Example: "C:\MyCode\resources"

    Example: "../codeAnalyzerConfiguration.json"

    Output Arguments

    collapse all

    Identified issues, returned as a table with these columns:

    Column NameColumn Purpose
    LocationName of analyzed configuration file, which also functions as a hyperlink to the location of the issue in the configuration file.
    SeveritySeverity of the message, specified as error, warning, or info.
    MessageDescription of the issue
    MessageIDCheck identifier of issue
    LineStartLine number in the configuration file where issue begins
    LineEndLine number in the configuration file where issue ends
    ColumnStartColumn number in the configuration file where issue begins
    ColumnEndColumn number in the configuration file where issue ends
    FullFilenameFull path to configuration file

    Version History

    Introduced in R2023a

    expand all