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

Fix error division by zero when running on empty folder. #149

Closed milo-hyben closed 8 years ago

milo-hyben commented 8 years ago

Hi Terry, in case when lizard does not find any function in the file or folder it crashes. I added a simple condition to check for such scenarios.

Cheers, Milo

terryyin commented 8 years ago

@milo-hyben thank you so much for the pull-request. Sorry for the late reply, being travelling for two weeks in a row.

Would you be interested in adding a unit test for this scenario? Or you can tell me one scenario that can reproduce the problem and I will add the test.

milo-hyben commented 8 years ago

Hi Terry, added s simple test for xml output which was causing lizard to crash. Let me know if you think that is good enough.

terryyin commented 8 years ago

Great. Thanks:-)