Closed erizhang closed 8 years ago
Oops, thans Eric!
I guess it's new. Let me investigate asap.
Hey @erizhang,
I know where to fix the problem but could you please do me a favour to find which exact file failed lizard?
br, Terry
@terryyin please check your private mail for file, and wechat for password.
@erizhang fixed and released. But still, please review my fix: https://github.com/terryyin/lizard/commit/909df68c9092ae3a6e2a07e7af61a6e3789013d5
Maybe you solved the return struct
issue, but still has another one:
➜ SS_ILEITP lizard src > eitp_complexity
Traceback (most recent call last):
File "/usr/bin/lizard", line 6, in <module>
lizard_main(sys.argv)
File "/usr/lib/python2.7/site-packages/lizard.py", line 977, in lizard_main
printer(result, options, OutputScheme(options.extensions))
File "/usr/lib/python2.7/site-packages/lizard.py", line 844, in print_result
result = print_and_save_modules(result, option.extensions, scheme)
File "/usr/lib/python2.7/site-packages/lizard.py", line 808, in print_and_save_modules
for module_info in all_modules:
File "/usr/lib/python2.7/site-packages/lizard.py", line 665, in __call__
filename, open(filename, 'rU').read())
File "/usr/lib/python2.7/site-packages/lizard.py", line 676, in analyze_source_code
for _ in reader(tokens, reader):
File "/usr/lib/python2.7/site-packages/lizard.py", line 378, in __call__
self._state(token)
File "/usr/lib/python2.7/site-packages/lizard.py", line 359, in read_until_matching_brackets
func(self, token)
File "/usr/lib/python2.7/site-packages/lizard.py", line 569, in _state_dec
self.bracket_stack.pop()
IndexError: pop from empty list
But notice that, if I deal the files one by one, the lizard works well, this issue is only produced when handle the files as batch.
Hi Eric,
It’s highly unlikely that the problem is caused by multiple files. Could you please help me to investigate again? I’m counting on you, bro.
I could just add an if before self.bracket_stack.pop(), but don’t feel right to do it unless I know what causes the problem.
terry
On 15 Jan 2016, at 10:24 AM, Eric Zhang notifications@github.com wrote:
Maybe you solve the return struct issue, but still has another one:
➜ SS_ILEITP lizard src > eitp_complexity Traceback (most recent call last): File "/usr/bin/lizard", line 6, in
lizard_main(sys.argv) File "/usr/lib/python2.7/site-packages/lizard.py", line 977, in lizard_main printer(result, options, OutputScheme(options.extensions)) File "/usr/lib/python2.7/site-packages/lizard.py", line 844, in print_result result = print_and_save_modules(result, option.extensions, scheme) File "/usr/lib/python2.7/site-packages/lizard.py", line 808, in print_and_save_modules for module_info in all_modules: File "/usr/lib/python2.7/site-packages/lizard.py", line 665, in call filename, open(filename, 'rU').read()) File "/usr/lib/python2.7/site-packages/lizard.py", line 676, in analyze_sourcecode for in reader(tokens, reader): File "/usr/lib/python2.7/site-packages/lizard.py", line 378, in call self._state(token) File "/usr/lib/python2.7/site-packages/lizard.py", line 359, in read_until_matching_brackets func(self, token) File "/usr/lib/python2.7/site-packages/lizard.py", line 569, in _state_dec self.bracket_stack.pop() IndexError: pop from empty list But notice that, if I deal the files one by one, the lizard works well, this issue is only produced when handle the files as batch. — Reply to this email directly or view it on GitHub https://github.com/terryyin/lizard/issues/81#issuecomment-171849784.
@erizhang could you please confirm and close the case?
Trying to calculate the complexity for a folder, the source files are huge. it prompts the error below:
and the result is dumped out for 181 lines.