PHPCPD(1)

πŸ“¦
version 6.0.3 Β· 2 versions
, in debian bookworm, ubuntu noble

πŸ‘‘ PHPCPD(1) β€” User Commands πŸ’…

okay bestie, sit down, hydrate, because today we're talking about phpcpd β€” the PHPCPD command line interface, and she is that girl. it's a User Commands situation, iykyk. ✨


🌸 NAME 🌸

phpcpd β€” literally the PHPCPD command line interface. that's it, that's the name, no notes. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

phpcpd [options] <directory>

like... you give her options, you give her a directory, she does her thing. periodt. πŸŽ€


πŸ’œ DESCRIPTION πŸ’œ

so what is this? it's a Copy and paste detector (CPD) for PHP code, no cap. this tool gives you the tea β€” the details β€” about duplicated lines inside a PHP project. she's the friend who notices you wore the same fit twice, except it's your codebase and the receipts are in the terminal. πŸ‘‘

lowkey iconic. highkey essential. 🌈


πŸ“ Options for selecting files

these are the "who's invited to the party" options, bestie.

  • --suffix <suffix> β€” include files with names ending in <suffix> in the analysis. default is .php, and yes you can pass it multiple times if you're feeling extra. ✨
  • --exclude <path> β€” exclude files with <path> in their path from the analysis. also can be given multiple times, because sometimes you gotta say "not you, not today." πŸ™ˆ

🧚 Options for analysing files

now we get into the actual detective work. πŸ”

  • --fuzzy β€” fuzz variable names. that's the whole vibe, fr fr.
  • --min-lines <N> β€” minimum number of identical lines. default: 5.
  • --min-tokens <N> β€” minimum number of identical tokens. default: 70.

⭐ Options for report generation

you want receipts? she got receipts. πŸ’Œ

  • --log-pmd <file> β€” write log in PMD-CPD XML format to <file>. slay.

πŸ’€ reminder bestie: every single one of those flags is exactly what it says on the tin. don't go inventing new ones, don't go skipping any. we keep it accurate in this group chat.

🫢 cute sign-off 🫢

this lil masterpiece is from phpcpd 6.0.3, dated July 2022 β€” so if you're citing her, cite her right. πŸ’… go forth, find those duplicated lines, and tell your codebase to stop copy-pasting. no cap. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from