How to audit the code base to find code that is no longer used / not required?

I work with a code base that has been in place for 10 years. The code has undergone numerous additions, changes, releases and refactoring without removing any code or modules that are no longer required. As a result, the code base is littered with unnecessary code.

Ask one of you to come up with a comprehensive technique or product to test your code base to find redundant unused code.

+3
source share
6 answers

Assuming one way could be to run a full suite of tests and use the code coverage tool to find out which code is not executing.

PHP, http://www.google.ca/search?hl=en&q=php+code+coverage+tools 300 000 , PHP

+5

, , , , , . , .

, , . , , .

+2

, /, . - Project Analyzer Visual Basic, . , .

, , - , . , , . UML/ , .

, , . , .

0

.

, , , - if- (), , .

, . , , , , , - , .

, , .

edit: , PHP. XDebug ( php), WinCachegrind (KCacheGrind , linux), , - XDebug.

0

For Java code, Bill Pugh, father of Findbugs, presented some interesting ideas for finding dead code using lightweight tools (and, of course, great ideas for static analysis) in a recent presentation on JavaOne

0
source

Source: https://habr.com/ru/post/1708536/


All Articles