Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Sexp#value called on multi-item Sexp While processing routes.rb" #551

Closed
dankohn opened this issue Sep 4, 2014 · 5 comments
Closed

"Sexp#value called on multi-item Sexp While processing routes.rb" #551

dankohn opened this issue Sep 4, 2014 · 5 comments

Comments

@dankohn
Copy link

dankohn commented Sep 4, 2014

I'm getting an error on my routes.rb due to this code:

  Company::COMPANY_TYPES.each do |company_type|
    resources company_type.underscore.to_sym, type: company_type, controller: 'companies', path: 'companies'
  end

The routes are designed to support single table inheritance. (See http://stackoverflow.com/a/24921260/1935918 .) Commenting it out removes the error. Oddly, running brakeman --skip-files config/routes.rb still produces the error. The exact error is:

+Errors+
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| Error                                                           | Location                                                                                                                                            |
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| Sexp#value called on multi-item Sexp While processing routes.rb | /Users/dan/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/brakeman-2.4.3/lib/brakeman/processors/lib/rails3_route_processor.rb:27:in `process_call' |
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+

If the error can't be fixed, is it possible for me to add a comment around that method to get brakeman to ignore it, or to have it ignore the whole routing file?

Thanks for a great gem.

@presidentbeef
Copy link
Owner

Hi Dan,

Can you try the latest version of Brakeman? I believe this was already fixed in Brakeman 2.5.0 (with #462).

@presidentbeef
Copy link
Owner

Also, you are right that --skip-files does not affect processing the routes.rb file. However, routes are basically ignored by default anyway (accurately understanding them is really difficult) so errors while processing them doesn't really affect reports.

@dankohn
Copy link
Author

dankohn commented Sep 4, 2014

Thanks. The issue is that pronto-brakeman (0.2.3) is installing brakeman
2.4.3. Only when I separately add brakeman to my Gemfile am I able to
resolve the issue.

Thanks for the great gem and the quick response.

Dan Kohn mailto:dan@dankohn.com
tel:+1-415-233-1000

On Thu, Sep 4, 2014 at 11:58 AM, Justin notifications@github.com wrote:

Also, you are right that --skip-files does not affect processing the
routes.rb file. However, routes are basically ignored by default anyway
(accurately understanding them is really difficult) so errors while
processing them doesn't really affect reports.


Reply to this email directly or view it on GitHub
#551 (comment)
.

@dankohn
Copy link
Author

dankohn commented Sep 4, 2014

Actually, the issue is that the gem of pronto-brakeman requires 2.4.3, unlike master. The solution was top specify master in the Gemfile:

  gem 'pronto-brakeman', github: 'mmozuras/pronto-brakeman', ref: '64a733e'

@presidentbeef
Copy link
Owner

🆒

Repository owner locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants