Class: RuboCop::Cop::Homebrew::IORead Private
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
This cop restricts usage of IO.read
functions for security reasons.
Constant Summary collapse
- MSG =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
"The use of `IO.%<method>s` is a security risk."
- RESTRICT_ON_SEND =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
[:read, :readlines].freeze
Instance Method Summary collapse
- #on_send(node) ⇒ Object private
Instance Method Details
#on_send(node) ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
13 14 15 16 17 18 |
# File 'rubocops/io_read.rb', line 13 def on_send(node) return if node.receiver != s(:const, nil, :IO) return if safe?(node.arguments.first) add_offense(node, message: format(MSG, method: node.method_name)) end |