skanev/skeptic — pull request #26 by s2gatev (2014-10-27 12:52:57+00:00)
Title: Fix max arity rule for methods defined outside classes / modules

Проблемен код:

```ruby
def something(a, b, c, d, e)
end
```

Проблемен rule:
`--max-method-arity 4`

Резултат:
```
/Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/rules/max_method_arity.rb:46:in `block in ': undefined method `+' for nil:NilClass (NoMethodError)
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:28:in `instance_exec'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:28:in `block in visit'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:44:in `with_sexp_type'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:28:in `visit'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:33:in `block in visit'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:32:in `each'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:32:in `visit'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:33:in `block in visit'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:32:in `each'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/sexp_visitor.rb:32:in `visit'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/rules/max_method_arity.rb:15:in `apply_to'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/critic.rb:24:in `block in criticize'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/rule_table.rb:21:in `block in each_rule'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/rule_table.rb:20:in `each'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/rule_table.rb:20:in `each_rule'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/lib/skeptic/critic.rb:20:in `criticize'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/bin/skeptic:37:in `criticize_file'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/gems/skeptic-0.0.9/bin/skeptic:80:in `'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/bin/skeptic:23:in `load'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/bin/skeptic:23:in `

'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
from /Users/s2gatev/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `

'
```