Main Content

Simulink.CloneDetection.Settings Class

Namespace: Simulink.CloneDetection

Conditions for findClones function

Since R2021a

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.

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 find clones in models from the folders present inside the specified folder, specified as false or true.

This property applies only when you provide input to Folders.

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.

This property applies only when DetectClonesAcrossModel is true.

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

Option to determine whether the inport data types of the library subsystem matches the inport data types of the clones in the model, specified as false or true.

Methods

expand all

Examples

collapse all

  1. Create a cloneDetectionSettings object from Simulink.CloneDetection.Settings class.

    cloneDetectionSettings = Simulink.CloneDetection.Settings();
  2. Change the property of IgnoreSignalName to true to ignore signal name differences while detecting clones.

    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
                                   DataTypeCheck: 0
    

Version History

Introduced in R2021a