Note that there are some explanatory texts on larger screens.

plurals
  1. POHow useful is PHP CodeSniffer? Code Standards Enforcement in General?
    primarykey
    data
    text
    <p>I'm dabbling with the idea of setting up <a href="http://pear.php.net/manual/en/package.php.php-codesniffer.intro.php" rel="nofollow noreferrer">PHP CodeSniffer</a> on our continuous integration server in an effort to improve the quality of our code-base. After reading the documentation I'm very excited about the idea of normalizing and enforcing our coding standards. However, I'm left wondering about the actual improvement to our product. I'm well aware that the sniffer only detects violations to a defined coding-standard but what type of benefits does a clean, consistent, code-base provide? Is it worth the extra work to refactor a project with 100k+ lines of code to conform to the PEAR standard?</p> <p>For those who are not familiar with PHP CodeSniffer or code-smell in general, here is an example output:</p> <blockquote> <p>FILE: /path/to/code/myfile.php<br> FOUND 5 ERROR(S) AFFECTING 2 LINE(S)<br> --<br> 2 | ERROR | Missing file doc comment<br> 20 | ERROR | PHP keywords must be lowercase; expected "false" but found "FALSE"<br> 47 | ERROR | Line not indented correctly; expected 4 spaces but found 1<br> 51 | ERROR | Missing function doc comment<br> 88 | ERROR | Line not indented correctly; expected 9 spaces but found 6 </p> </blockquote> <p>Strictly speaking, the user/client would not notice any difference in a product that was refactored to be standards-compliant but I'm wondering if there are other hidden benefits</p> <p>Right now our code is by no means sloppy and we try to follow our own personal standards which, for the most part, are derived from <a href="http://pear.php.net/manual/en/standards.php" rel="nofollow noreferrer">Pear's Coding Standards</a> but a trained eye can spot the differences. </p> <p>So my question is how much do they improve the quality of a product. What kind of latent benefits resulted from it?</p> <p>Am I just being obsessive-compulsive with my desire to move our product closer to a set of standards? Would it be worth it? If so, What kind of strategy did you use to implement the code-sniffer and correct the subsequent violations that were detected?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload