Sha256: e6f27d647ec7bbb047476e235895738a508104838a6746d0960483d9ced0ba12

Contents?: true

Size: 444 Bytes

Versions: 12

Compression:

Stored size: 444 Bytes

Contents

module RuboCop
  module Cop
    module Paraxial
      class Raw < Base
        MSG = '`raw` leads to XSS when called on user input.'

        def on_send(node)
          method_name = node.method_name
          return unless send_methods.include?(method_name)

          add_offense(node, message: format(MSG, method: method_name))
        end

        private

        def send_methods
          [:raw]
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
paraxial-1.4.0 lib/rubocop/cop/paraxial/raw.rb
paraxial-1.3.1 lib/rubocop/cop/paraxial/raw.rb
paraxial-1.3.0 lib/rubocop/cop/paraxial/raw.rb
paraxial-1.2.0 lib/rubocop/cop/paraxial/raw.rb
paraxial-1.1.0 lib/rubocop/cop/paraxial/raw.rb
paraxial-1.0.2 lib/rubocop/cop/paraxial/raw.rb
paraxial-1.0.1 lib/rubocop/cop/paraxial/raw.rb
paraxial-1.0.0 lib/rubocop/cop/paraxial/raw.rb
paraxial-0.9.1 lib/rubocop/cop/paraxial/raw.rb
paraxial-0.9.0 lib/rubocop/cop/paraxial/raw.rb
paraxial-0.8.0 lib/rubocop/cop/paraxial/raw.rb
paraxial-0.7.0 lib/rubocop/cop/paraxial/raw.rb