{"action":"opened","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/4184","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/4184/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/4184/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/4184/events","html_url":"https://github.com/bbatsov/rubocop/issues/4184","id":217272277,"number":4184,"title":"Errors with ThreadSafety/InstanceVariableInClassMethod cop","user":{"login":"afdev82","id":4134610,"avatar_url":"https://avatars0.githubusercontent.com/u/4134610?v=3","gravatar_id":"","url":"https://api.github.com/users/afdev82","html_url":"https://github.com/afdev82","followers_url":"https://api.github.com/users/afdev82/followers","following_url":"https://api.github.com/users/afdev82/following{/other_user}","gists_url":"https://api.github.com/users/afdev82/gists{/gist_id}","starred_url":"https://api.github.com/users/afdev82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afdev82/subscriptions","organizations_url":"https://api.github.com/users/afdev82/orgs","repos_url":"https://api.github.com/users/afdev82/repos","events_url":"https://api.github.com/users/afdev82/events{/privacy}","received_events_url":"https://api.github.com/users/afdev82/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-27T14:52:12Z","updated_at":"2017-03-27T14:52:12Z","closed_at":null,"body":"I have errors with the ThreadSafety/InstanceVariableInClassMethod cop with Rails 4.2.8.\r\n\r\nThis is the stack trace:\r\n```\r\nundefined method `command?' for s(:ivar, :@current_alchemy_site):RuboCop::AST::Node\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-thread_safety-0.3.2/lib/rubocop/cop/thread_safety/instance_variable_in_class_method.rb:55:in `block in singleton_method_definition?'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-thread_safety-0.3.2/lib/rubocop/cop/thread_safety/instance_variable_in_class_method.rb:53:in `any?'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-thread_safety-0.3.2/lib/rubocop/cop/thread_safety/instance_variable_in_class_method.rb:53:in `singleton_method_definition?'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-thread_safety-0.3.2/lib/rubocop/cop/thread_safety/instance_variable_in_class_method.rb:33:in `class_method_definition?'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-thread_safety-0.3.2/lib/rubocop/cop/thread_safety/instance_variable_in_class_method.rb:21:in `on_ivar'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:43:in `block (2 levels) in on_ivar'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:106:in `with_cop_error_handling'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:42:in `block in on_ivar'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:41:in `each'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:41:in `on_ivar'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:101:in `block in on_send'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:99:in `each'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:99:in `each_with_index'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:99:in `on_send'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_send'\r\n(eval):2:in `block in on_pair'\r\n(eval):2:in `each'\r\n(eval):2:in `on_pair'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_pair'\r\n(eval):2:in `block in on_hash'\r\n(eval):2:in `each'\r\n(eval):2:in `on_hash'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_hash'\r\n(eval):2:in `block in on_pair'\r\n(eval):2:in `each'\r\n(eval):2:in `on_pair'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_pair'\r\n(eval):2:in `block in on_hash'\r\n(eval):2:in `each'\r\n(eval):2:in `on_hash'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_hash'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:101:in `block in on_send'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:99:in `each'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:99:in `each_with_index'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:99:in `on_send'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_send'\r\n(eval):2:in `block in on_begin'\r\n(eval):2:in `each'\r\n(eval):2:in `on_begin'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_begin'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:95:in `on_def'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_def'\r\n(eval):2:in `block in on_begin'\r\n(eval):2:in `each'\r\n(eval):2:in `on_begin'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_begin'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:88:in `on_class'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:47:in `on_class'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/ast/traversal.rb:12:in `walk'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/commissioner.rb:60:in `investigate'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/team.rb:124:in `investigate'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/team.rb:112:in `offenses'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cop/team.rb:54:in `inspect_file'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:248:in `inspect_file'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:195:in `block in do_inspection_loop'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:227:in `block in iterate_until_no_changes'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:220:in `loop'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:220:in `iterate_until_no_changes'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:191:in `do_inspection_loop'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:101:in `block in file_offenses'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:111:in `file_offense_cache'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:99:in `file_offenses'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:90:in `process_file'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:68:in `block in each_inspected_file'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:65:in `each'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:65:in `reduce'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:65:in `each_inspected_file'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:57:in `inspect_files'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/runner.rb:36:in `run'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cli.rb:72:in `execute_runner'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/lib/rubocop/cli.rb:27:in `run'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/bin/rubocop:13:in `block in <top (required)>'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'\r\n/home/antonio/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rubocop-0.48.0/bin/rubocop:12:in `<top (required)>'\r\n/home/antonio/.rbenv/versions/2.4.0/bin/rubocop:22:in `load'\r\n/home/antonio/.rbenv/versions/2.4.0/bin/rubocop:22:in `<main>'\r\n```\r\n--------\r\n## RuboCop version\r\n\r\n```\r\n$ rubocop -V\r\n0.48.0 (using Parser 2.4.0.0, running on ruby 2.4.0 x86_64-linux)\r\n```\r\n"}}
{"actor":{"display_login":"afdev82"}}