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

Fixed warning threshold inconsistency in HTML output. #273

Closed corentin-plouet closed 5 years ago

corentin-plouet commented 5 years ago

As documented, warnings are generated when metrics (e.g. CCN) are bigger (>) than the threshold. Thus, we should use the same logic in the HTML output, and use greater (>) instead of gte (>=).

corentin-plouet commented 5 years ago

Hmm, this was supposed to be two distinct pull requests, but I think I clicked the wrong button...

The second change is actually a new feature, adding a command-line option to specify an output file. This is useful to integrate Lizard in a tool like CMake, which lacks the ability to redirect standard output when running external commands (because it's cross-platform and supports multiple build generators).

Nice project, by the way :+1: I was able to generate a report very easily (aside from the aforementioned limitation), and the word cloud feature is pretty cool.

corentin-plouet commented 5 years ago

Well, the test suite worked on my machine... Looks like I used some Python 3 stuff that's not available in 2 ( open(..., encoding="utf-8" ) ) I'll have to investigate why the MD5 checks fail.

corentin-plouet commented 5 years ago

Looks better now :sunglasses: The MD5 comparison logic was not the right approach: too fragile and hard to maintain. Now I just compare the first line of the files to ensure it's the right format.

terryyin commented 5 years ago

This looks cool. thanks!