Skip to content

Instantly share code, notes, and snippets.

@arwagner
Created October 3, 2011 21:02
Show Gist options
  • Save arwagner/1260244 to your computer and use it in GitHub Desktop.
Save arwagner/1260244 to your computer and use it in GitHub Desktop.
fun times
code_str = <<RUBY
class Foo
attr_reader :bar1
attr_reader :bar2
end
RUBY
smelly_classes = Reek2.parse(code_str) do
classes.where do |klass|
calls = klass.calls_to(:attr_reader)
calls.count > 1
end
end
smelly_classes.names.should == ['Foo']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment