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) ⇒ void private
Instance Method Details
#on_send(node) ⇒ void
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.
This method returns an undefined value.
14 15 16 17 18 19 |
# File 'rubocops/io_read.rb', line 14 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 |