<commit_before># rubocop:disable Metrics/ClassLength
class Project < ActiveRecord::Base
  STATUS_CHOICE = %w(? Met Unmet).freeze
  STATUS_CHOICE_NA = (STATUS_CHOICE + %w(N/A)).freeze
  MIN_SHOULD_LENGTH = 5

  # Map each criterion to ['MUST|SHOULD|SUGGESTED',
  #   na_allowed?, met_requires_url?]
  CRITERIA_INFO = {
    # Basic Project Website Content
    description_sufficient: ['MUST', false, false],
    interact: ['MUST', false, false],
    contribution: ['MUST', false, true],
    contribution_criteria: ['SHOULD', false, true],
    # OSS License
    license_location: ['MUST', false, true],
    oss_license: ['MUST', false, false],
    oss_license_osi: ['SUGGESTED', false, false],
    # Documentation
    documentation_basics: ['MUST', false, false],
    documentation_interface: ['MUST', false, false],
    # CHANGE CONTROL
    # Public version-controlled source repository
    repo_url: ['MUST', false, false],
    repo_track: ['MUST', false, false],
    repo_interim: ['MUST', false, false],
    repo_distributed: ['SUGGESTED', false, false],
    # Unique version numbering
    version_unique: ['MUST', false, false],
    version_semver: ['SUGGESTED', false, false],
    version_tags: ['SUGGESTED', false, false],
    # ChangeLog
    changelog: ['MUST', false, true],
    changelog_vulns: ['MUST', false, false],
    # REPORTING
    # Bug-reporting process
    report_tracker: ['SUGGESTED', false, false],
    report_process: ['MUST', false, true],
    report_responses: ['MUST', false, false],
    enhancement_responses: ['SHOULD', false, false],
    report_archive: ['MUST', false, true],
    # Vulnerability report process
    vulnerability_report_process: ['MUST', false, true],
    vulnerability_report_private: ['MUST', true, true],
    vulnerability_report_response: ['MUST', false, false],
    # QUALITY
    # Working build system
    build: ['MUST', false, false],
    build_common_tools: ['SUGGESTED', false, false],
    build_oss_tools: ['SHOULD', false, false],
    # Automated test suite
    test: ['MUST', false, false],
    test_invocation: ['SHOULD', false, false],
    test_most: ['SUGGESTED', false, false],
    test_continuous_integration: ['SUGGESTED', false, false],
    # New functionality testing
    test_policy: ['MUST', false, false],
    tests_are_added: ['MUST', false, false],
    tests_documented_added: ['SUGGESTED', false, false],
    # Warning flags
    warnings: ['MUST', true, false],<commit_msg>Allow N/A in the build criteria<commit_after># rubocop:disable Metrics/ClassLength
class Project < ActiveRecord::Base
  STATUS_CHOICE = %w(? Met Unmet).freeze
  STATUS_CHOICE_NA = (STATUS_CHOICE + %w(N/A)).freeze
  MIN_SHOULD_LENGTH = 5

  # Map each criterion to ['MUST|SHOULD|SUGGESTED',
  #   na_allowed?, met_requires_url?]
  CRITERIA_INFO = {
    # Basic Project Website Content
    description_sufficient: ['MUST', false, false],
    interact: ['MUST', false, false],
    contribution: ['MUST', false, true],
    contribution_criteria: ['SHOULD', false, true],
    # OSS License
    license_location: ['MUST', false, true],
    oss_license: ['MUST', false, false],
    oss_license_osi: ['SUGGESTED', false, false],
    # Documentation
    documentation_basics: ['MUST', false, false],
    documentation_interface: ['MUST', false, false],
    # CHANGE CONTROL
    # Public version-controlled source repository
    repo_url: ['MUST', false, false],
    repo_track: ['MUST', false, false],
    repo_interim: ['MUST', false, false],
    repo_distributed: ['SUGGESTED', false, false],
    # Unique version numbering
    version_unique: ['MUST', false, false],
    version_semver: ['SUGGESTED', false, false],
    version_tags: ['SUGGESTED', false, false],
    # ChangeLog
    changelog: ['MUST', false, true],
    changelog_vulns: ['MUST', false, false],
    # REPORTING
    # Bug-reporting process
    report_tracker: ['SUGGESTED', false, false],
    report_process: ['MUST', false, true],
    report_responses: ['MUST', false, false],
    enhancement_responses: ['SHOULD', false, false],
    report_archive: ['MUST', false, true],
    # Vulnerability report process
    vulnerability_report_process: ['MUST', false, true],
    vulnerability_report_private: ['MUST', true, true],
    vulnerability_report_response: ['MUST', false, false],
    # QUALITY
    # Working build system
    build: ['MUST', true, false],
    build_common_tools: ['SUGGESTED', true, false],
    build_oss_tools: ['SHOULD', true, false],
    # Automated test suite
    test: ['MUST', false, false],
    test_invocation: ['SHOULD', false, false],
    test_most: ['SUGGESTED', false, false],
    test_continuous_integration: ['SUGGESTED', false, false],
    # New functionality testing
    test_policy: ['MUST', false, false],
    tests_are_added: ['MUST', false, false],
    tests_documented_added: ['SUGGESTED', false, false],
    # Warning flags
    warnings: ['MUST', true, false],
{'fraction_non_alphanumeric': 0.14378951662247602, 'fraction_numerical': 0.0004079135223332653, 'mean_word_length': 4.313109425785482, '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': '6847673', 'n_tokens_mistral': 1654, 'n_tokens_neox': 1581, 'n_words': 416}