killOrphanFiles()

version 2.0.0.2 (251 KB) by Massimo Ciacci
Search all unreachable code files, from one or more Main Entry files, and delete them.

237 Downloads

更新星期三,2021年9月22日16:36:47 +0000

View License

Search all unreachable code files, from a Main Entry file (or multiple entry files), and delete them.
Do you happen to have a large Matlab project with few entry points (MAIN1,MAIN2,..) ? Then there is a chance that a lot of scripts within your root are not needed by none of those entry points. This tool helps you clean up your code before releasing it.
Note: Dependencies in this script are very conservative by design: A calls B if the string "B" is mentioned anywhere in A with the following conditions:
1)一旦将所有空格删除后,“名称”为“或'=”之前,最后一个字符
2) once all spaces are removed the first character after 'name' is '( '
进一步来说
functioName1/scriptName1 is considered Reachable from MAIN.m if the string functioName1/scriptName1 appears in MAIN.m and obeys the 2 reules above.
这是递归扩展到“呼叫”的所有深度(将邻接式传播到转盘造影)。在第一行中的那一刻,所有来自Main NR 1的可触及文件都标记为标记。
Killorphanfiles()启动了许多由这些步骤组成的用户对话
- select MAIN file
- 选择根文件夹
- LIST all MAIN-unreachable files in ROOT
- SELECT which ones / CONFIRM deletion
% SEARCH METHOD:
% - 创建了root中所有文件名的列表,
% with MAIN1,MAIN2,.. in position 1,2,...
% - Make dependency table:
%a(i,j)=“名称(j)出现在文件(i)”(即使在评论中)
% this way also commented code is protected (desired)
% - Propagate dependency (transitive closure of adjacency matrix A)
% If i mentions(needs) j and j mentions k then i needs k:
%i-> j-> k ==> i-> k
% A(i,j)==1
% A(j,k)==1 ==> A(i,k) = 1
% - A(1,:) contains all nodes called by MAIN1 within selected ROOT folder.
% - A(2,:) contains all nodes called by MAIN2 within selected ROOT folder.
% - Intersection of {~A(1,:),~A(2,:)} is the unreachable set
% by the union of MAIN1,MAIN2. Meaning both MAIN1,MAIN2 will run after
% clean up is completed

Cite As

Massimo Ciacci (2022).killOrphanFiles()(//www.tianjin-qmedu.com/matlabcentral/fileexchange/46618-killorphanfiles), MATLAB Central File Exchange. Retrieved.

MATLAB释放兼容性
使用R2016B创建
与任何版本兼容
Platform Compatibility
视窗 苹果系统 Linux
TagsAdd Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

开始狩猎!

Kill_Orphans_v2_0