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

Swift: guard clause is not counted by ccn #267

Closed kijuky closed 5 years ago

kijuky commented 5 years ago

This code's ccn is 2, but lizard output 1.

guard isValid else { return }

This code is equal if isValid { return }, so I want that lizard output 2.

terryyin commented 5 years ago

Yes, I think this should be counted. Would you make the change? Just add a test and make it pass. Otherwise I can fix this by next week.

kijuky commented 5 years ago

Thank you for your comment!

I tried to create PR #268 referring to the implementation of parser of other languages.

kijuky commented 5 years ago

Thank you for merging! This issue closed!