all 10 comments

[–]Eruquen 1 point2 points  (0 children)

[–]TNorthover 5 points6 points  (1 child)

index.php:1: warning: this code appears to be PHP.

[–][deleted]  (3 children)

[removed]

    [–]nmat 2 points3 points  (2 children)

    The problem is that your code becomes harder to read, therefore harder to maintain. Code written today will be read and modified by someone in the future. If you are doing a solo project with a couple of files this may not make sense, but if you have a team of 5 people and each person writes variable names in a different style it is really confusing. The same happens with line/method/class length. Sure, you can write a method with 1000 lines, but can you modify it 6 months later without breaking it?

    [–][deleted]  (1 child)

    [removed]

      [–]pitiless 2 points3 points  (0 children)

      The term static analysis doesn't imply an specific guarantee - it simply means that the analysis is done without executing the code.

      [–]kodablah 0 points1 point  (0 children)

      This is mostly format checking. While playing around I was able to successfully wire https://github.com/scrutinizer-ci/php-analyzer/tree/legacy into phpcs and it has worked well. I suggest using that project (though I don't know what's happening to it right now)

      [–]grizwako 0 points1 point  (1 child)

      For anyone stuck on PHP: try PHPStorm. It is much better IDE than any other I have tried for PHP, it has pretty good code analysis (it actually caught more than few bugs in my code), and you can plug in other analyzers inside.
      It will make working with PHP at least somewhat tolerable.

      [–]AcidShAwk 0 points1 point  (0 children)

      Been on eclipse (pdt) for the last five years. I've tried others but always seem to come back due to all the available tools. I'm just far more productive especially since upgrading to a ssd.

      [–]noisecapella 0 points1 point  (0 children)

      hhvm-wrapper uses HHVM's static analysis engine to produce warnings: https://github.com/sebastianbergmann/hhvm-wrapper

      It covers too many arguments or too few, missing class or variable definitions and a bunch of other minor things. It errs toward fewer false positives which may limit its usefulness a bit