Main Content

getArtifactIssues

Return issues that occur during artifact analysis

Since R2023a

    Description

    issues = getArtifactIssues(metricEngine) returns the artifact issues that occur when the metric engine analyzes the artifacts in the project. For the metric engine to perform artifact analysis and check for artifact issues, collect metric results by using the execute function. If the execute function returns a warning about artifact issues in the project, use getArtifactIssues to get a list of the artifact issues that the metric engine found during artifact analysis.

    If you have artifact issues in your project, try to fix the issues to prevent the artifacts from returning incorrect metric results. For more information, see View Artifact Issues in Project.

    example

    Examples

    collapse all

    Collect metric results for the testing artifacts and get a list of artifact issues in the project.

    Open the project that contains the models and testing artifacts. For this example, in the MATLAB® Command Window, enter:

    openExample("slcheck/ExploreTestingMetricDataInModelTestingDashboardExample");
    openProject("cc_CruiseControl");

    Create a metric.Engine object for the project.

    metric_engine = metric.Engine();

    Collect metric results by using the execute function. For this example, collect results for the metric slcomp.SimulinkBlocks by using the execute function on the metric.Engine object.

    execute(metric_engine,"slcomp.SimulinkBlocks");

    If you have artifact issues in the project, the execute function returns a warning. For this example, the execute function does not return a warning.

    You can use the function getArtifactIssues to get a list of the artifact issues that the metric engine found during artifact analysis.

    issues = getArtifactIssues(metric_engine)
    issues = 
    
      0×0 empty struct array with fields:
    
        IssueId
        IssueMessage
        Severity
        Address
        UUID
    For this example, the artifacts did not return issues. If you have artifact issues in your project, try to fix the issues to prevent the artifacts from returning incorrect metric results.

    Input Arguments

    collapse all

    Metric engine object for the project for which you want the list of artifact issues, specified as a metric.Engine object.

    Output Arguments

    collapse all

    Artifact issues in a project, returned as a struct or struct array with fields:

    • IssueId — Identifier for the artifact issue type

    • IssueMessage — Message that describes the artifact issue

    • Severity — Severity of the artifact issue

    • Address — Address of the affected artifact

    • UUID — Universal unique identifier for the affected artifact

    There is one element in the array for each artifact issue.

    Alternative Functionality

    App

    To view artifact issues for a Model Design or Model Testing dashboard, click Artifact Issues in the dashboard toolstrip. The Artifact Issues tab shows a table of the artifact issues in the current project. You can click on the hyperlinks in the Source column to open the affected artifact. You can also sort the artifact issues by type by clicking the Message ID column header. For more information, see View Artifact Issues in Project.

    Version History

    Introduced in R2023a