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

[bug]A error at ruby.py #210

Open cyw3 opened 6 years ago

cyw3 commented 6 years ago

python lizard.py path/to/project --CCN 10 --csv --working_threads 3 --sort cyclomatic_complexity -l javascript -l python -l objectivec -l ttcn -l php -l scala -l ruby -l swift

image

and I can not end the thread of working process. image

cyw3 commented 6 years ago

And I use the command without "--working_threads" below: python lizard.py path/to/project --CCN 10 --csv --sort cyclomatic_complexity -l javascript -l python -l objectivec -l ttcn -l php -l scala -l ruby -l swift

everything it is OK.

baffles commented 5 years ago

Is there a fix for this planned? Running on a single thread is a less than desireable workaround.

terryyin commented 5 years ago

Will look at this before the end of this week. During my 7 hours flight probably.

On 3 Nov 2018, at 3:19 AM, Robert Ferris notifications@github.com wrote:

Is there a fix for this planned? Running on a single thread is a less than desireable workaround.

— 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/210#issuecomment-435464363, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwJYo_jdjk6tuDEWTaafuh7XJ3g64y3ks5urJrXgaJpZM4RFIVK.

cyw3 commented 5 years ago

It does not work with "--working_threads" in lizard 1.16.3 and crash:

$ python3 lizard.py -l ruby -t 3 /Users/xxx/Desktop/Test/ruby/rubyTest

================================================
  NLOC    CCN   token  PARAM  length  location
------------------------------------------------
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/Users/xxx/.pyenv/versions/3.7.0/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/Users/xxx/.pyenv/versions/3.7.0/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/xxx/.pyenv/versions/3.7.0/lib/python3.7/multiprocessing/pool.py", line 470, in _handle_results
    task = get()
  File "/Users/xxx/.pyenv/versions/3.7.0/lib/python3.7/multiprocessing/connection.py", line 251, in recv
    return _ForkingPickler.loads(buf.getbuffer())
  File "/Users/xxx/lizard-1.16.3/lizard_languages/ruby.py", line 12, in __new__
    return super(MyToken, cls).__new__(cls, value.group(0))
AttributeError: 'str' object has no attribute 'group'
terryyin commented 5 years ago

Let me see… Perhaps I can fix this without trying to be compatible with Python2.

Ruby syntax is hard for one time parsing to understand everything.

On 23 Apr 2019, at 2:55 PM, cyw3 notifications@github.com wrote:

It does not work with "--working_threads" in lizard 1.16.3 and crash: ` $ python3 lizard.py -l ruby -t 3 /Users/xxx/Desktop/Test/ruby/rubyTest

================================================ NLOC CCN token PARAM length location

Exception in thread Thread-3: Traceback (most recent call last): File "/Users/xxx/.pyenv/versions/3.7.0/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/Users/xxx/.pyenv/versions/3.7.0/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/Users/xxx/.pyenv/versions/3.7.0/lib/python3.7/multiprocessing/pool.py", line 470, in _handle_results task = get() File "/Users/xxx/.pyenv/versions/3.7.0/lib/python3.7/multiprocessing/connection.py", line 251, in recv return _ForkingPickler.loads(buf.getbuffer()) File "/Users/xxx/lizard-1.16.3/lizard_languages/ruby.py", line 12, in new return super(MyToken, cls).new(cls, value.group(0)) AttributeError: 'str' object has no attribute 'group' `

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/terryyin/lizard/issues/210#issuecomment-485667471, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGASYR7R7KYO4UBBE2WAT3PR2XGJANCNFSM4EIUQVFA.