sebastian / phpcpd
此包已被废弃,不再维护。未建议替代包。
PHP代码的复制粘贴检测器(CPD)。
6.0.3
2020-12-07 05:39 UTC
Requires
- php: >=7.3
- ext-dom: *
- phpunit/php-file-iterator: ^3.0
- phpunit/php-timer: ^5.0
- sebastian/cli-parser: ^1.0
- sebastian/version: ^3.0
README
该项目不再维护,其仓库仅保留归档目的。
PHP复制粘贴检测器(PHPCPD)
phpcpd
是一个用于PHP代码的复制粘贴检测器(CPD)。
安装
此工具以 PHP存档(PHAR) 的形式分发
$ wget https://phar.phpunit.de/phpcpd.phar $ php phpcpd.phar --version
使用 Phive 是管理项目工具依赖项的推荐方式
$ phive install phpcpd $ ./tools/phpcpd --version
使用示例
$ php phpcpd.phar --fuzzy wordpress-5.5
phpcpd 6.0.0 by Sebastian Bergmann.
Found 121 clones with 8137 duplicated lines in 69 files:
- /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core/Curve25519/H.php:19-1466 (1447 lines)
/home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core32/Curve25519/H.php:19-1466
.
.
.
- /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core32/Curve25519.php:879-889 (10 lines)
/home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core32/Curve25519.php:1072-1082
1.82% duplicated lines out of 446676 total lines of code.
Average size of duplication is 67 lines, largest clone has 1447 of lines
Time: 00:02.980, Memory: 318.00 MB