rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
 rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
346676
def matches?(code)
      path = 'http://test.host/redirect'

      unless @scope.respond_to?(:request) && @scope.respond_to?(:response)
        fail_spec_type and return false
      end
      unless ALLOWED_REQUEST_TYPES.include? @scope.request.class
        fail_request_type and return false
      end
      unless ALLOWED_RESPONSE_TYPES.include? @scope.response.class
        fail_response_type and return false
      end
      @scope.request.env['HTTP_REFERER'] ||= path
      unless code.is_a? Proc
        fail_input_type code and return false
      end
      code.call
      @response = @scope.response
      status_matcher = STATUS_CODE_MATCHER.new :redirect
      unless status_matcher.matches? @response
        fail_status_code status_matcher and return false
      end
      path_matcher = REDIRECT_PATH_MATCHER.new @scope, path
      unless path_matcher.matches? @response
        fail_redirect_path path_matcher and return false
      end
      true
    end
654144
def append_to_existing_spec(class_or_module, dry_run, rails_mode, spec_path)
      existing_spec = File.read(spec_path)
      lacking_methods = class_or_module.method_list.
        select { |m| m.visibility == :public }.
        reject { |m| existing_spec.match(m.name) }

      if lacking_methods.empty?
        puts "#{spec_path} skipped."
      else
        # These names are used in ERB template, don't delete.
        # rubocop:disable Lint/UselessAssignment
        methods_to_generate = lacking_methods
        c = class_or_module
        # rubocop:enable Lint/UselessAssignment

        erb = RSpecKickstarter::ERBFactory.new(@delta_template).get_instance_for_appending(rails_mode, spec_path)
        additional_spec = erb.result(binding)

        last_end_not_found = true
        code = existing_spec.split("\n").reverse.reject { |line|
          before_modified = last_end_not_found
          last_end_not_found = line.gsub(/#.+$/, '').strip != 'end' if before_modified
          before_modified
        }.reverse.join("\n") + "\n" + additional_spec + "\nend\n"

        if dry_run
          puts "----- #{spec_path} -----"
          puts code
        else
          File.open(spec_path, 'w') { |f| f.write(code) }
        end
        puts "#{spec_path} modified."
      end
    end
26450
def method_missing(method_name, *_args)
      if attrs.key?(method_name.to_s)
        attrs[method_name.to_s]
      else
        super(method_name)
      end
    end
390061
def method_missing(method, *args, &block)
      
      attribute = ActiveSupport::Inflector.camelize(method.to_s, false)
  
      if attribute =~ /=$/
        attribute = attribute.chop
        return super unless self.attributes.include?(attribute)
        self.changed_attributes[attribute] = args[0]
        self.attributes[attribute] = args[0]
      else
        return super unless self.attributes.include?(attribute)
        self.attributes[attribute]
      end 
            
    end
1072451
def method_missing(method, *args)
      attr_name, suffix = method.to_s.scan(/([a-z0-9\_]+)(\?|\=)?$/i).first
      if suffix == ATTR_SETTER
        @_metaclass.send(:attr_accessor, attr_name)
        @_fields << attr_name.to_sym
        send(method, args.first)
      elsif attr_name && @_fields.include?(attr_name.to_sym)
        value = @attrs[attr_name.to_sym]
        case suffix
        when nil
          @_metaclass.send(:attr_accessor, attr_name)
          value
        when ATTR_PREDICATE then !!value
        end
      elsif suffix.nil? && SPECIAL_METHODS.include?(attr_name)
        instance_variable_get "@_#{attr_name}"
      elsif attr_name && !@_fields.include?(attr_name.to_sym)
        nil
      else
        super
      end
    end
738331
def method_missing(method_name, *args, &_block)
      args = args.first if args.size == 1
      @events[method_name] = args
    end
846125
def method_missing(name, *args)
      value = @values[name]
      if value.nil? && !@values.has_key?(name)
        address = "<#{self.class.name}:0x00#{(self.object_id << 1).to_s(16)}>"
        raise NoMethodError.new("undefined method `#{name}' for ##{address}")
      end
      value
    end
469133
def adapt_example!(parsed_example, gathered_comments)
      # Saving off the original data
      parsed_example['cuke_modeler_parsing_data'] = Marshal::load(Marshal.dump(parsed_example))

      # Removing parsed data for child elements in order to avoid duplicating data
      parsed_example['cuke_modeler_parsing_data']['tags'] = nil
      parsed_example['cuke_modeler_parsing_data']['rows'] = nil

      if parsed_example['comments']
        parsed_example['cuke_modeler_parsing_data']['comments'] = nil
        gathered_comments.concat(parsed_example['comments'])
      end

      parsed_example['rows'].each do |row|
        adapt_table_row!(row, gathered_comments)
      end

      if parsed_example['tags']
        parsed_example['tags'].each do |tag|
          adapt_tag!(tag)
        end
      end
    end
237926
def [](attr)
      return nil unless instance_variable_defined?(:@attributes) and @attributes.is_a?(Hash)
      @attributes[attr] or (attr.is_a?(String) ? @attributes[attr.to_sym] : @attributes[attr.to_s])
    end
847711
def feature_params
        if Rails.version.to_i < 5
          ActiveSupport::HashWithIndifferentAccess.new(params[:feature])
        else
          params.require(:feature).permit(:name, :description, :state)
        end
      end
61131
def method_missing meth, *args
      meth_s = meth.to_s
      if meth_s =~ /=$/ and args.length == 1
        key = meth_s.sub(/=$/,'').camelcase
        if @data and @data.key? key
          @data[key] = args[0]
        else
          super meth, *args
        end
      else
        key = meth_s.camelcase
        if @data and @data.key? key
          @data[key]
        else
          super meth, *args
        end
      end
    end
258778
def run
      parse_arguments

      case @options[:action]
      when :install, :uninstall
        install_or_uninstall
      when :template_dir
        print_template_directory_path
      when :sign
        sign
      when :run_all
        run_all
      end
    rescue Overcommit::Exceptions::ConfigurationSignatureChanged => ex
      puts ex
      exit 78 # EX_CONFIG
    rescue Overcommit::Exceptions::HookContextLoadError => ex
      puts ex
      exit 64 # EX_USAGE
    end
680920
def method_missing(name, *args, &reply_handler)
      unless @default_iface && has_iface?(@default_iface)
        # TODO: distinguish:
        # - di not specified
        # TODO
        # - di is specified but not found in introspection data
        raise NoMethodError, "undefined method `#{name}' for DBus interface `#{@default_iface}' on object `#{@path}'"
      end

      begin
        @interfaces[@default_iface].method(name).call(*args, &reply_handler)
      rescue NameError => e
        # interesting, foo.method("unknown")
        # raises NameError, not NoMethodError
        raise unless e.to_s =~ /undefined method `#{name}'/
        # BTW e.exception("...") would preserve the class.
        raise NoMethodError, "undefined method `#{name}' for DBus interface `#{@default_iface}' on object `#{@path}'"
      end
    end
774241
def method_missing(m, *args, &block)
      if m.to_s =~ /^with_(.+)$/
        with($1.to_sym => args.first)
        self
      else
        super
      end
    end
499256
def method_missing(method, *args, &block)
      name = method.to_s
      if respond_to_missing? name
        @bases[name]
      else
        super(method, *args, &block)
      end
    end
858942
def method_missing(method, *args)
      if (i = dimension_method_names.find_index(method))
        define_singleton_method(method) do
          dimensions[i]
        end
        send(method)
      elsif (i = metric_method_names.find_index(method))
        define_singleton_method(method) do
          convert_metric(i)
        end
        send(method)
      else
        super
      end
    end
895912
def <<(fromTo)
      return nil unless fromTo.is_a?(Languages::FunctionAbstract)
      @name = fromTo.name
      @parameters = fromTo.parameters
      @managerCondLoopAndBlock = fromTo.managerCondLoopAndBlock
      @visibility = fromTo.visibility
      @comments = fromTo.comments
      @type = @type
    end