Main Content

getArtifactIssues

Return issues that occur during artifact analysis

Since R2023a

    Description

    example

    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 there are artifact issues in your project, try to fix the issues to prevent the artifacts from returning incorrect metric results.

    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.

    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 = 
    
      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"
             Address: "ModelReferenceHierarchy :: sldemo_mdlref_house.slx :: sldemo_mdlref_house"
                UUID: "3588dd2d-09f1-4d4e-9c64-f64f6dececf1"
    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 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.

    Version History

    Introduced in R2023a