rubocop:disable CyclomaticComplexity, MethodLength, AbcSize, PerceivedComplexity
15054
def run
      options.staged = options.staged.nil? ? true : options.staged

      if options.skip_pre
        puts 'Skipping PreRun Executables'
      else
        run_externals('pre-run-execute')
      end

      if script && !(options.ignore_script || GitHooks.ignore_script)
        command = "#{script} #{Pathname.new($0)} #{Shellwords.join(ARGV)};"
        puts "Kernel#exec(#{command.inspect})" if GitHooks.verbose
        exec(command)
      elsif hook_path
        load_tests && start
      else
        puts %q"I can't figure out what to run! Specify either path or script to give me a hint..."
      end

      if options.skip_post
        puts 'Skipping PostRun Executables'
      else
        run_externals('post-run-execute')
      end
    rescue SystemStackError => e
      puts "#{e.class.name}: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
    rescue GitHooks::Error::NotAGitRepo => e
      puts "Unable to find a valid git repo in #{repository}."
      puts 'Please specify path to repository via --repo <path>' if GitHooks::SCRIPT_NAME == 'githooks'
      raise e
    end
943543
def summary
      # Guard against the exceptions array being removed/changed or emptied here
      if exceptions.respond_to?(:first) && exceptions.first
        {
          :error_class => exceptions.first[:errorClass],
          :message => exceptions.first[:message],
          :severity => severity
        }
      else
        {
          :error_class => "Unknown",
          :severity => severity
        }
      end
    end
1304308
def method_missing(name, *args, &block)
      if name.to_s[-1] == '='
        config[name[0..-2].to_s.upcase] = args[0]
      else
        config.fetch(name.to_s.upcase) {nil}
      end
    end
