rubocop: disable Metrics/MethodLength
503403
def association(name)
      association = super

      return association unless Logidze.associations_versioning

      should_apply_logidze =
        logidze_past? &&
        association.klass.respond_to?(:has_logidze?) &&
        !association.singleton_class.include?(Logidze::VersionedAssociation)

      return association unless should_apply_logidze

      association.singleton_class.prepend Logidze::VersionedAssociation

      if association.is_a? ActiveRecord::Associations::CollectionAssociation
        association.singleton_class.prepend(
          Logidze::VersionedAssociation::CollectionAssociation
        )
      end

      association
    end
6881
def index
      validate_arguments!

      plugins = ::Heroku::Plugin.list

      if plugins.length > 0
        styled_header("Installed Plugins")
        styled_array(plugins)
      end
      ::Heroku::JSPlugin.list
    end
1027063
def method_missing(method_symbol, *args, &block)
      loggers.each { |l| l.send(method_symbol, *args, &block) }
    end
836953
def method_array
      @parser = nil
      @caller_lines.each do |kaller|
        code   = Ripper.sexp(kaller.contents)
        code  ||= Ripper.sexp(kaller.contents.sub(/^\W*(if|unless)/, ''.freeze)) # if and unless "block" statements aren't valid one line ruby code
        code  ||= Ripper.sexp(kaller.contents.sub(/do \|.*\|$/, ''.freeze)) # remove trailing do |thing| to make valid code
        code  ||= Ripper.sexp(kaller.contents.sub(/(and|or)\W*$/, ''.freeze))# trailing and || or
        code  ||= Ripper.sexp(kaller.contents.sub(/:\W*$/, ''.freeze)) # multi line ternary statements
        code  ||= Ripper.sexp(kaller.contents.sub(/(^\W*)|({ \|?.*\|?)}/, ''.freeze)) # multi line blocks using {}

        puts "LetItGoFailed parse (#{kaller.file_name}:#{kaller.line_number}: \n  \033[0;31m"+ kaller.contents.strip + "\e[0m".freeze if ENV['LET_IT_GO_RECORD_FAILED_CODE'] && code.nil? && kaller.contents.match(/"|'/)

        parser = ::LetItGo::WTFParser.new(code, contents: kaller.contents)

        if parser.each_method.any? { |m| m.method_name == method_name }
          @line_number = kaller.line_number
          @file_name   = kaller.file_name

          @parser = parser
          parser.each_method.each(&:arg_types)
          break
        else
          next
        end
      end
      @parser || []
    end
216658
def method_missing(method_id, *args)
      if [:get, :post, :put, :delete].include?(method_id)
        path, options = *args
        options ||= {}
        options[:query] = (default_params.merge(options[:query] || {}))
        options[:headers] = (self.class.default_options[:headers].merge(options[:headers] || {}))

        CrowdFlower.request_hook.call(method_id, path, options) do
          self.class.send(method_id, url(path), options)
        end
      else
        super
      end
    end
336415
def method_missing(method, *args)
      unless args.size == 1 && [Hash, Array].include?(args[0].class)
        raise 'Expected 1 Hash or Array argument'
      end

      call_remote method, args[0]
    end
1239043
def method_missing(method_sym, *arguments, &_block)
      @core_plugins.each do |plugin|
        if plugin.public_methods(false).include?(method_sym)
          return plugin.send(method_sym, *arguments)
        end
      end
      super
    end
663345
def method_missing(meth, *args, &block)
      meth_str = meth.to_s

      if /^(\w+)\=$/.match(meth_str)
        _set($1, *args, &block)
      elsif args.length > 0 || block_given?
        _add(meth, *args, &block)
      elsif /^(\w+)\?$/.match(meth_str)
        !!_get($1)
      else
        _get_or_create_namespace(meth)
      end
    end
182657
def method_missing(method, *args, &code)
    success = false
    result  = nil

    if method.to_s.match(/^set\_([a-z].*)$/)
      name = $1.to_sym

      if @types.has_key?(name) && args.length > 2
        @types[name].set([ args[0], args[1] ], args[2]) if args.length > 2
        success = true
      end

    elsif method.to_s.match(/^remove\_([a-z].*)$/)
      name = $1.to_sym

      if @types.has_key?(name) && args.length > 0
        @types[name].delete([ args[0], args[1] ])
        success = true
      end

    else
      name = @plurals[method.to_sym]

      if name && @types.has_key?(name)
        result  = @types[name]
        success = true
      end
    end
    super unless success # Raise NoMethodError
    result
  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
236182
def method_missing(method, *args, &block)
      if main_app_url_helper?(method)
        main_app.send(method, *args)
      else
        super
      end
    end
575066
def method_missing(meth, *args, &block)
      @namespace = meth.to_s
      @message   = (args.first.to_s == 'debug') ? nil : args.first.to_s
      self.send :output!
    end
635990
def method_missing(meth, *args, &block)
      if meth.to_s =~ /=$/
        self.define_accessors(meth.to_s.gsub(/=$/,''))
        return self.send(meth, *args, &block)
      end
      super
    end
947015
def method_missing(method, * args)
      value = with_file(method, * args)
      logger.debug "#{self}.method_missing(#{method.inspect}, #{args.inspect}) => #{value.inspect}"
      value
    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
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
119181
def method_missing(method, *args, &block)
      if method.to_s =~ UNIT_LIST_REGEX

        if $2 || $4 || $6
          conditions = []

          conditions << "unit.is_#{$2}_unit?"     if $2
          conditions << "!unit.is_prefixed_unit?" if $4
          conditions << "unit.is_#{$6}_unit?"     if $6

          units = Unit.units.values.select { |unit| instance_eval(conditions.join(" && ")) }
        else
          units = Unit.units.values
        end

        return_format = ( $8 ? $8.to_sym : nil )
        units.map(&return_format).to_a
        
      elsif unit = Unit.for(method)

        return unit
      else

        super
      end
    end