Extension-for-Clone-Detector
Extension for Clone Detector:
When fixing a bug or enhancing a functionality Simulink users have to search for all the clone/duplicate instances of the functionality manually in a model or across multiple Simulink models which is tedious and time consuming task.
We are here to make the above experience efficient to search a Simulink blocks pattern in a target scope which can be models or folders.
Setup
To Run:
- Download the zip file
- Ensure that it contains "findClonesOfSource.m" and "cloneDetection_Matlab_App.mlapp" files.
- Open the mlapp and run it. It will open a Clone Detector MATLAB® App
https://www.mathworks.com)
MathWorks Products (Requires MATLAB release R2021a or newer
Getting Started
- Open the Clone Detector MATLAB® App as mentioned in the Setup
- Open a model and select a blocks pattern you want to search. Click on "Get Selected Blocks" in the GUI. This will fetch the selected blocks and adds them to the "Define Source" text field.
- Click on "Browse Models" or "Browse Folders" to select Target Scope where you want to search the above blocks pattern
- Click on "Find Clones" button and wait for the results
- When clone detection is complete, you can explore the clones which are grouped per model. You can select a clone region and click on "Highlight Selected Clone" to highlight that in the respective model.
- If you want to use script/API workflow, you can do so by calling the findClonesOfSource function with passing the sourceBlocksPath, targetScopeList to it.
Contents
readme.md This file.
license.txt License file.
security.md Security statement.
findClonesOfSource.m Scipt which call Simulink Check APIs and aggregates the results
cloneDetection_Matlab_App.mlapp MATLAB App GUI interface to detect clones and show results
Examples
To learn how to use this in testing workflows, see Examples.
License
The license is available in the license.txt file in this GitHub repository.
References
Clone Detection official API documentation: https://www.mathworks.com/help/slcheck/ug/clone-detection-programmatically.html
Clone Detector Simulink Toolstrip App documentation: https://www.mathworks.com/help/slcheck/ug/identify-subsystem-clones-and-replace-them-with-library-blocks.html
Community Support
Copyright 2023 The MathWorks, Inc.
Cite As
Radhey Shyam Meena (2024). Extension-for-Clone-Detector (https://github.com/mathworks/Extension-for-Clone-Detector/releases/tag/v1.0.0), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
examples
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |