<commit_before>class ProjectUrlConstrainer
  def matches?(request)
    namespace_path = request.params[:namespace_id]
    project_path = request.params[:project_id] || request.params[:id]
    full_path = [namespace_path, project_path].join('/')

    return false unless DynamicPathValidator.valid_project_path?(full_path)

    Project.find_by_full_path(full_path, follow_redirects: request.get?).present?
  end
end<commit_msg>Explain why we use select all for project_url_constrainer.rb<commit_after>class ProjectUrlConstrainer
  def matches?(request)
    namespace_path = request.params[:namespace_id]
    project_path = request.params[:project_id] || request.params[:id]
    full_path = [namespace_path, project_path].join('/')

    return false unless DynamicPathValidator.valid_project_path?(full_path)

    # We intentionally allow SELECT(*) here so result of this query can be used
    # as cache for further Project.find_by_full_path calls within request 
    Project.find_by_full_path(full_path, follow_redirects: request.get?).present?
  end
end
{'fraction_non_alphanumeric': 0.0920303605313093, 'fraction_numerical': 0.0, 'mean_word_length': 5.59375, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5552176', 'n_tokens_mistral': 315, 'n_tokens_neox': 307, 'n_words': 69}