Main Content

Simulink.CloneDetection.Settings class

Package: Simulink.CloneDetection

Conditions for findClones function

Description

Use objects of the Simulink.CloneDetection.Settings class to specify certain conditions when calling the Simulink.CloneDetection.findClones function.

Creation

Description

Simulink.CloneDetection.Settings creates an object of the Simulink.CloneDetection.Settings class.

Properties

expand all

Option to ignore signal name differences while detecting clones, specified as false or true.

Option to ignore block property differences while detecting clones, specified as false or true.

Option to exclude Model Reference blocks from search clone patterns, specified as false or true.

Option to exclude library links from search clone patterns, specified as false or true.

Option to find clones in models from the folders present inside the specified folder, specified as false or true.

Number of differences allowed to consider a pattern as a clone, specified as a uint32 integer.

Option to replace exact clones with Subsystem Reference blocks, specified as false or true.

Path to libraries used to replace patterns in the model, specified as a character vector or array of character vectors.

Path to folders that contain the models, specified as a character vector or array of character vectors.

Option to detect clones anywhere across the model, specified as false or true.

Minimum number of blocks in a region required to consider a pattern as a clone, specified as a uint32 integer.

This property applies only when DetectClonesAcrossModel is true.

Minimum number of clone pattern occurrences required to consider a pattern as a clone group, specified as a uint32 integer.

Option to exclude inactive regions or commented-out regions from search clone patterns, specified as false or true.

Methods

expand all

Examples

collapse all

This example shows how to create cloneDetectionSettings object from Simulink.CloneDetection.Settings class for clone detection operation and change the property of IgnoreSignalName to true for ignoring the signal name differences while detecting clones.

  • cloneDetectionSettings = Simulink.CloneDetection.Settings();
    cloneDetectionSettings.IgnoreSignalName = true
    cloneDetectionSettings = 
    
      Settings with properties:                            
                                IgnoreSignalName: 1
                             IgnoreBlockProperty: 0
                          ExcludeModelReferences: 0
                             ExcludeLibraryLinks: 0
                          SelectedSystemBoundary: ''
                  FindClonesRecursivelyInFolders: 1
                        ParamDifferenceThreshold: 50
        ReplaceExactClonesWithSubsystemReference: 0
                                       Libraries: {}
                                         Folders: {} 
                         DetectClonesAcrossModel: 0
                          ExcludeInactiveRegions: 0
    
Introduced in R2021a