查找冗余的用户功能

发布于 2024-08-29 02:00:14 字数 76 浏览 2 评论 0原文

我正在分析一个在许多文件中具有大量函数的应用程序,并且我正在尝试隔离那些永远不会被调用的函数。

在我继续之前有什么想法吗?

I'm profiling an app that has a boat load of functions in many files and I'm trying to isolate functions that don't get called ever.

Any ideas before I proceed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不必在意 2024-09-05 02:00:14

我不相信有一种简单的方法可以做到这一点。 print_r(get_define_functions()); 在一个文件中,可以包含在每个文件的末尾或全局中。收集输出并在所有文件中搜索函数调用。这将隔离您的功能。

或者

将所有函数移至包含文件,注释掉这些函数,然后允许应用程序出错。当您收到这些函数的错误时,请取消注释这些函数以解决错误。在所有检查结束时,您将获得一个未使用的注释函数列表。

不管怎样,这都不容易。

I don't believe there is an easy way to do this. print_r(get_defined_functions()); in a file that can be included at the end of every file or in a global. Collect the output and do searches on all your files for function calls. This will isolate out your functions.

Or

Move all the functions to an include file, comment out the functions and then allow the application to error. As you get errors for those functions un-comment the functions to resolve the errors. At the end of all your checks you'll have a list of commented functions that aren't utilized.

Either way it's not easy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文