Hauptinhalt

getArtifactIssues

R2026b

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 finds during artifact analysis.

    If there are artifact issues in your project, try to fix the issues to prevent the artifacts from returning incorrect metric results.

    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('simulink/VisualizeModelReferenceHierarchiesExample')

    Create a metric.Engine object for the project.

    metric_engine = metric.Engine();

    Collect results for the design cost metrics by using the execute function on the metric.Engine object.

    execute(metric_engine,["DataSegmentEstimate","OperatorCount"]);

    If there are artifact issues in the project, the execute function returns a warning. For this example, the execute function returns a warning.

    Use the getArtifactIssues function to get a list of the artifact issues that the metric engine finds during artifact analysis.

    issues = getArtifactIssues(metric_engine)
    issues =
    
      struct with fields:
    
             IssueId: "alm:simulink_trace_plugins:ModelCallbacksDeactivated"
        IssueMessage: "Model Loading and Closing Callbacks have been deactivated while loading 'sldemo_mdlref_house' for analysis."
            Severity: "WARNING"
                 URI: "mwdigitalthread://ModelReferenceHierarchy/sldemo_mdlref_house.slx#addr=sldemo_mdlref_house"
    If there are 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 whose artifact issues you want to retrieve, 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.

    Version History

    Introduced in R2023a