yegor256 / cam

Classes and Metriсs (CaM): a dataset of Java classes from public open-source GitHub repositories
http://cam.yegor256.com
MIT License
23 stars 38 forks source link

Missing `to_h` cast in repo discovery script #211

Closed howcanunot closed 6 months ago

howcanunot commented 7 months ago

if write make dataset/repositories.csv with Total number of repositories to fetch from GitHub. > 30 and % 100 != 0 we get an exception:

cam/steps/discover-repos.rb:125:in `<main>': undefined method `values' for an instance of Array (NoMethodError)
lines = [found.first[1].keys.join(',')] + found.values.map { |m| m.values.join(',') }
Did you mean?  values_at

This happens because if we exit the loop before we have collected enough repositories, the script tries to slice hash - line with bug

i suppose we miss to_h cast

howcanunot commented 7 months ago

@yegor256 fyi noticed it while I was working on https://github.com/yegor256/cam/issues/186 i will fix it

yegor256 commented 6 months ago

fixed