Crocodile
Crocodile

Reputation: 5845

Best way to debug my way through a newly acquainted large PHP app and detect dead code?

Today I am faced with a spaghetti of some new unknown code for a webservice, and I need to make sense of it. The code is using CodeIgniter with a HMVC extension which helps, but the problem is that it contains many unused/old/etc... files/folders. It also does not help that I recently converted to using PHP, so I am still learning my way around best practices.

Thanks!

Upvotes: 3

Views: 163

Answers (1)

halfer
halfer

Reputation: 20440

As per the discussion in the comments, I'd wondered if the execution coverage tools in XDebug would help here. This is a low-level code monitor that watches what lines of PHP code have been executed when you start a program. As you'd expect, this adds a certain level of overhead, so it is generally not added to live environments.

Hosted build systems like Travis and Scrutinizer do code coverage reporting, though they probably rely on tools like PHPUnit and XDebug to actually make them work.

Upvotes: 2

Related Questions