Refactor to reduce lengths and complexity

More changes to lower our settings of `Max` values in `.rubocop.yml`. There's also some "cheating" in the form of a `rubocop:disable` comment. It's in `variable_inspector.rb`, where I didn't see any obvious way to decrease the method length and complexity, and at the same time improve the code. Maybe @yujinakayama has the answer.