Contenu principal

getArtifactIssues

R2026b

View issues from artifact analysis

Since R2023a

    Description

    issues = getArtifactIssues(metricEngine) returns the artifact issues detected during artifact analysis.

    When you collect metric results, the execute function can report artifact issues. Use getArtifactIssues to get the list of issues found during artifact analysis. If there are artifact issues, 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 sldesignlayer.SimulinkDesignInfo by using the execute function on the metric.Engine object.

    execute(metric_engine,"sldesignlayer.SimulinkDesignInfo");

    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
        URI
    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

    • URI — Digital thread URI of 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