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

ignore warnings option not working #223

Closed mosesliao closed 6 years ago

mosesliao commented 6 years ago

I tried to run lizard --ignore_warnings 2 to a project that has more than 2 warnings but it still goes through. Can you look into it? I need this to work.

I cannot force my CI to stop if this feature is not working

terryyin commented 6 years ago

Yes. Will come back to this soon.

On 28 Feb 2018, at 12:58 PM, Liao Gangzheng Moses notifications@github.com wrote:

I tried to run lizard --ignore_warnings 2 to a project that has more than 2 warnings but it still goes through. Can you look into it? I need this to work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/terryyin/lizard/issues/223, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwJYgM6YkAitHhjJweoKDSNw6BYOMyjks5tZNzcgaJpZM4SWE-C.

terryyin commented 6 years ago

it seems the status code is 1 for me here. Can you give a bit more information for me to reproduce this?

mosesliao commented 6 years ago

I run lizard -l swift --ignore_warnings 2 jarvis. it produce the following warning

!!!! Warnings (cyclomatic_complexity > 15 or length > 1000 or parameter_count > 100) !!!!
================================================
  NLOC    CCN   token  PARAM  length  location  
------------------------------------------------
     129     19    914      1     170 validateAll@187-356@jarvis/OpenAccountPremiseViewController.swift
      60     16    405      1      77 textFieldDidEndEditing@451-527@jarvis/OpenAccountAccountInformationViewController.swift
      64     20    306      0      84 toJSON@181-264@jarvis/AccountOpeningRequest.swift
      75     34    353      0      76 get@253-328@jarvis/APIClientRouter.swift
     100     32   1089      0     116 asURLRequest@343-458@jarvis/APIClientRouter.swift
      44     17    292      2      48 cell@162-209@jarvis/SubmitMeterSectionController.swift
==========================================================================================

Still the script goes through without throwing an error

mosesliao commented 6 years ago

then I run this in irb it throws an error which I wanted

irb(main):017:0> `lizard -l swift --ignore_warnings a jarvis`
usage: lizard [options] [PATH or FILE] [PATH] ...
/usr/local/bin/lizard: error: argument -i/--ignore_warnings: invalid int value: 'a'
=> ""
mosesliao commented 6 years ago

Ok I know what is the problem now. closing issue