I just found out about the tool PHPMD and I notice that it's really useful, the thing is that I read the documentation about creating custom rules and stuff, but it just talks about using software metrics from PHPDepend.
I would like to know if it's possible to implement a specific rule to check for duplicated code?
I notice that I can also use the Abstract Syntax Tree of a specific node in my custom rule, but maybe that won't help me much right?
Because to check for duplicated code I need to compare several different function/method nodes, and the apply method is called once for each node?
How could I extend PHPMD to achieve deep code analysis like this? I wanna go far beyond software metrics..
Thank you!