Duplicated lines not being detected
zagrad opened this issue · 2 comments
zagrad commented
So the following code is not being detected as code duplication. Is that a bug, or do I not understand the purpose of this tool?
<?php
print('So this line might be there again');
print('As well as this line...');
echo "Do something else";
print('So this line might be there again');
print('As well as this line...');
die('-- the end');
aboks commented
This is because PHPCPD only reports duplications that exceed a given number of lines (default 5) and a given number of tokens (default 70). See the --min-lines
and --min-tokens
command line options.
sebastianbergmann commented
Thanks for the explanation, @aboks.