presidentbeef/brakeman — Issue #36: Brakeman hangs scanning controllers. 
Author: tw-ngreen
Created: 2012-01-30 16:59:27+00:00
State: open

Placing the following code in test/apps/rails2/app/controllers/application_controller.rb seems to cause brakeman to hang indefinitely when I attempt to run tests. This came up in an app we were testing.

before_filter :awesome

def funky_panda
end

def awesome
something = if params[:thang]
params[:thang]
elsif somevar = "monkeypanda"
somevar = somevar.split(",").map { |s|
s += 'stuff' unless s =~ /regex/
s.split('things')
}.first
somevar.first.downcase
end

if (some_var = SomeClass.things, something)
AnotherClass.thang = @thang = some_var.to_sym
elsif (some_var = find_thang(AppConfig.stuff, something))
AnotherClass.thang = @thang = some_var.to_sym
end

if beta_override && cookies['yummy'] != @thang.to_s
cookies['yummy'] = { :value => @thang.to_s }
end

return true
end