<commit_before>module ApplicationHelper
  def nav_class(element)
    class_string = 'nav-link'

    navigation_elements = {
      imports: imports_path,
      sources: sources_path,
      tags: tags_path
    }

    class_string << ' active' if navigation_elements[element] == request.path
    class_string
  end

  def source_rank_options(type)
    options = Source.all.map do |source|
      "#{source.rank_for(type)} - insert above #{source.name}"
    end.sort
    final_option = "#{options.count + 1} - add to end"
    options + [final_option]
  end
end<commit_msg>Fix: ensure options have sensible values<commit_after>module ApplicationHelper
  def nav_class(element)
    class_string = 'nav-link'

    navigation_elements = {
      imports: imports_path,
      sources: sources_path,
      tags: tags_path
    }

    class_string << ' active' if navigation_elements[element] == request.path
    class_string
  end

  def source_rank_options(type)
    options = Source.all.map do |source|
      rank = source.rank_for(type)
      ["#{rank} - insert above #{source.name}", rank]
    end.sort
    final_rank = options.count + 1
    final_option = ["#{final_rank} - add to end", final_rank]
    options + [final_option]
  end
end
{'fraction_non_alphanumeric': 0.10333604556550041, 'fraction_numerical': 0.0016273393002441008, 'mean_word_length': 3.212328767123288, 'pattern_counts': {'":': 0, '<': 7, '<?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': '907312', 'n_tokens_mistral': 384, 'n_tokens_neox': 380, 'n_words': 92}