<commit_before>class CategoryContentDecorator < Draper::Decorator
  delegate :id, :title, :description

  def label
    "#{object.type.titleize} - "
  end

  def contents
    CategoryContentDecorator.decorate_collection(object.contents || [])
  end

  def path
    case object.class.to_s
      when 'Core::Article'
        h.article_path(object.id, locale: I18n.locale)
      when 'Core::ActionPlan'
        h.action_plan_path(object.id, locale: I18n.locale)
      when 'Core::Category'
        h.category_path(object.id, locale: I18n.locale)
      when 'Core::Other'
        "/#{I18n.locale}/#{object.type.pluralize}/#{object.id}"
    end
  end

  def icon_class
    "icon--#{object.type.dasherize}"<commit_msg>Reduce path method complexity<commit_after>class CategoryContentDecorator < Draper::Decorator
  delegate :id, :title, :description

  def label
    "#{object.type.titleize} - "
  end

  def contents
    CategoryContentDecorator.decorate_collection(object.contents || [])
  end

  def path
    case object
    when Core::Article, Core::Category
      h.send("#{object.class.to_s.demodulize.underscore}_path", object.id, locale: I18n.locale)
    when Core::Other
      "/#{I18n.locale}/#{object.type.pluralize}/#{object.id}"
    end
  end

  def icon_class
    "icon--#{object.type.dasherize}"
{'fraction_non_alphanumeric': 0.13123561013046814, 'fraction_numerical': 0.00920951650038373, 'mean_word_length': 3.435374149659864, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2225046', 'n_tokens_mistral': 450, 'n_tokens_neox': 442, 'n_words': 78}