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

Freeze call index results #1452

Merged
merged 1 commit into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/brakeman/checks/check_content_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ def process_result result

@current_file = result[:location][:file]

call = result[:call] = result[:call].dup

call = result[:call]
args = call.arglist

tag_name = args[1]
Expand Down
2 changes: 1 addition & 1 deletion lib/brakeman/checks/check_link_to.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def process_result result

#Have to make a copy of this, otherwise it will be changed to
#an ignored method call by the code above.
call = result[:call] = result[:call].dup
call = result[:call]

first_arg = call.first_arg
second_arg = call.second_arg
Expand Down
4 changes: 1 addition & 3 deletions lib/brakeman/checks/check_link_to_href.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def run_check
end

def process_result result
#Have to make a copy of this, otherwise it will be changed to
#an ignored method call by the code above.
call = result[:call] = result[:call].dup
call = result[:call]
@matched = false

url_arg = if result[:block]
Expand Down
5 changes: 3 additions & 2 deletions lib/brakeman/processors/lib/find_all_calls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def process_rlist exp
end

def process_call exp
@calls << create_call_hash(exp)
@calls << create_call_hash(exp).freeze
exp
end

Expand All @@ -72,6 +72,7 @@ def process_iter exp

call_hash[:block] = exp.block
call_hash[:block_args] = exp.block_args
call_hash.freeze

@calls << call_hash

Expand Down Expand Up @@ -136,7 +137,7 @@ def add_simple_call method_name, exp
:call => exp,
:nested => false,
:location => make_location,
:parent => @current_call }
:parent => @current_call }.freeze
end

#Gets the target of a call as a Symbol
Expand Down