<commit_before>module FilterableMixin
  extend ActiveSupport::Concern

  module ClassMethods
    def find_filtered(number, options = {})
      filters = options.delete(:tag_filters)
      mfilters = filters && filters["managed"] ? filters["managed"] : []
      bfilters = filters && filters["belongsto"] ? filters["belongsto"] : []
      options[:include] = get_include_for_find(options[:include]) unless options.delete(:eager_loading) == false
      if mfilters.blank?
        # do normal find if no filters
        result = where(options[:conditions])
                   .order(options[:order])
                   .joins(options[:join] || options[:joins])
                   .includes(options[:include])
                   .select(options[:select])
        total_count = result.length
      else
        # get count of results unfiltered
        total_count = options[:conditions] ? count(options[:conditions]) : count

        # do tag find
        # self.find_tagged_with(options.merge(:all => filters, :ns => "*"))
        result = find_tags_by_grouping(mfilters, options.merge(:ns => "*"))
      end

      result = MiqFilter.apply_belongsto_filters(result, bfilters)
<commit_msg>Address Rubocop comments<commit_after>module FilterableMixin
  extend ActiveSupport::Concern

  module ClassMethods
    def find_filtered(number, options = {})
      filters = options.delete(:tag_filters)
      mfilters = filters && filters["managed"] ? filters["managed"] : []
      bfilters = filters && filters["belongsto"] ? filters["belongsto"] : []
      options[:include] = get_include_for_find(options[:include]) unless options.delete(:eager_loading) == false
      if mfilters.blank?
        # do normal find if no filters
        result = where(options[:conditions])
                 .order(options[:order])
                 .joins(options[:join] || options[:joins])
                 .includes(options[:include])
                 .select(options[:select])
        total_count = result.length
      else
        # get count of results unfiltered
        total_count = options[:conditions] ? count(options[:conditions]) : count

        # do tag find
        # self.find_tagged_with(options.merge(:all => filters, :ns => "*"))
        result = find_tags_by_grouping(mfilters, options.merge(:ns => "*"))
      end

      result = MiqFilter.apply_belongsto_filters(result, bfilters)

{'fraction_non_alphanumeric': 0.12547368421052632, 'fraction_numerical': 0.0, 'mean_word_length': 2.9014778325123154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7572687', 'n_tokens_mistral': 643, 'n_tokens_neox': 628, 'n_words': 130}