Main Content

Resolve Missing Artifacts and Results in the Model Maintainability Dashboard

Issue

The Model Maintainability Dashboard analyzes artifacts—Simulink® models, Stateflow® charts, and MATLAB® code—that are part of the model design workflow for software units and components. If an artifact or a relationship between artifacts is not supported, it might not appear in the Model Maintainability Dashboard or contribute to the analysis results. If you expect a link or artifact to appear in the dashboard and it does not, try one of these solutions.

Possible Solutions

Try these solutions when you begin troubleshooting artifacts in the Model Maintainability Dashboard:

  • Save changes to your artifact files.

  • Check that your artifacts are saved in the project. The Model Maintainability Dashboard does not analyze files that are not saved in the project.

  • If your project contains a referenced project, check that the referenced project has a unique project name. The dashboard only analyzes referenced projects that have unique project names.

  • Check that your artifacts are on the MATLAB search path before you open the dashboard. When you change the MATLAB search path, the traceability information in the Artifacts panel is not updated. Do not change the search path while the dashboard is open.

  • Open the Artifact Issues pane and address errors or warnings.

  • Use the dashboard to re-trace the artifacts and re-collect metric results.

Depending on the type of artifact or analysis issue that you are troubleshooting, try one of these solutions.

Enable Artifact Tracing for the Project

As you edit and save the artifacts in your project, the dashboard needs to track these changes to enable artifact tracing and to detect stale results.

By default, the Model Maintainability Dashboard requests that you enable artifact tracing the first time you open a project in the dashboard. Click Enable and Continue to allow the Model Maintainability Dashboard to track tool outputs to detect outdated metric results.

The dashboard needs to track tool outputs to detect outdated metric results.

You can also enable artifact tracing from the Startup and Shutdown settings of the project. In the Startup and Shutdown settings for your project, select Track tool outputs to detect outdated results. For more information on the tool outputs and outdated metric results, see Digital Thread.

Cache Folder Artifact Tracking

By default, projects use the same root folder for both the simulation cache folder and the code generation folder. If possible, use different root folders for the simulation cache folder and code generation folder in your project. When you specify different root folders, the dashboard no longer needs to track changes to the simulation cache folder.

To view the cache folder settings for your project, on the Project tab, in the Environment section, click Details. The Project Details dialog shows the root folders specified for the Simulation cache folder and Code generation folder.

The behavior of change tracking only depends on the project settings. Custom manipulations do not impact the change tracking behavior. For example, the dashboard does not check root folders specified by Simulink.fileGenControl.

Project Requires Analysis by the Dashboard

The first time that you open the dashboard for the project, the dashboard identifies the artifacts in the project and collects traceability information. The dashboard must perform this first-time setup to establish the traceability data before it can monitor the artifacts. If you cancel the first-time setup, the artifacts in the project appear in the Unanalyzed folder in the Artifacts panel. To trace the unanalyzed artifacts, click Collect > Trace Artifacts.

Incorrect List of Models in Project Panel

The Project panel shows the models in your project that are either units or components. Models are organized under the components that reference them, according to the model reference hierarchy. If the list of units and components does not show the expected hierarchy of your models, try one of these solutions.

Check that your units and components are labeled.  Label the software units and components in your project and configure the Model Maintainability Dashboard to recognize the labeled models. Note that if a unit references one or more other models, the referenced models appear in the Design folder under the unit. For more information about labeling models and configuring the dashboard, see Categorize Models in a Hierarchy as Components or Units. Check that if you have Observer models, they are not labeled as units. The dashboard includes Observer models as units if they match the label requirements.

Check that your model was saved in a supported release.  Check that your model was saved in R2012b or later. The Model Maintainability Dashboard does not support models that were saved before R2012b.

External MATLAB Code Missing from Artifacts Panel

The Artifacts panel shows external MATLAB code that the dashboard traced to the units and components in your project. If you expect external MATLAB code to appear in the dashboard and it does not, check if the construct is not supported:

A class method does not appear in the Artifacts panel if the method is:

  • A nonstatic method that you call using dot notation. The dashboard shows the associated class definition in the Artifacts panel.

  • A nonstatic method that you call using function notation. The dashboard shows the associated class definition in the Artifacts panel.

  • A static method that you call from a Simulink model using dot notation. The dashboard shows the associated class definition in the Artifacts panel.

  • A superclass method. The dashboard shows the associated superclass definition in the Artifacts panel.

  • Defined in a separate file from the class definition file. Methods declared in separate files are not supported. For the dashboard to identify a method, you must declare a method in the class definition file. For example, if you have a class folder containing a class definition file and separate method files, the method files are not supported by the dashboard. The dashboard shows the associated class definition in the Design folder.

A class constructor does not appear in the Artifacts panel if the constructor is a superclass constructor. The dashboard shows the associated superclass definition in the Design folder, but not the method itself.

A class property does not appear in the Artifacts panel if the property is called from Simulink or Stateflow. The dashboard shows the associated class definition in the Artifacts panel.

An enumeration class does not appear in the Artifacts panel. For example, if you use an Enumerated Constant block in Simulink, the dashboard does not show the MATLAB class that defines the enum type.

Check that methods and local functions do not have the same name. If a class file contains a method and a local function that have the same name, calls that use dot notation call the method in the class definition, and calls that use function notation call the local function in the class file.

For example, if you have a class file containing the method myAction and the local function myAction, the code obj.myAction calls the method and the code myAction(obj) calls the local function.

classdef Class
    methods
        function myAction(~)
            % method in the class
            disp("Called method in the class.");
        end
 
        function myCall(obj)
            obj.myAction(); % dot notation calls the method in the class
            myAction(obj); % function notation calls the local function
        end
    end
end

function myAction(x)
    % local function
    disp("Called local function");
end

Block Skipped During Artifact Analysis

If a block has a mask and the mask hides the content of the block, the dashboard excludes the block from artifact analysis.

Check that your custom libraries do not contain blocks with self-modifiable masks. The Model Maintainability Dashboard does not analyze blocks that contain self-modifiable masks. Self-modifiable masks can change the structural content of a block, which is incompatible with artifact traceability analysis.

Library Missing from Artifacts Panel

Check that the library does not use a library forwarding table. The Model Maintainability Dashboard does not support library forwarding tables.

Artifact Returns a Warning

Check the details of the warning by clicking the Artifact Issues tab in the toolstrip.

For more information, see View Artifact Issues in Project.

Artifact Returns an Error

Check the details of the error by clicking the Artifact Issues tab in the toolstrip.

If the dashboard returns an error in the Artifact Issues tab, the metric data shown by the dashboard widgets may be incomplete. Errors indicates that the dashboard may not have been able to properly trace artifacts, analyze artifacts, or collect metrics.

Before using the metrics results shown in the dashboard, resolve any reported errors and retrace the artifacts.

For more information, see View Artifact Issues in Project.

Trace Issues

If an artifact appears in the Trace Issues folder when you expect it to trace to a unit or component, depending on the type of artifact that is untraced, try one of these solutions.

Fix an untraced design artifact.  Check that the design artifact does not rely on a model callback to be linked with the model. The Model Maintainability Dashboard does not execute model loading callbacks when it loads the models for analysis. If a model relies on a callback to link a data dictionary, the data dictionary will not be linked when the dashboard runs the traceability analysis.

See Also