terryyin / lizard

A simple code complexity analyser without caring about the C/C++ header files or Java imports, supports most of the popular languages.
Other
1.85k stars 250 forks source link

suport PHP #92

Closed terryyin closed 8 years ago

iconnor commented 8 years ago

@terryyin this would be great! Really want this

mikesive commented 8 years ago

@terryyin seconded

tobias-klein commented 8 years ago

@terryyin Yes, please add that! :)

terryyin commented 8 years ago

C# has been added. I'm going to close this issue and see if anybody would create an issue for the missing of PHP.

mikesive commented 8 years ago

Hey @terryyin I am really keen for PHP support as PHPMD is very slow. Is it possible to do PHP as well? I had hoped the bounty on bountysource applied to both PHP and C#.

terryyin commented 8 years ago

OK, I've reopened the issue and change the title.

@mikesive I'm going to give PHP a try, but can not be very sure this time. Because PHP can be also inline in HTML. All the other languages are tokenised as the fist step. But I guess with PHP probably some other preprocessing need to be done before tokenising.

we'll see:-)

mikesive commented 8 years ago

Thanks @terryyin look forward to seeing how you go.

terryyin commented 8 years ago

@mikesive , I've added PHP and created a new release in PyPI (1.12.0). It will be great if you can help to verify it. If you want to run lizard for PHP only, do

lizard -lphp

I will improve the PHP support to add things like "namespace" (class names). But I think the basic function is there already now.

The commits did the job are: https://github.com/terryyin/lizard/commit/69336258c2f1cf4c3592a1fa44da6d0091459865 https://github.com/terryyin/lizard/commit/539566d37862902c4068e14e0a7d732827469a99 https://github.com/terryyin/lizard/commit/0ae15e11301a9a79cab2d89bc13e2b0c2bf804a7

mikesive commented 8 years ago

@terryyin looks good! I had a quick run through today, very fast compared to other PHP tools. I will test more thoroughly tomorrow. Thanks for getting this done!

iconnor commented 8 years ago

This works for us! I think you can close it now @terryyin

terryyin commented 8 years ago

Great!