rubocop: enable Metrics/MethodLength
761012
def final_definitions
      parent_definitions = Hash(parent&.definitions&.dup)
      definitions.each_with_object(parent_definitions) do |(key, val), obj|
        obj[key] = check_type(obj[key], val)
      end
    end
763039
def method_missing(method, *args, &block)
      super
    rescue NoMethodError
      return regs(method) if self.has_reg?(method)
      return ports(method) if self.has_port?(method)
      if method.to_s =~ /=$/
        define_singleton_method(method) do |val|
          instance_variable_set("@#{method.to_s.sub('=', '')}", val)
        end
      else
        define_singleton_method(method) do
          instance_variable_get("@#{method}")
        end
      end
      send(method, *args, &block)
    end
738331
def method_missing(method_name, *args, &_block)
      args = args.first if args.size == 1
      @events[method_name] = args
    end
537019
def method_missing(method_id, *arguments, &block)#:nodoc:

      # If the missing method is  XXX_without_static_rc, define XXX
      # using the superclass ActiveRecord::Base method_missing then
      # Finally, alias chain it to XXX_with_static_rc
      if ((match = method_id.to_s.match(/(.*)_without_static_rc$/)) &&
          (base_method_id = match[1]))
        begin
          return super(base_method_id, *arguments, &block)
        ensure
          define_static_rc_alias(base_method_id)
        end
      end

      # If the missing method is a finder like find_by_name
      # Define on the class then invoke find_by_name_with_static_rc
      if match = ActiveRecord::DynamicFinderMatch.match(method_id)
        attribute_names = match.attribute_names
        if all_attributes_exists?(attribute_names) &&  match.finder?
          attributes = construct_attributes_from_arguments(attribute_names, arguments)
          method_name = define_static_record_finder_method(method_id, match.finder, match.bang?, attributes)
          return self.send method_name, *arguments
        end
      end

      #If nothing matches, invoke the super
      super(method_id, *arguments, &block)
    end
631217
def method_missing(attr_name)
      member_sym = attr_name.id2name.to_sym
      self[member_sym]
    rescue ArgumentError # `member_sym` field doesn't exist.
      raise(NoMethodError.new("undefined method '#{attr_name}' for #{self}"))
    end
386761
def method_missing(method_name, *args, &block)
      mapped_key = key_map[method_name.to_sym]
      if attributes.has_key?(mapped_key)
        attributes[mapped_key]
      else
        super
      end
    end
1069886
def method_missing(id, *args, &block)
      ids = id.to_s
      if instance_variable_defined?(:@attributes)
        return @attributes[id] if @attributes.has_key?(id)
        return @attributes[ids] if @attributes.has_key?(ids)
      end
      raise NoMethodError.new("#{ids} not found", name)
    end
1373166
def method_missing(meth, *args)
      if include?(meth.to_s) then
        if args.empty? then
          create_getter meth
        else
          raise ArgumentError, "wrong number of arguments (#{args.size} for 0)"
        end
      elsif meth.to_s =~ /^(.+)\?$/ and include?(root_meth = $1) then
        if args.empty? then
          !!create_getter(root_meth) #TODO duplication of logic
        else
          raise ArgumentError, "wrong number of arguments (#{args.size} for 0)"
        end
      else
        super
      end
    end
467556
def method_missing(method, *args, &block)
      if redis_operation?(method)
        dispatch(method, *args, &block)
      else
        super
      end
    end
1120907
def method_missing(method, *args)
      super unless args.empty?

      if @ifds.first.respond_to?(method)
        @ifds.first.send(method)
      elsif TAGS.include?(method)
        @ifds.first.to_hash[method]
      else
        super
      end
    end
204555
def method_missing(meth, *args, &block)
      # Check to see if it can be evaluated
      if(matches? meth)
        #Defines the method and caches it to the class
        self.class.send(:define_method, meth) do
          # Splits the method and parameter. See formatize and directionize
          @csf::config()::getStringArray(meth.to_s.to_java_name).to_a
        end
        # calls the method
        send meth, *args, &block
      else
        super
      end
    end
1210266
def method_missing(name, *args, **config, &block)
      if respond_to_missing?(name)
        config[:type] = name
        on(*args, config, &block)
      else
        super
      end
    end
1297243
def def_method(object, method_name, filename=nil)
      m = object.is_a?(Module) ? :module_eval : :instance_eval
      object.__send__(m, "def #{method_name}; #{@src}; end", filename || @filename || '(erubis)')
    end
1153455
def method_missing(cmd, options={}, *args, &block)
      native(cmd, options, *args, &block)
    end
73550
def make_call(method, params, opt = {})
      opt = {
        wait: true,
      }.merge(opt)

      ng_wait if opt[:wait]

      params << opt[:using] if opt.has_key?(:using)
      params << opt[:root_selector] if opt.has_key?(:root_selector)
      js_params = params.map do |p|
        if p.nil?
          'null'
        elsif p.is_a? String
          escaped = p.gsub(/'/, "\\\\'").gsub(/"/, '\\\\"')
          "'#{escaped}'"
        else
          p.to_s
        end
      end

      js = "#{method}(#{js_params.join(', ')});"
      logger.debug js
      js_result = page.evaluate_script(js);
#      logger.debug js_result

      js_result
    end
835742
def define_hash_method
      keys = @keys
      define_method(:hash) do
        keys.map { |key| send(key) }.push(self.class).hash
      end
    end
296138
def execute_plugin(method)
      Polipus::Plugin.plugins.each do |k, p|
        next unless p.respond_to?(method)
        @logger.info { "Running plugin method #{method} on #{k}" }
        ret_val = p.send(method, self)
        instance_eval(&ret_val) if ret_val.is_a? Proc
      end
    end