lizard icon indicating copy to clipboard operation
lizard copied to clipboard

[bug]A error at ruby.py

Open cyw3 opened this issue 7 years ago • 5 comments

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 avatar Dec 18 '17 08:12 cyw3

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.

cyw3 avatar Dec 18 '17 08:12 cyw3

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

baffles avatar Nov 02 '18 18:11 baffles

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 [email protected] 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.

terryyin avatar Nov 03 '18 03:11 terryyin

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'

cyw3 avatar Apr 23 '19 06:04 cyw3

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 [email protected] 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.

terryyin avatar Apr 23 '19 22:04 terryyin