535345
def method_missing(method_name, *args)
      # Find the operator class
      class_name = method_name.to_s.camelcase
      operator_class = "Fleximage::Operator::#{class_name}".constantize
      
      # Define a method for this operator so future calls to this operation are faster
      self.class.module_eval <<-EOF
        def #{method_name}(*args)
          @image = execute_operator(#{operator_class}, *args)
        end
      EOF
      
      # Call the method that was just defined to perform its functionality.
      send(method_name, *args)
    
    rescue NameError => e
      if e.to_s =~ /uninitialized constant Fleximage::Operator::#{class_name}/
        raise OperatorNotFound, "No operator Fleximage::Operator::#{class_name} found for the method \"#{method_name}\""
      else
        raise e
      end
    end
1311302
private function _checkCyclomaticComplexity() {
		if ($this->_isActive('cyclomaticComplexity')) {
			$warningLevel = $this->_config->getTestProperty('cyclomaticComplexity', 'warningLevel');
			$errorLevel = $this->_config->getTestProperty('cyclomaticComplexity', 'errorLevel');
			$msg = $this->_getMessage('CYCLOMATIC_COMPLEXITY', $this->_currentFunctionName, $this->_cyclomaticComplexity, $warningLevel);

			// Direct call to the reporter to allow different error levels for a single test.
			if ($this->_cyclomaticComplexity > $warningLevel) {
				$this->_writeError('cyclomaticComplexity', $msg, $this->_functionStartLine, WARNING);
			} else if ($this->_cyclomaticComplexity > $errorLevel) {
				$this->_writeError('cyclomaticComplexity', $msg, $this->_functionStartLine, ERROR);
			}
		}
	}
1063872
def method_missing(method, *args)
      if method.to_s.match /subscription/
        if args.size == 2
          @subscriptions.send method, args[0], args[1]
        else
          @subscriptions.send method, args[0]
        end
      else
        if method == :delivery_status || method == :retrieve_sms || method == :search_sms
          @reporting.send method, args[0]
        else
          raise RuntimeError, 'Unknown method'
        end
      end
    end
1285957
def adapt_feature!(parsed_feature, gathered_comments)
      # Saving off the original data
      parsed_feature['cuke_modeler_parsing_data'] = Marshal::load(Marshal.dump(parsed_feature))

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

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

      adapt_child_elements!(parsed_feature, gathered_comments)

      if parsed_feature['tags']
        parsed_feature['tags'].each do |tag|
          adapt_tag!(tag)
        end
      end
    end
684526
def method_missing meth, *args, &block
      meth_s = meth.to_s
      if @method && meth_s =~ API_REGEX

        if meth_s.end_with?('!')
          # `foo! bar' is syntactic sugar for `foo.! bar'
          self[meth_s[0...-1]].!(args[0] || {})

        else
          # chain the method name onto URL path
          self[meth_s]
        end
      else
        super
      end
    end
1028492
def method_missing(method, *args)
      if (method.to_s =~ /^(.+)(\?|\!)$/)
        value_name = $1.to_sym
        if @state.states.has_key?(value_name)
          case $2
          when '?'
            self.class.class_eval <<-EOC
              def #{method}
                self == #{value_name.inspect}
              end
            EOC
            # Calling `method` on ourselves fails. Something to do
            # w/subclasses. Meh.
            return self == value_name
          when '!'
            self.class.class_eval <<-EOC
              def #{method}
                self.set_value(#{value_name.inspect})
              end
            EOC
            # Calling `method` on ourselves fails. Something to do w/subclasses. Meh.
            return self.set_value(value_name)
          end
        elsif $2 == '?' && aggregates = @state.aggregates[value_name]
          self.class.class_eval <<-EOC
            def #{method}
              @state.aggregates[#{value_name.inspect}].include?(@value)
            end
          EOC
          return aggregates.include?(@value)
        else
          super
        end
      elsif value_for(@value).respond_to?(method)
        value_for(@value).send(method, *args)
      else
        super
      end
    end
899783
def method_missing(method, *args, &block)
      method = method.to_sym
      if @modules.keys.include?(method)
        @modules[method]
      elsif available_modules.include?(method)
        @dummy_module
      else
        process_command method, *args
      end
    end
1232820
def method_missing(name, *args, &block)
      return attributes[name.to_sym] if attributes.include?(name.to_sym)
      return super
    end
989827
def method_missing( name, *opts )
      raise NoMethodError.new( name.to_s ) unless name.to_s =~ /([a-z]*)_([a-z]*)/
 
      # command_processors
      if $2 == "processors"
        commands[$1.to_sym][:outputs] = opts.first[:outputs]
        commands[$1.to_sym][:exceptions] = opts.first[:exceptions]
      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
836617
def method_missing(s, *a, &b)
      if s.to_s.end_with?('=')
      #  stop = s.to_s.chomp('=')
      #  if !SPECIAL_OPTIONS.include?(stop)
      #   (class << self; self; end).module_eval %{
      #      def station_#{stop}
      #        #{a.first}
      #      end
      #    }
      #  end
      else
        if @context.respond_to?(s)
          @context.__send__(s,*a,&b)
        else
          super(s, *a, &b)
        end
      end
    end
355292
def method_missing(method, *args)
      if method.to_s.starts_with? "*"
        condition_name = method.to_s.split("*")[1].to_sym
        conditions = self.class.scram_conditions
        if conditions && !conditions[condition_name].nil?
          return conditions[condition_name].call(self)
        end
      end
      super
    end
734673
def match_spaces
      stack = []
      matched = match_space
      while matched != :failed
        stack << matched
        matched = match_space
      end
      stack
    end
107235
def method_missing(method, *args, &block)
      if args.any? && args.first.is_a?(Hash)
        _links.send(method, [], &block)._expand(*args)
      elsif !Array.method_defined?(method)
        %i[_attributes _embedded _links].each do |target|
          target = send(target)
          return target.send(method, *args, &block) if target.respond_to?(method.to_s)
        end
        super
      end
    end