cqfn / aibolit

Static Analyzer for Java Code with Machine Learning in Mind
https://pypi.org/project/aibolit/
51 stars 17 forks source link

TypeError: '<' not supported between instances of 'NoneType' and 'NoneType' #531

Closed g4s8 closed 4 years ago

g4s8 commented 4 years ago

After updating to 1.2.3 version aibolit starting to fail for recommend command for github.com/artipie/artipie repository with error:

$ aibolit recommend --folder src/main/java --format=long --full 

Traceback (most recent call last):
  File "/home/g4s8/.local/lib64/python3.6/site-packages/aibolit/__main__.py", line 788, in main
    exit_code = run_parse_args(commands)
  File "/home/g4s8/.local/lib64/python3.6/site-packages/aibolit/__main__.py", line 102, in run_parse_args
    return commands_dict[args.command]()
  File "/home/g4s8/.local/lib64/python3.6/site-packages/aibolit/__main__.py", line 785, in <lambda>
    'recommend': lambda: check(),
  File "/home/g4s8/.local/lib64/python3.6/site-packages/aibolit/__main__.py", line 682, in check
    new_results = format_converter_for_pattern(results, 'code_line')
  File "/home/g4s8/.local/lib64/python3.6/site-packages/aibolit/__main__.py", line 729, in format_converter_for_pattern
    } for line in sorted(x['code_lines'])] for x in items
  File "/home/g4s8/.local/lib64/python3.6/site-packages/aibolit/__main__.py", line 729, in <listcomp>
    } for line in sorted(x['code_lines'])] for x in items
TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'
acheshkov commented 4 years ago

@lyriccoder, can we add an integration test to avoid such things in the future?

acheshkov commented 4 years ago

@rultor release, tag=1.2.4

rultor commented 4 years ago

@rultor release, tag=1.2.4

@acheshkov OK, I will release it now. Please check the progress here

rultor commented 4 years ago

@rultor release, tag=1.2.4

@acheshkov Done! FYI, the full log is here (took me 16min)

g4s8 commented 4 years ago

@acheshkov @lyriccoder it can be reproduced with this script in docker:

$ docker run --rm -it python:latest /bin/bash
# pip install --upgrade pip
# pip install aibolit
# mkdir /repo && cd /repo
# git clone https://github.com/artipie/artipie.git
# cd artipie
# aibolit recommend --folder src/main/java --format=long --full 
lyriccoder commented 4 years ago

@acheshkov can we close it?

g4s8 commented 4 years ago

@lyriccoder it's working now, thanks