Flog Results

Flog measures code complexity.

Total Flog score for all methods: 12765.0

Average Flog score for all methods: 6.1

File Total score Methods Average score Highest score
app/jobs/archive_petition_job.rb 191.1 3 63.7 187.8
app/models/petition.rb 569.4 76 7.5 174.4
lib/tasks/data-generator.rake 159.3 1 159.3 159.3
app/models/archived/petition.rb 292.6 29 10.1 130.1
app/models/feedback_signature.rb 121.1 3 40.4 115.6
app/models/invalidation.rb 292.1 26 11.2 112.2
app/jobs/archive_signatures_job.rb 113.7 3 37.9 105.3
app/models/rate_limit.rb 281.9 44 6.4 88.0
app/models/signature.rb 78.2 1 78.2 78.2
app/models/archived/signature.rb 75.7 1 75.7 75.7
app/lib/deprecated_attributes.rb 75.8 2 37.9 72.3
app/models/site.rb 169.0 29 5.8 70.7
app/models/petition_creator.rb 272.5 37 7.4 58.7
app/helpers/auto_link_helper.rb 125.9 12 10.5 50.3
app/models/signature.rb 330.6 47 7.0 45.6
app/models/petition.rb 45.5 1 45.5 45.5
app/models/archived/debate_outcome.rb 97.7 6 16.3 42.9
app/models/admin_user.rb 121.5 16 7.6 42.2
app/models/debate_outcome.rb 90.2 6 15.0 39.6
app/models/signature.rb 38.7 1 38.7 38.7
app/models/signature.rb 38.3 1 38.3 38.3
app/jobs/update_signature_counts_job.rb 74.2 9 8.2 38.2
lib/tasks/errors.rake 47.8 4 11.9 38.1
app/models/concerns/browseable.rb 156.3 26 6.0 37.3
app/models/signature.rb 37.1 1 37.1 37.1
app/models/signature.rb 37.1 1 37.1 37.1
app/models/constituency/api_query.rb 47.8 4 11.9 35.1
app/helpers/page_title_helper.rb 74.7 8 9.3 33.9
app/models/signature.rb 33.8 1 33.8 33.8
app/controllers/admin/parliaments_controller.rb 52.9 8 6.6 30.3
app/presenters/petition_csv_presenter.rb 56.8 7 8.1 29.5
app/controllers/admin/archived/petitions_controller.rb 100.0 16 6.3 28.9
app/models/signature.rb 28.7 1 28.7 28.7
lib/package_builder.rb 362.7 68 5.3 28.2
app/models/signature.rb 28.0 1 28.0 28.0
app/models/site.rb 27.2 1 27.2 27.2
app/controllers/signatures_controller.rb 209.3 38 5.5 27.2
app/models/archived/signature.rb 90.5 18 5.0 26.9
app/models/petition.rb 26.8 1 26.8 26.8
app/models/parliament.rb 112.0 20 5.6 26.1
app/models/petition.rb 26.1 1 26.1 26.1
app/lib/email_reminder.rb 26.0 1 26.0 26.0
app/models/constituency.rb 62.5 7 8.9 24.8
app/models/petition.rb 24.5 1 24.5 24.5
app/jobs/trending_ips_by_petition_job.rb 44.7 8 5.6 23.6
app/jobs/trending_domains_by_petition_job.rb 42.5 8 5.3 23.6
app/lib/admin/task_runner.rb 39.3 5 7.9 23.6
app/models/signature_logs.rb 130.3 12 10.9 23.5
app/models/tag.rb 33.8 3 11.3 23.4
app/presenters/petitions_csv_presenter.rb 27.7 3 9.2 23.3
app/controllers/admin/petitions_controller.rb 81.3 13 6.3 23.2
app/helpers/application_helper.rb 65.2 11 5.9 22.1
app/helpers/form_helper.rb 30.9 3 10.3 21.8
app/lib/email_reminder.rb 21.6 1 21.6 21.6
app/controllers/admin/searches_controller.rb 42.6 5 8.5 21.5
app/jobs/backfill_constituencies_job.rb 27.6 4 6.9 21.2
app/controllers/application_controller.rb 80.1 20 4.0 21.1
app/models/statistics.rb 20.9 1 20.9 20.9
app/controllers/concerns/flash_render.rb 23.6 2 11.8 19.6
app/models/signature.rb 19.2 1 19.2 19.2
app/helpers/search_helper.rb 27.2 3 9.1 19.1
app/helpers/archived_petition_helper.rb 38.3 5 7.7 19.1
app/models/constituency.rb 18.8 1 18.8 18.8
app/models/archived/rejection.rb 22.6 3 7.5 18.7
app/presenters/api_pagination_links_presenter.rb 65.1 9 7.2 18.3
app/jobs/concerns/rate_limiting.rb 26.2 3 8.7 18.2
app/models/concerns/taggable.rb 63.1 10 6.3 17.7
app/jobs/backfill_canonical_emails_job.rb 18.5 2 9.3 17.5
app/jobs/backfill_signature_uuids_job.rb 18.5 2 9.3 17.5
app/controllers/concerns/bulk_verification.rb 53.5 9 5.9 17.5
app/jobs/refresh_constituency_party_job.rb 52.4 7 7.5 17.3
app/models/rejection.rb 20.8 3 6.9 17.2
app/helpers/admin_helper.rb 150.6 28 5.4 16.8
app/controllers/admin/moderation_delays_controller.rb 51.9 10 5.2 16.8
app/models/invalidation.rb 16.6 1 16.6 16.6
app/models/signature.rb 16.6 1 16.6 16.6
app/controllers/petitions_controller.rb 132.4 33 4.0 16.5
lib/tasks/petitions.rake 82.1 9 9.1 16.4
app/jobs/import_constituencies_job.rb 49.2 7 7.0 16.2
app/models/archived/signature.rb 16.2 1 16.2 16.2
app/models/signature.rb 16.2 1 16.2 16.2
app/models/constituency_petition_journal.rb 15.8 1 15.8 15.8
app/models/country_petition_journal.rb 15.8 1 15.8 15.8
app/models/trending_domain.rb 15.7 1 15.7 15.7
app/models/trending_ip.rb 15.7 1 15.7 15.7
app/controllers/sponsors_controller.rb 83.0 13 6.4 15.6
app/models/signature_logs.rb 81.0 17 4.8 15.6
app/models/signature.rb 15.6 1 15.6 15.6
app/models/domain.rb 77.1 17 4.5 15.4
app/jobs/deliver_debate_outcome_email_job.rb 17.2 2 8.6 15.2
app/jobs/archived/deliver_debate_scheduled_email_job.rb 17.2 2 8.6 15.2
app/jobs/archived/deliver_threshold_response_email_job.rb 17.2 2 8.6 15.2
app/jobs/archived/deliver_debate_outcome_email_job.rb 17.2 2 8.6 15.2
app/jobs/deliver_threshold_response_email_job.rb 17.2 2 8.6 15.2
app/jobs/deliver_debate_scheduled_email_job.rb 17.2 2 8.6 15.2
app/models/constituency_petition_journal.rb 15.2 1 15.2 15.2
app/models/constituency.rb 15.1 1 15.1 15.1
app/models/admin_user_session.rb 28.4 4 7.1 15.0
app/models/site.rb 14.9 1 14.9 14.9
app/models/site.rb 14.9 1 14.9 14.9
app/jobs/archived/deliver_petition_email_job.rb 19.2 3 6.4 14.8
app/jobs/deliver_petition_email_job.rb 19.2 3 6.4 14.8
app/jobs/fetch_country_register_job.rb 39.0 5 7.8 14.8
lib/tasks/epets.rake 43.8 7 6.3 14.6
app/jobs/concerns/email_delivery.rb 76.6 13 5.9 14.5
app/helpers/cache_helper.rb 66.0 17 3.9 14.3
app/models/signature.rb 14.3 1 14.3 14.3
app/models/government_response.rb 28.5 3 9.5 14.3
app/models/archived/government_response.rb 28.0 3 9.3 13.9
app/controllers/admin/archived/petition_emails_controller.rb 66.7 14 4.8 13.9
app/models/constituency_petition_journal.rb 31.2 5 6.2 13.8
app/models/constituency_petition_journal.rb 13.7 1 13.7 13.7
app/models/country_petition_journal.rb 13.7 1 13.7 13.7
app/models/country_petition_journal.rb 30.9 5 6.2 13.5
app/controllers/admin/signatures_controller.rb 149.2 19 7.9 13.3
app/helpers/home_helper.rb 35.8 9 4.0 13.2
app/jobs/notify_trending_ip_job.rb 49.3 9 5.5 13.1
app/jobs/notify_trending_domain_job.rb 49.3 9 5.5 13.1
app/controllers/concerns/flash_i18n.rb 22.9 3 7.6 13.1
app/models/archived/signature.rb 13.1 1 13.1 13.1
app/models/petition.rb 13.1 1 13.1 13.1
app/models/signature.rb 13.1 1 13.1 13.1
app/helpers/home_helper.rb 27.5 6 4.6 12.8
app/models/location.rb 12.8 1 12.8 12.8
app/models/location.rb 12.8 1 12.8 12.8
app/lib/active_support/cache/atomic_dalli_store.rb 82.2 11 7.5 12.7
app/models/archived/signature.rb 12.7 1 12.7 12.7
app/models/signature.rb 12.7 1 12.7 12.7
app/helpers/date_time_helper.rb 50.5 13 3.9 12.7
app/models/archived/signature.rb 12.6 1 12.6 12.6
app/models/signature.rb 12.6 1 12.6 12.6
app/controllers/admin/petition_emails_controller.rb 63.3 14 4.5 12.6
app/helpers/cache_helper.rb 20.8 5 4.2 12.4
app/models/petition.rb 12.4 1 12.4 12.4
app/mailers/petition_mailer.rb 159.1 25 6.4 12.3
app/validators/email_validator.rb 16.8 3 5.6 12.3
app/models/archived/signature.rb 12.0 1 12.0 12.0
app/models/signature.rb 12.0 1 12.0 12.0
app/models/trending_ip.rb 20.5 4 5.1 12.0
app/controllers/admin/invalidations_controller.rb 86.9 17 5.1 11.9
app/controllers/admin/archived/signatures_controller.rb 81.4 11 7.4 11.9
app/controllers/admin/sites_controller.rb 22.2 5 4.4 11.9
app/controllers/admin/rate_limits_controller.rb 23.4 5 4.7 11.9
app/helpers/petition_helper.rb 28.2 6 4.7 11.7
app/models/parliament.rb 11.7 1 11.7 11.7
app/models/signature.rb 11.5 1 11.5 11.5
app/models/constituency_petition_journal.rb 11.2 1 11.2 11.2
app/models/country_petition_journal.rb 11.2 1 11.2 11.2
app/mailers/archived/petition_mailer.rb 82.2 13 6.3 11.0
app/jobs/concerns/email_all_petition_signatories.rb 29.9 7 4.3 11.0
lib/health_check.rb 34.6 12 2.9 11.0
app/controllers/admin/user_sessions_controller.rb 29.1 7 4.2 11.0
app/models/constituency_petition_journal.rb 10.6 1 10.6 10.6
app/models/country_petition_journal.rb 10.6 1 10.6 10.6
app/helpers/cache_helper.rb 60.0 12 5.0 10.4
app/controllers/archived/petitions_controller.rb 79.3 15 5.3 10.4
app/models/trending_domain.rb 16.4 3 5.5 10.3
app/mailers/sponsor_mailer.rb 23.7 3 7.9 10.2
app/models/signature.rb 10.1 1 10.1 10.1
app/helpers/social_meta_helper.rb 20.1 2 10.1 10.1
app/controllers/concerns/authentication.rb 48.7 11 4.4 10.0
app/jobs/concerns/email_all_petition_signatories.rb 42.6 8 5.3 10.0
app/models/trending_ip.rb 10.0 1 10.0 10.0
app/controllers/admin/admin_users_controller.rb 43.7 8 5.5 10.0
app/models/task.rb 9.9 1 9.9 9.9
app/models/domain.rb 9.9 1 9.9 9.9
app/controllers/admin/statistics_controller.rb 33.6 7 4.8 9.9
app/jobs/stop_petitions_early_job.rb 25.7 3 8.6 9.8
app/jobs/email_job.rb 25.9 5 5.2 9.7
app/jobs/notify_everyone_of_moderation_decision_job.rb 19.4 4 4.9 9.7
app/controllers/archived/signatures_controller.rb 34.4 6 5.7 9.6
app/jobs/email_duplicate_signatures_email_job.rb 14.8 3 4.9 9.6
app/models/petition.rb 9.6 1 9.6 9.6
app/models/signature.rb 9.6 1 9.6 9.6
app/models/signature.rb 9.6 1 9.6 9.6
app/controllers/local_petitions_controller.rb 57.5 14 4.1 9.6
lib/tasks/epets.rake 32.6 8 4.1 9.5
app/models/signature.rb 9.5 1 9.5 9.5
app/models/concerns/browseable.rb 39.1 8 4.9 9.3
app/models/task.rb 32.0 4 8.0 9.3
app/models/signature.rb 9.2 1 9.2 9.2
app/models/signature.rb 9.2 1 9.2 9.2
app/controllers/admin/archived/government_response_controller.rb 30.3 7 4.3 9.2
app/controllers/admin/archived/schedule_debate_controller.rb 21.7 6 3.6 9.2
app/controllers/admin/archived/debate_outcomes_controller.rb 31.5 7 4.5 9.2
app/models/archived/petition.rb 9.1 1 9.1 9.1
app/models/petition.rb 9.1 1 9.1 9.1
app/helpers/debate_outcome_helper.rb 20.7 3 6.9 9.1
9.1 1 9.1 9.1
app/models/constituency_petition_journal.rb 9.1 1 9.1 9.1
app/models/country_petition_journal.rb 9.1 1 9.1 9.1
app/jobs/notify_creator_of_validated_petition_being_stopped_job.rb 11.3 2 5.6 9.1
app/jobs/notify_creator_of_sponsored_petition_being_stopped_job.rb 11.3 2 5.6 9.1
app/jobs/notify_creator_that_parliament_is_dissolving_job.rb 11.3 2 5.6 9.1
app/controllers/feedback_controller.rb 30.8 7 4.4 9.0
app/models/domain.rb 8.9 1 8.9 8.9
app/helpers/admin_hub_helper.rb 12.3 3 4.1 8.9
app/controllers/admin/domains_controller.rb 53.3 11 4.8 8.8
app/controllers/admin/holidays_controller.rb 20.4 5 4.1 8.8
app/presenters/petition_csv_presenter.rb 8.8 1 8.8 8.8
app/lib/quiet_logger.rb 20.9 5 4.2 8.7
app/models/domain.rb 8.6 1 8.6 8.6
lib/tasks/constituencies.rake 24.0 6 4.0 8.3
app/jobs/archive_petitions_job.rb 9.2 2 4.6 8.2
lib/tasks/epets.rake 13.9 3 4.6 8.1
app/controllers/admin/admin_controller.rb 9.0 2 4.5 8.0
app/validators/postcode_validator.rb 7.9 1 7.9 7.9
app/controllers/admin/schedule_debate_controller.rb 20.4 6 3.4 7.9
app/controllers/admin/government_response_controller.rb 29.1 7 4.2 7.9
app/controllers/admin/debate_outcomes_controller.rb 30.3 7 4.3 7.9
app/models/petition.rb 7.8 1 7.8 7.8
app/models/parliament.rb 7.8 1 7.8 7.8
app/models/domain.rb 7.7 1 7.7 7.7
7.7 1 7.7 7.7
app/controllers/admin/tags_controller.rb 50.0 14 3.6 7.6
app/models/archived/signature.rb 7.6 1 7.6 7.6
app/models/archived/signature.rb 7.6 1 7.6 7.6
app/models/signature.rb 7.6 1 7.6 7.6
app/models/signature.rb 7.6 1 7.6 7.6
app/models/archived/signature.rb 7.6 1 7.6 7.6
app/models/archived/signature.rb 7.6 1 7.6 7.6
app/models/petition.rb 7.6 1 7.6 7.6
app/models/petition.rb 7.6 1 7.6 7.6
app/models/invalidation.rb 7.6 1 7.6 7.6
app/models/site.rb 7.6 1 7.6 7.6
app/models/invalidation.rb 7.6 1 7.6 7.6
app/models/invalidation.rb 7.6 1 7.6 7.6
app/models/site.rb 7.6 1 7.6 7.6
app/models/invalidation.rb 7.6 1 7.6 7.6
app/models/signature.rb 7.6 1 7.6 7.6
app/models/signature.rb 7.6 1 7.6 7.6
app/models/signature.rb 7.6 1 7.6 7.6
app/models/holiday.rb 18.2 5 3.6 7.5
app/controllers/admin/trending_domains_controller.rb 16.5 4 4.1 7.5
app/controllers/admin/trending_ips_controller.rb 16.5 4 4.1 7.5
app/jobs/feedback_email_job.rb 12.2 3 4.1 7.4
app/jobs/notify_creator_that_moderation_is_delayed_job.rb 9.6 2 4.8 7.4
app/models/archived/petition.rb 7.4 1 7.4 7.4
app/models/petition.rb 7.4 1 7.4 7.4
app/models/signature.rb 7.4 1 7.4 7.4
app/helpers/cache_helper.rb 14.6 4 3.6 7.4
app/lib/admin/task_runner.rb 7.3 1 7.3 7.3
app/jobs/petition_count_job.rb 15.9 4 4.0 7.3
app/controllers/admin/tasks_controller.rb 18.2 5 3.6 7.2
app/controllers/admin/take_down_controller.rb 22.0 7 3.1 7.2
lib/tasks/constituencies.rake 10.7 2 5.4 7.1
app/models/archived/petition.rb 7.1 1 7.1 7.1
app/models/petition.rb 7.1 1 7.1 7.1
app/models/site.rb 7.1 1 7.1 7.1
app/models/site.rb 7.1 1 7.1 7.1
app/models/petition.rb 7.1 1 7.1 7.1
app/models/petition.rb 7.1 1 7.1 7.1
app/models/petition.rb 7.1 1 7.1 7.1
app/controllers/trackers_controller.rb 29.0 6 4.8 7.0
app/controllers/admin/profile_controller.rb 11.6 3 3.9 7.0
app/models/constituency/api_client.rb 19.4 6 3.2 6.9
app/models/domain.rb 6.9 1 6.9 6.9
app/controllers/admin/archived/notes_controller.rb 23.6 6 3.9 6.8
app/controllers/admin/notes_controller.rb 22.3 6 3.7 6.8
app/models/location.rb 6.8 1 6.8 6.8
lib/tasks/signatures.rake 6.7 1 6.7 6.7
6.5 1 6.5 6.5
app/jobs/email_petitioners_job.rb 17.9 5 3.6 6.5
app/jobs/archived/email_petitioners_job.rb 17.9 5 3.6 6.5
app/helpers/cache_helper.rb 7.6 2 3.8 6.5
app/controllers/concerns/form_tracking.rb 27.0 9 3.0 6.4
app/jobs/enqueue_petition_statistics_updates_job.rb 8.0 2 4.0 6.0
app/jobs/close_petitions_early_job.rb 8.2 2 4.1 6.0
6.0 1 6.0 6.0
app/lib/audit_logger.rb 15.7 3 5.2 5.9
app/models/concerns/geoip_lookup.rb 14.4 5 2.9 5.8
app/models/signature.rb 5.8 1 5.8 5.8
app/controllers/admin/archived/petition_details_controller.rb 16.3 4 4.1 5.8
app/controllers/admin/archived/petition_tags_controller.rb 16.1 5 3.2 5.8
app/controllers/admin/moderation_controller.rb 20.8 6 3.5 5.8
app/jobs/delete_petitions_job.rb 6.8 2 3.4 5.8
app/helpers/markdown_helper.rb 26.2 8 3.3 5.7
app/models/constituency.rb 5.6 1 5.6 5.6
app/models/moderation_delay.rb 12.5 3 4.2 5.6
app/models/archived/signature.rb 5.5 1 5.5 5.5
app/controllers/admin/logs_controller.rb 21.3 7 3.0 5.5
app/models/site.rb 5.4 1 5.4 5.4
app/helpers/cache_helper.rb 5.4 1 5.4 5.4
app/models/archived/petition.rb 5.4 1 5.4 5.4
app/models/archived/petition.rb 5.4 1 5.4 5.4
app/models/archived/signature.rb 5.4 1 5.4 5.4
app/models/archived/petition.rb 5.4 1 5.4 5.4
app/models/archived/signature.rb 5.4 1 5.4 5.4
app/models/archived/petition.rb 5.4 1 5.4 5.4
app/models/archived/petition.rb 5.4 1 5.4 5.4
app/models/archived/petition.rb 5.4 1 5.4 5.4
app/models/archived/signature.rb 5.4 1 5.4 5.4
app/models/petition.rb 5.4 1 5.4 5.4
app/models/petition.rb 5.4 1 5.4 5.4
app/models/petition.rb 5.4 1 5.4 5.4
app/models/petition.rb 5.4 1 5.4 5.4
app/models/petition.rb 5.4 1 5.4 5.4
app/models/petition.rb 5.4 1 5.4 5.4
app/models/petition.rb 5.4 1 5.4 5.4
app/models/signature.rb 5.4 1 5.4 5.4
app/models/signature.rb 5.4 1 5.4 5.4
app/models/signature.rb 5.4 1 5.4 5.4
app/models/signature.rb 5.4 1 5.4 5.4
app/models/signature.rb 5.4 1 5.4 5.4
lib/health_check_middleware.rb 6.4 2 3.2 5.3
app/models/archived/petition.rb 5.2 1 5.2 5.2
app/models/petition.rb 5.2 1 5.2 5.2
app/models/site.rb 5.2 1 5.2 5.2
app/models/parliament.rb 5.2 1 5.2 5.2
app/models/site.rb 5.2 1 5.2 5.2
app/models/site.rb 5.2 1 5.2 5.2
app/models/parliament.rb 5.2 1 5.2 5.2
app/models/site.rb 5.2 1 5.2 5.2
app/models/site.rb 5.2 1 5.2 5.2
app/models/concerns/geoip_lookup.rb 17.5 5 3.5 5.2
app/models/petition.rb 5.2 1 5.2 5.2
app/models/constituency_petition_journal.rb 5.1 1 5.1 5.1
app/models/country_petition_journal.rb 5.1 1 5.1 5.1
lib/tasks/petitions.rake 5.1 1 5.1 5.1
app/mailers/admin_mailer.rb 8.8 2 4.4 5.1
app/helpers/admin_hub_helper.rb 40.0 14 2.9 5.1
app/helpers/rejection_helper.rb 11.9 4 3.0 5.1
5.1 1 5.1 5.1
5.0 1 5.0 5.0
app/models/site.rb 5.0 1 5.0 5.0
app/lib/email_reminder.rb 4.9 1 4.9 4.9
app/models/holiday.rb 4.9 1 4.9 4.9
app/models/holiday.rb 4.9 1 4.9 4.9
app/models/site.rb 4.9 1 4.9 4.9
app/models/constituency.rb 8.6 2 4.3 4.9
app/controllers/admin/petition_statistics_controller.rb 11.1 3 3.7 4.9
app/jobs/stop_petitions_early_job.rb 4.9 1 4.9 4.9
app/jobs/close_petitions_early_job.rb 4.9 1 4.9 4.9
app/helpers/moderation_helper.rb 4.8 1 4.8 4.8
app/models/site.rb 4.8 1 4.8 4.8
app/models/site.rb 4.8 1 4.8 4.8
app/controllers/pages_controller.rb 16.5 5 3.3 4.8
app/jobs/notify_creators_that_parliament_is_dissolving_job.rb 7.7 3 2.6 4.7
app/jobs/notify_creators_that_moderation_is_delayed_job.rb 7.7 3 2.6 4.7
app/models/holiday.rb 4.7 1 4.7 4.7
app/lib/cloud_front_remote_ip.rb 5.6 2 2.8 4.6
4.6 1 4.6 4.6
app/controllers/admin/petition_tags_controller.rb 14.8 5 3.0 4.5
app/controllers/admin/petition_details_controller.rb 13.8 4 3.5 4.5
app/models/petition/statistics.rb 14.7 5 2.9 4.5
app/controllers/admin/archived/locks_controller.rb 23.4 6 3.9 4.4
app/controllers/admin/locks_controller.rb 23.4 6 3.9 4.4
app/jobs/debated_petitions_job.rb 5.4 2 2.7 4.4
app/jobs/reset_petition_signature_count_job.rb 17.9 6 3.0 4.3
app/models/petition.rb 4.1 1 4.1 4.1
app/models/petition.rb 4.1 1 4.1 4.1
app/models/site.rb 4.1 1 4.1 4.1
app/models/email_requested_receipt.rb 16.5 5 3.3 4.0
app/models/domain.rb 5.3 2 2.7 3.9
lib/tasks/bundle.rake 3.9 1 3.9 3.9
lib/tasks/brakeman.rake 3.9 1 3.9 3.9
app/models/feedback.rb 7.1 2 3.6 3.9
app/models/concerns/perishable_token_generator.rb 7.0 2 3.5 3.9
lib/tasks/epets.rake 3.8 1 3.8 3.8
lib/package_builder.rb 3.8 1 3.8 3.8
app/helpers/cache_helper.rb 3.8 1 3.8 3.8
app/helpers/signature_helper.rb 5.7 3 1.9 3.7
app/helpers/auto_link_helper.rb 3.7 1 3.7 3.7
app/models/constituency.rb 3.7 1 3.7 3.7
lib/postcode_sanitizer.rb 3.6 1 3.6 3.6
lib/tasks/countries.rake 3.6 1 3.6 3.6
app/models/site.rb 3.6 1 3.6 3.6
app/helpers/sharing_helper.rb 37.0 16 2.3 3.5
app/mailers/feedback_mailer.rb 3.5 1 3.5 3.5
app/controllers/constituencies_controller.rb 4.4 2 2.2 3.4
app/lib/job_logger.rb 20.0 7 2.9 3.4
app/models/concerns/browseable.rb 8.4 3 2.8 3.4
app/helpers/cache_helper.rb 3.4 1 3.4 3.4
lib/package_builder.rb 3.4 1 3.4 3.4
app/models/archived/signature.rb 3.4 1 3.4 3.4
app/models/archived/signature.rb 3.4 1 3.4 3.4
app/models/archived/signature.rb 3.4 1 3.4 3.4
app/models/archived/petition.rb 3.4 1 3.4 3.4
app/models/archived/petition.rb 3.4 1 3.4 3.4
app/models/archived/petition.rb 3.4 1 3.4 3.4
app/models/archived/petition.rb 3.4 1 3.4 3.4
app/models/archived/petition.rb 3.4 1 3.4 3.4
app/models/archived/petition.rb 3.4 1 3.4 3.4
app/models/archived/petition.rb 3.4 1 3.4 3.4
app/models/archived/signature.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/invalidation.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/petition.rb 3.4 1 3.4 3.4
app/models/parliament.rb 3.4 1 3.4 3.4
app/models/site.rb 3.4 1 3.4 3.4
app/models/signature.rb 3.4 1 3.4 3.4
app/models/signature.rb 3.4 1 3.4 3.4
app/models/signature.rb 3.4 1 3.4 3.4
app/models/signature.rb 3.4 1 3.4 3.4
app/models/signature.rb 3.4 1 3.4 3.4
app/jobs/invalidate_signatures_job.rb 4.3 2 2.1 3.3
app/models/petition/statistics.rb 3.2 1 3.2 3.2
app/helpers/page_title_helper.rb 3.2 1 3.2 3.2
app/models/domain.rb 3.2 1 3.2 3.2
app/models/constituency_petition_journal.rb 3.2 1 3.2 3.2
app/models/archived/signature.rb 3.2 1 3.2 3.2
app/models/site.rb 3.2 1 3.2 3.2
app/models/site.rb 3.2 1 3.2 3.2
app/models/parliament.rb 3.2 1 3.2 3.2
app/models/country_petition_journal.rb 3.2 1 3.2 3.2
app/models/location.rb 3.2 1 3.2 3.2
app/models/location.rb 3.2 1 3.2 3.2
app/models/location.rb 3.2 1 3.2 3.2
app/models/signature.rb 3.2 1 3.2 3.2
app/models/statistics.rb 3.2 1 3.2 3.2
app/models/admin_user.rb 3.0 1 3.0 3.0
app/jobs/application_job.rb 5.0 3 1.7 3.0
app/models/archived/signature.rb 2.9 1 2.9 2.9
app/models/signature.rb 2.9 1 2.9 2.9
2.8 1 2.8 2.8
2.8 1 2.8 2.8
2.8 1 2.8 2.8
2.8 1 2.8 2.8
2.8 1 2.8 2.8
2.8 1 2.8 2.8
2.8 1 2.8 2.8
2.8 1 2.8 2.8
app/models/task.rb 2.7 1 2.7 2.7
app/models/constituency_petition_journal.rb 2.7 1 2.7 2.7
app/models/domain.rb 2.7 1 2.7 2.7
app/models/country_petition_journal.rb 2.7 1 2.7 2.7
app/helpers/auto_link_helper.rb 2.4 1 2.4 2.4
lib/tasks/deploy.rake 12.0 5 2.4 2.4
lib/tasks/epets.rake 2.4 1 2.4 2.4
lib/tasks/epets.rake 4.8 2 2.4 2.4
app/models/site.rb 2.3 1 2.3 2.3
app/models/site.rb 2.3 1 2.3 2.3
app/models/parliament.rb 2.3 1 2.3 2.3
app/models/parliament.rb 2.3 1 2.3 2.3
app/lib/cloud_front_remote_ip.rb 4.2 2 2.1 2.2
lib/health_check.rb 2.2 1 2.2 2.2
lib/arel_extensions.rb 6.6 3 2.2 2.2
app/jobs/close_petitions_job.rb 3.2 2 1.6 2.2
app/jobs/update_petition_statistics_job.rb 3.2 2 1.6 2.2
app/models/concerns/browseable.rb 5.8 3 1.9 2.2
2.2 1 2.2 2.2
app/models/holiday.rb 2.1 1 2.1 2.1
app/models/site.rb 2.1 1 2.1 2.1
app/models/site.rb 2.1 1 2.1 2.1
app/controllers/ping_controller.rb 3.0 2 1.5 2.0
app/jobs/sponsor_signed_email_on_threshold_email_job.rb 3.4 2 1.7 2.0
app/jobs/sponsor_signed_email_below_threshold_email_job.rb 3.4 2 1.7 2.0
2.0 1 2.0 2.0
app/jobs/feedback_email_job.rb 2.0 1 2.0 2.0
2.0 1 2.0 2.0
2.0 1 2.0 2.0
2.0 1 2.0 2.0
2.0 1 2.0 2.0
2.0 1 2.0 2.0
app/helpers/cache_helper.rb 1.6 1 1.6 1.6
app/models/archived/signature.rb 1.6 1 1.6 1.6
app/models/archived/signature.rb 1.6 1 1.6 1.6
app/models/archived/signature.rb 1.6 1 1.6 1.6
app/models/archived/signature.rb 1.6 1 1.6 1.6
app/models/archived/signature.rb 1.6 1 1.6 1.6
app/models/archived/signature.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/petition.rb 1.6 1 1.6 1.6
app/models/archived/signature.rb 1.6 1 1.6 1.6
app/models/archived/signature.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/site.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/site.rb 1.6 1 1.6 1.6
app/models/invalidation.rb 1.6 1 1.6 1.6
app/models/signature_logs.rb 1.6 1 1.6 1.6
app/models/site.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/site.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/site.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/petition.rb 1.6 1 1.6 1.6
app/models/invalidation.rb 1.6 1 1.6 1.6
app/models/invalidation.rb 1.6 1 1.6 1.6
app/models/constituency.rb 1.6 1 1.6 1.6
app/models/constituency.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/tag.rb 1.6 1 1.6 1.6
app/models/signature.rb 1.6 1 1.6 1.6
app/models/constituency/api_query.rb 1.6 1 1.6 1.6
app/models/constituency_petition_journal.rb 1.5 1 1.5 1.5
app/models/domain.rb 1.5 1 1.5 1.5
app/models/domain.rb 1.5 1 1.5 1.5
app/models/location.rb 1.5 1 1.5 1.5
app/models/trending_domain.rb 1.5 1 1.5 1.5
app/models/trending_domain.rb 1.5 1 1.5 1.5
app/models/statistics.rb 1.5 1 1.5 1.5
app/models/trending_ip.rb 1.5 1 1.5 1.5
app/models/trending_ip.rb 1.5 1 1.5 1.5
app/helpers/page_title_helper.rb 1.0 1 1.0 1.0
lib/arel_extensions.rb 4.0 4 1.0 1.0
app/jobs/email_threshold_reminder_job.rb 2.0 2 1.0 1.0
app/jobs/refresh_constituencies_job.rb 2.0 2 1.0 1.0
app/jobs/delete_petition_job.rb 2.0 2 1.0 1.0

app/jobs/archive_petition_job.rb

ArchivePetitionJob#perform

Total Score: 187.8

Score Operator
28.9 branch
1.2 archived?
3.3 parliament
2.9 petitions
2.9 id
1.2 exists?
105.8 assignment
1.3 create!
1.5 action
1.5 background
1.5 additional_details
1.5 state
1.5 debate_state
1.5 special_consideration
1.5 opened_at
1.5 closed_at
1.5 rejected_at
1.5 stopped_at
5.3 signature_count
1.5 moderation_threshold_reached_at
1.5 moderation_lag
1.5 last_signed_at
1.5 response_threshold_reached_at
1.5 government_response_at
1.5 debate_threshold_reached_at
1.5 scheduled_debate_date
1.5 debate_outcome_at
10.5 created_at
10.5 updated_at
1.5 email_requested_receipt
3.2 government_response
1.7 debate_scheduled
3.2 debate_outcome
1.7 petition_email
1.5 note
1.6 build_note
5.4 details
1.5 rejection
1.6 build_rejection
1.8 code
3.5 emails
1.5 each
1.6 build
1.8 subject
1.8 body
1.8 sent_by
1.6 build_government_response
1.8 responded_on
1.8 summary
1.6 build_debate_outcome
1.8 debated
1.8 debated_on
1.8 transcript_url
1.8 video_url
1.8 debate_pack_url
1.8 overview
1.8 commons_image?
2.0 new
2.2 commons_image
2.2 path
2.0 copy_to_local_file
2.0 rewind
2.0 commons_image_file_name
1.5 signatures_by_constituency
3.0 empty?
3.6 map
1.9 constituency_id
3.2 []
1.5 signatures_by_country
1.9 location_code
1.3 perform_later

ArchivePetitionJob#none

Total Score: 2.2

Score Operator
1.1 queue_as
1.1 private

ArchivePetitionJob#parliament

Total Score: 1.1

Score Operator
1.1 instance

app/models/petition.rb

Petition#none

Total Score: 174.4

Score Operator
4.4 include
1.1 has_perishable_token
2.2 before_save
1.1 after_create
1.3 Searchable
2.2 extend
31.2 branch
31.2 lambda
4.2 by_most_popular
24.2 facet
1.6 open_state
1.6 rejected_state
5.6 by_most_recent
1.6 closed_state
1.6 hidden_state
1.6 stopped_state
1.6 awaiting_response
1.4 by_waiting_for_response_longest
1.6 with_response
1.4 by_most_recent_response
1.6 awaiting_debate
1.4 by_most_relevant_debate_date
1.6 awaiting_debate_date
2.8 by_waiting_for_debate_longest
1.6 with_debate_outcome
5.6 by_most_recent_debate_outcome
1.6 with_debated_outcome
1.6 debated
1.6 not_debated
1.6 collecting_sponsors
1.6 in_moderation
8.4 by_most_recent_moderation_threshold_reached
1.6 in_debate_queue
1.6 recently_in_moderation
1.6 nearly_overdue_in_moderation
1.6 overdue_in_moderation
1.6 tagged_in_moderation
1.6 untagged_in_moderation
1.4 creator
7.7 has_one
1.1 accepts_nested_attributes_for
1.1 belongs_to
8.8 has_many
1.4 sponsors
1.0 lit_fixnum
6.6 validates
1.1 alias_attribute
1.6 private
5.5 sclass
2.2 alias_method

Petition#increment_signature_count!

Total Score: 35.1

Score Operator
7.0 assignment
1.1 current
1.3 signatures
1.3 last_signed_at
1.1 validated_count
11.5 branch
1.1 zero?
2.9 update_all
2.5 >
2.8 reload
1.4 at_threshold_for_moderation?
1.4 collecting_sponsors?
8.9 <<
1.4 pending?
1.3 at_threshold_for_response?
1.3 at_threshold_for_debate?
1.3 join
1.3 present?

Petition#cache_key

Total Score: 33.5

Score Operator
4.7 branch
1.3 new_record?
1.3 any?
7.8 assignment
2.6 max_updated_column_timestamp
3.8 sec
1.8 lit_fixnum
3.4 div
3.0 *
2.6 change
3.0 utc
3.0 cache_timestamp_format
2.6 to_s
3.8 id

Petition#moderate

Total Score: 13.8

Score Operator
1.1 assignment
2.6 []
3.6 branch
1.1 approve?
1.2 publish
1.2 reject?
1.3 reject
1.3 flag?
1.4 flag
1.7 errors
1.5 add

Petition#decrement_signature_count!

Total Score: 13.5

Score Operator
2.2 assignment
1.1 current
3.3 branch
1.1 below_threshold_for_debate?
6.0 <<
1.1 below_threshold_for_response?
1.3 update_all
1.1 >
1.2 reload

Petition#validate_creator!

Total Score: 12.4

Score Operator
1.1 assignment
1.1 current
3.6 branch
1.1 pending?
2.9 creator
0.5 lit_fixnum
1.8 second
1.6 ago
1.4 validate!
1.4 reload

Petition#closed_for_signing?

Total Score: 10.4

Score Operator
1.1 assignment
1.1 current
2.3 branch
1.2 rejected?
1.3 closed_at?
1.5 closed_at
0.5 lit_fixnum
1.7 hours
1.5 ago
1.3 <

Petition#signatures_by_country

Total Score: 10.1

Score Operator
1.9 country_petition_journals
1.7 joins
1.5 preload
1.3 to_a
1.3 block_pass
1.3 to_proc_normal
1.1 sort_by

Petition#checkout!

Total Score: 9.8

Score Operator
1.1 assignment
1.1 current
3.5 branch
1.1 with_lock
3.0 locked_by
1.3 present?
1.3 !=
1.3 update!

Petition#release!

Total Score: 8.7

Score Operator
3.5 branch
1.1 with_lock
3.0 locked_by
1.3 present?
1.3 ==
1.3 update!

Petition#signatures_by_constituency

Total Score: 8.2

Score Operator
1.7 constituency_petition_journals
1.5 preload
1.3 to_a
1.3 block_pass
1.3 to_proc_normal
1.1 sort_by

Petition#update_signature_count!

Total Score: 7.9

Score Operator
3.3 assignment
1.1 current
1.3 signatures
1.1 validated_count
1.1 branch
1.3 update_all
1.1 >
1.2 reload

Petition#stop!

Total Score: 7.5

Score Operator
1.1 assignment
1.1 current
1.1 branch
2.7 state
1.1 in?
1.2 update!
1.2 raise

Petition#reject

Total Score: 7.2

Score Operator
2.3 branch
1.3 build_rejection
2.9 rejection
1.3 save
1.2 assignment
1.2 update

Petition#at_threshold_for_debate?

Total Score: 7.2

Score Operator
1.1 branch
1.1 debate_threshold_reached_at?
1.4 signature_count
1.6 threshold_for_debate
0.4 lit_fixnum
1.4 -
1.2 >=

Petition#at_threshold_for_moderation?

Total Score: 7.2

Score Operator
1.1 branch
1.1 moderation_threshold_reached_at?
1.4 signature_count
1.6 threshold_for_moderation
0.4 lit_fixnum
1.4 +
1.2 >=

Petition#at_threshold_for_response?

Total Score: 7.2

Score Operator
1.1 branch
1.1 response_threshold_reached_at?
1.4 signature_count
1.6 threshold_for_response
0.4 lit_fixnum
1.4 -
1.2 >=

Petition#update_all

Total Score: 7.1

Score Operator
1.7 class
1.5 unscoped
1.5 id
1.3 where
1.1 update_all

Petition#has_maximum_sponsors?

Total Score: 6.9

Score Operator
1.7 sponsors
1.5 validated
1.3 count
1.3 maximum_number_of_sponsors
1.1 >=

Petition#signature_count_difference

Total Score: 6.7

Score Operator
1.3 signature_count
1.5 signatures
1.5 last_signed_at
1.3 validated_count
1.1 -

Petition#reset_signature_count!

Total Score: 6.7

Score Operator
1.1 assignment
1.1 current
2.2 update_column
1.1 update_signature_count!
2.2 reset_signature_counts_for

Petition#close!

Total Score: 6.2

Score Operator
1.1 assignment
1.1 deadline
1.1 branch
1.1 open?
1.2 update!
1.4 state
1.2 raise

Petition#signatures_to_email_for

Total Score: 6.0

Score Operator
1.1 assignment
1.1 get_email_requested_at_for
1.1 branch
1.1 nil?
1.2 raise
1.3 signatures
1.1 need_emailing_for

Petition#deadline

Total Score: 5.8

Score Operator
2.3 branch
2.7 open_at
1.3 closed_at
1.3 closed_at_for_opening

Petition#evaluate_debate_state

Total Score: 5.6

Score Operator
2.3 branch
1.1 scheduled_debate_date?
1.4 scheduled_debate_date
1.4 current
1.2 >

Petition#update_moderation_lag

Total Score: 5.6

Score Operator
2.2 branch
1.2 open_at_changed?
1.2 rejected_at_changed?
1.2 assignment
1.4 current
1.2 calculate_moderation_lag

Petition#closing_early_for_dissolution?

Total Score: 5.5

Score Operator
1.1 assignment
1.1 dissolution_at
2.2 branch
1.2 open_at
1.4 deadline
1.2 >

Petition#calculate_moderation_lag

Total Score: 5.4

Score Operator
1.1 branch
1.1 moderation_threshold_reached_at?
1.6 moderation_threshold_reached_at
1.4 to_date
1.2 -

Petition#will_reach_threshold_for_moderation?

Total Score: 5.2

Score Operator
1.1 branch
1.1 moderation_threshold_reached_at?
1.4 signature_count
1.4 threshold_for_moderation
1.2 >=

Petition#below_threshold_for_debate?

Total Score: 5.2

Score Operator
1.1 branch
1.1 debate_threshold_reached_at?
1.4 signature_count
1.4 threshold_for_debate
1.2 <=

Petition#below_threshold_for_response?

Total Score: 5.2

Score Operator
1.1 branch
1.1 response_threshold_reached_at?
1.4 signature_count
1.4 threshold_for_response
1.2 <=

Petition#update_lock!

Total Score: 5.0

Score Operator
1.1 assignment
1.1 current
1.1 branch
1.3 locked_by
1.1 ==
1.2 update!

Petition#archiving?

Total Score: 4.0

Score Operator
1.1 branch
1.2 archiving_started_at?
1.4 archived_at?
1.2 !

Petition#fraudulent_domains?

Total Score: 3.9

Score Operator
1.5 fraudulent_domains
1.3 empty?
1.1 !

Petition#count_validated_signatures

Total Score: 3.9

Score Operator
1.5 signatures
1.3 validated
1.1 count

Petition#closed_early_due_to_election?

Total Score: 3.7

Score Operator
1.1 assignment
1.1 dissolution_at
1.3 closed_at
1.1 ==

Petition#set_email_requested_at_for

Total Score: 3.5

Score Operator
1.1 current
1.3 email_requested_receipt!
1.1 set

Petition#fraudulent_domains

Total Score: 2.6

Score Operator
1.1 assignment
1.3 signatures
1.1 fraudulent_domains

Petition#email_requested_receipt!

Total Score: 2.6

Score Operator
1.1 branch
1.2 email_requested_receipt
1.2 create_email_requested_receipt

Petition#editing_disabled?

Total Score: 2.6

Score Operator
1.1 branch
1.2 archiving_started_at?
1.2 archived_at?

Petition#debate_outcome?

Total Score: 2.6

Score Operator
1.1 branch
1.2 debate_outcome_at?
1.2 debate_outcome

Petition#government_response?

Total Score: 2.6

Score Operator
1.1 branch
1.2 government_response_at?
1.2 government_response

Petition#valid_signature_count!

Total Score: 2.6

Score Operator
1.1 branch
1.2 valid_signature_count?
1.2 touch

Petition#force_checkout!

Total Score: 2.5

Score Operator
1.1 assignment
1.1 current
1.1 update!

Petition#publish

Total Score: 2.5

Score Operator
1.1 assignment
1.1 current
1.1 update

Petition#awaiting_debate?

Total Score: 2.4

Score Operator
1.3 debate_state
1.1 in?

Petition#not_debated?

Total Score: 2.4

Score Operator
1.3 debate_state
1.1 ==

Petition#debated?

Total Score: 2.4

Score Operator
1.3 debate_state
1.1 ==

Petition#get_email_requested_at_for

Total Score: 2.4

Score Operator
1.3 email_requested_receipt!
1.1 get

Petition#can_have_debate_added?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Petition#flagged?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Petition#pending?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Petition#visible?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Petition#published?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Petition#validated?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Petition#valid_signature_count?

Total Score: 2.4

Score Operator
1.3 signature_count_difference
1.1 zero?

Petition#approve?

Total Score: 2.4

Score Operator
1.3 moderation
1.1 ==

Petition#reject?

Total Score: 2.4

Score Operator
1.3 moderation
1.1 ==

Petition#flag?

Total Score: 2.4

Score Operator
1.3 moderation
1.1 ==

Petition#collecting_sponsors?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Petition#awaiting_moderation?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Petition#in_moderation?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Petition#moderated?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Petition#open?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Petition#rejected?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Petition#hidden?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Petition#closed?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Petition#in_todo_list?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Petition#stopped?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Petition#moderation=

Total Score: 2.0

Score Operator
1.1 branch
1.1 in?
1.2 assignment

Petition#rejection

Total Score: 1.6

Score Operator
1.1 branch
1.2 build_rejection

Petition#statistics

Total Score: 1.6

Score Operator
1.1 branch
1.2 create_statistics!

Petition#update_debate_state

Total Score: 1.6

Score Operator
1.1 assignment
1.1 evaluate_debate_state

Petition#update_last_petition_created_at

Total Score: 1.1

Score Operator
1.1 last_petition_created_at!

Petition#archived?

Total Score: 1.1

Score Operator
1.1 archived_at?

Petition#flag

Total Score: 1.1

Score Operator
1.1 update

lib/tasks/data-generator.rake

namespace(data)::task#generate

Total Score: 159.3

Score Operator
1.1 task
1.2 require
4.8 fetch
19.1 branch
1.2 exclude?
1.5 inspect
1.3 raise
1.2 transaction
3.2 to_i
4.3 times
7.8 assignment
21.1 rand
3.8 sentence
6.8 lit_fixnum
5.1 first
7.5 paragraph
5.6 name
5.6 safe_email
9.4 sample
1.7 new
4.8 create!
1.8 sponsors
4.1 characters
14.5 now
8.4 update_attributes
2.1 year
7.6 -
2.1 day
8.4 month
7.4 +
1.8 %
3.2 ==
1.8 threshold_for_response
1.9 signatures
1.7 validate!

app/models/archived/petition.rb

Archived::Petition#none

Total Score: 130.1

Score Operator
2.2 belongs_to
24.5 branch
23.4 lambda
1.4 creator
5.5 has_one
3.3 has_many
1.4 sponsors
1.0 lit_fixnum
5.5 validates
1.1 before_save
1.3 Searchable
2.2 extend
2.2 include
1.1 filter
1.6 visible
9.8 by_most_signatures
17.6 facet
1.6 awaiting_response
1.4 by_waiting_for_response_longest
1.6 awaiting_debate_date
2.8 by_waiting_for_debate_longest
1.6 with_debate_outcome
5.6 by_most_recent_debate_outcome
1.6 with_debated_outcome
1.6 published
1.6 stopped
1.6 closed
1.6 rejected
1.6 hidden
1.4 by_most_recent
1.6 with_response
1.6 debated
1.6 not_debated
1.4 by_created_at
1.6 in_debate_queue
1.1 default_scope
1.2 preload
2.2 delegate
1.1 alias_attribute
2.7 private
5.5 sclass

Archived::Petition#calculate_petition_duration

Total Score: 45.5

Score Operator
5.0 branch
8.7 opened_at
4.3 lit_fixnum
6.6 months
5.8 +
7.9 closed_at
5.0 ==
1.9 -
1.9 *
1.7 Rational
1.5 to_f

Archived::Petition#calculate_signatures_by_constituency

Total Score: 10.2

Score Operator
1.1 branch
1.5 keys
1.3 constituencies
1.1 map
1.2 name
1.2 ons_code
1.2 mp_name
1.4 external_id
1.2 []

Archived::Petition#checkout!

Total Score: 9.8

Score Operator
1.1 assignment
1.1 current
3.5 branch
1.1 with_lock
3.0 locked_by
1.3 present?
1.3 !=
1.3 update!

Archived::Petition#calculate_signatures_by_country

Total Score: 9.0

Score Operator
1.1 branch
1.5 keys
1.3 locations
1.1 map
1.2 name
2.6 code
1.2 []

Archived::Petition#release!

Total Score: 8.7

Score Operator
3.5 branch
1.1 with_lock
3.0 locked_by
1.3 present?
1.3 ==
1.3 update!

Archived::Petition#duration

Total Score: 7.8

Score Operator
2.3 branch
2.7 parliament
1.1 petition_duration?
1.2 petition_duration
1.2 opened_at?
1.3 calculate_petition_duration

Archived::Petition#signatures_to_email_for

Total Score: 6.5

Score Operator
1.1 branch
1.1 assignment
1.1 get_email_requested_at_for
1.4 signatures
1.2 need_emailing_for
1.4 id
1.2 raise

Archived::Petition#evaluate_debate_state

Total Score: 5.6

Score Operator
2.3 branch
1.1 scheduled_debate_date?
1.4 scheduled_debate_date
1.4 current
1.2 >

Archived::Petition#threshold_for_response_reached?

Total Score: 5.2

Score Operator
1.3 signature_count
1.5 parliament
1.3 threshold_for_response
1.1 >=

Archived::Petition#threshold_for_debate_reached?

Total Score: 5.2

Score Operator
1.3 signature_count
1.5 parliament
1.3 threshold_for_debate
1.1 >=

Archived::Petition#closed_early_due_to_election?

Total Score: 5.2

Score Operator
1.3 closed_at
1.5 parliament
1.3 dissolution_at
1.1 ==

Archived::Petition#update_lock!

Total Score: 5.0

Score Operator
1.1 assignment
1.1 current
1.1 branch
1.3 locked_by
1.1 ==
1.2 update!

Archived::Petition#signatures_by_constituency

Total Score: 3.6

Score Operator
2.3 branch
1.2 signatures_by_constituency?
1.3 assignment
1.3 calculate_signatures_by_constituency

Archived::Petition#signatures_by_country

Total Score: 3.6

Score Operator
2.3 branch
1.2 signatures_by_country?
1.3 assignment
1.3 calculate_signatures_by_country

Archived::Petition#government_response?

Total Score: 2.6

Score Operator
1.1 branch
1.2 government_response_at
1.2 government_response

Archived::Petition#force_checkout!

Total Score: 2.5

Score Operator
1.1 assignment
1.1 current
1.1 update!

Archived::Petition#locations

Total Score: 2.4

Score Operator
1.3 where
1.1 order

Archived::Petition#constituencies

Total Score: 2.4

Score Operator
1.3 where
1.1 order

Archived::Petition#published?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Archived::Petition#rejected?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Archived::Petition#closed?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Archived::Petition#stopped?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Archived::Petition#can_have_debate_added?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Archived::Petition#moderated?

Total Score: 2.4

Score Operator
1.3 state
1.1 in?

Archived::Petition#hidden?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Archived::Petition#set_email_requested_at_for

Total Score: 2.2

Score Operator
1.1 current
1.1 update_column

Archived::Petition#update_debate_state

Total Score: 1.6

Score Operator
1.1 assignment
1.1 evaluate_debate_state

Archived::Petition#get_email_requested_at_for

Total Score: 1.1

Score Operator
1.1 []

app/models/feedback_signature.rb

main#none

Total Score: 115.6

Score Operator
54.9 require
9.9 require_dependency
20.9 branch
5.8 new
1.2 private
1.0 any?
17.4 assignment
1.6 root
1.4 []
1.2 first
1.2 nil?
1.7 dirname
1.5 +
1.3 unshift
1.4 namespace
4.3 desc
13.7 task
3.6 exist?
3.8 <<
1.5 puts
1.4 abort

main#rfc2822

Total Score: 2.9

Score Operator
1.2 assignment
1.4 feedback_email
1.2 new

main#email

Total Score: 2.6

Score Operator
1.4 rfc2822
1.2 address

app/models/invalidation.rb

Invalidation#none

Total Score: 112.2

Score Operator
1.3 Searchable
2.2 extend
2.2 include
1.1 belongs_to
1.1 has_many
26.1 branch
7.8 lambda
7.0 by_most_recent
6.6 facet
1.6 completed
1.6 cancelled
1.6 pending
1.6 enqueued
1.6 running
1.4 by_longest_running
3.3 lit_fixnum
11.0 validates
1.1 validate
1.5 applied_conditions
1.3 empty?
10.1 errors
8.9 add
1.3 petition_id?
1.6 petition_id
4.2 exists?
1.3 domain?
1.4 domain
1.3 constituency_id?
1.6 constituency_id
1.3 location_code?
1.6 location_code
1.4 created_before?
1.4 created_after?
1.6 created_before
1.6 created_after
1.4 >
1.1 before_destroy
1.4 started?
1.2 !
5.5 sclass
1.1 private

Invalidation#matching_signatures

Total Score: 26.7

Score Operator
11.9 assignment
1.1 for_invalidating
9.9 branch
1.1 petition_id?
1.2 petition_scope
1.1 name?
1.2 name_scope
1.1 postcode?
1.2 postcode_scope
1.1 ip_address?
1.2 ip_address_scope
1.1 email?
1.2 email_scope
1.1 domain?
1.2 domain_scope
1.1 constituency_id?
1.2 constituency_id_scope
1.1 location_code?
1.2 location_code_scope
1.1 date_range?
1.2 date_range_scope

Invalidation#invalidate!

Total Score: 26.3

Score Operator
8.8 branch
2.6 cancelled?
1.2 completed?
5.7 current
2.9 matching_signatures
1.3 count
2.2 update
1.1 without_instrumentation
0.4 lit_fixnum
1.2 find_in_batches
1.4 each
1.6 invalidate!
1.6 increment!
1.6 reload

Invalidation#date_range_scope

Total Score: 17.7

Score Operator
2.2 branch
1.1 created_before?
2.4 assignment
3.6 table
3.2 []
1.6 created_before
1.4 lt
2.4 where
1.1 created_after?
1.6 created_after
1.4 gt

Invalidation#calculate_percent_complete

Total Score: 17.1

Score Operator
2.3 invalidated_count
4.2 to_f
2.3 matching_count
1.9 /
0.8 lit_fixnum
1.7 *
1.5 floor
1.3 max
1.1 min

Invalidation#name_scope

Total Score: 13.1

Score Operator
1.1 branch
4.7 name
3.2 strip
2.8 downcase
2.4 where

Invalidation#percent_completed

Total Score: 11.5

Score Operator
4.6 branch
1.2 started?
1.2 completed?
2.8 matching_count
2.4 zero?
0.3 lit_fixnum
2.6 calculate_percent_complete

Invalidation#pending?

Total Score: 8.3

Score Operator
4.2 branch
1.4 enqueued?
1.5 started?
1.6 cancelled?
1.6 completed?
1.1 !

Invalidation#email_scope

Total Score: 6.4

Score Operator
1.1 branch
3.9 email
2.4 where

Invalidation#count!

Total Score: 6.4

Score Operator
1.1 branch
1.1 pending?
1.5 matching_signatures
1.3 count
1.3 current
1.1 update

Invalidation#domain_scope

Total Score: 6.4

Score Operator
1.1 branch
3.9 domain
2.4 where

Invalidation#running?

Total Score: 6.0

Score Operator
2.5 branch
1.2 started?
1.5 completed?
1.5 cancelled?
1.2 !

Invalidation#cancel!

Total Score: 5.2

Score Operator
1.1 assignment
1.1 current
2.2 branch
1.2 cancelled?
1.2 completed?
1.1 update

Invalidation#start!

Total Score: 4.7

Score Operator
1.1 branch
1.1 pending?
1.1 perform_later
1.3 current
1.1 update

Invalidation#applied_conditions

Total Score: 3.9

Score Operator
1.1 branch
1.1 select
1.4 read_attribute
1.2 present?

Invalidation#date_range?

Total Score: 2.6

Score Operator
1.1 branch
1.2 created_before?
1.2 created_after?

Invalidation#location_code_scope

Total Score: 2.4

Score Operator
1.3 location_code
1.1 where

Invalidation#constituency_id_scope

Total Score: 2.4

Score Operator
1.3 constituency_id
1.1 where

Invalidation#ip_address_scope

Total Score: 2.4

Score Operator
1.3 ip_address
1.1 where

Invalidation#postcode_scope

Total Score: 2.4

Score Operator
1.3 postcode
1.1 where

Invalidation#petition_scope

Total Score: 2.4

Score Operator
1.3 petition_id
1.1 where

Invalidation#cancelled?

Total Score: 1.1

Score Operator
1.1 cancelled_at?

Invalidation#started?

Total Score: 1.1

Score Operator
1.1 started_at?

Invalidation#completed?

Total Score: 1.1

Score Operator
1.1 completed_at?

Invalidation#table

Total Score: 1.1

Score Operator
1.1 arel_table

Invalidation#enqueued?

Total Score: 1.1

Score Operator
1.1 enqueued_at?

app/jobs/archive_signatures_job.rb

ArchiveSignaturesJob#perform

Total Score: 105.3

Score Operator
0.3 lit_fixnum
57.2 assignment
12.7 branch
2.1 trap
1.3 call
1.1 without_instrumentation
4.9 signatures
4.3 unarchived
2.3 exists?
1.4 batch
1.4 each
1.6 with_lock
1.7 archived_at?
1.9 new
2.1 petition_id
2.1 uuid
2.1 state
2.1 number
2.1 name
2.1 email
2.1 postcode
2.1 location_code
2.1 constituency_id
2.1 ip_address
2.1 perishable_token
2.1 unsubscribe_token
2.1 notify_by_email
2.1 validated_at
2.1 invalidation_id
2.1 invalidated_at
2.1 government_response_email_at
2.1 debate_scheduled_email_at
2.1 debate_outcome_email_at
2.1 petition_email_at
2.1 creator?
2.1 sponsor?
2.1 created_at
2.1 updated_at
1.9 save!
3.5 current
3.1 update_column
1.8 reschedule_job
1.4 class
1.2 perform_later

ArchiveSignaturesJob#reschedule_job

Total Score: 6.4

Score Operator
0.6 lit_fixnum
1.2 minutes
1.0 from_now
1.4 class
1.2 set
1.0 perform_later

ArchiveSignaturesJob#none

Total Score: 2.0

Score Operator
1.0 queue_as
1.0 private

app/models/rate_limit.rb

RateLimit#none

Total Score: 88.0

Score Operator
17.6 validates
2.3 lit_fixnum
19.6 branch
1.1 validate
3.2 sustained_rate
8.4 nil?
3.2 burst_rate
4.2 <=
13.1 errors
11.5 add
3.2 sustained_period
3.2 burst_period
3.2 country_sustained_rate
3.2 country_burst_rate
1.4 allowed_domains_list
7.0 assignment
1.4 allowed_ips_list
1.4 blocked_domains_list
1.4 blocked_ips_list
1.4 ignored_domains_list
1.1 private

RateLimit#exceeded?

Total Score: 19.5

Score Operator
7.7 branch
1.1 threshold_reached?
5.2 ip_address
1.1 ip_blocked?
1.1 ip_geoblocked?
2.6 domain
1.1 domain_blocked?
1.1 ip_allowed?
1.1 domain_allowed?
1.1 use_country_rate?
1.2 country_rate_exceeded?
1.2 rate_exceeded?

RateLimit#threshold_reached?

Total Score: 9.2

Score Operator
4.4 branch
1.1 threshold_for_form_entry?
1.1 image_loaded_at?
1.1 form_requested_at?
1.1 form_token_reused?
1.3 form_duration
1.3 threshold_for_form_entry
1.1 >

RateLimit#build_ignored_domains

Total Score: 8.3

Score Operator
1.1 branch
1.7 ignored_domains
1.5 strip_comments
1.3 strip_blank_lines
1.1 map
1.4 strip
1.2 validate_domain!

RateLimit#build_allowed_countries

Total Score: 8.2

Score Operator
1.7 countries
1.5 strip_comments
1.3 strip_blank_lines
1.3 block_pass
1.3 to_proc_normal
1.1 map

RateLimit#build_blocked_ips

Total Score: 7.6

Score Operator
2.2 assignment
1.3 blocked_ips
1.1 strip_comments
1.1 strip_blank_lines
1.1 branch
1.1 map
1.4 strip
1.2 new

RateLimit#build_allowed_domains

Total Score: 7.6

Score Operator
2.2 assignment
1.3 allowed_domains
1.1 strip_comments
1.1 strip_blank_lines
1.1 branch
1.1 map
1.4 strip
1.2 convert_glob

RateLimit#build_blocked_domains

Total Score: 7.6

Score Operator
2.2 assignment
1.3 blocked_domains
1.1 strip_comments
1.1 strip_blank_lines
1.1 branch
1.1 map
1.4 strip
1.2 convert_glob

RateLimit#build_allowed_ips

Total Score: 7.6

Score Operator
2.2 assignment
1.3 allowed_ips
1.1 strip_comments
1.1 strip_blank_lines
1.1 branch
1.1 map
1.4 strip
1.2 new

RateLimit#reload

Total Score: 6.6

Score Operator
6.6 assignment

RateLimit#country_for_ip

Total Score: 6.3

Score Operator
1.1 assignment
1.3 geoip_db
1.1 lookup
1.1 branch
1.1 found?
1.4 country
1.2 name

RateLimit#use_country_rate?

Total Score: 5.2

Score Operator
1.1 branch
1.1 country_rate_limits_enabled?
1.4 allowed_countries
1.4 country_for_ip
1.2 include?

RateLimit#burst_rate_exceeded?

Total Score: 5.2

Score Operator
1.3 burst_rate
1.5 burst_period
1.3 rate
1.1 <

RateLimit#country_sustained_rate_exceeded?

Total Score: 5.2

Score Operator
1.3 country_sustained_rate
1.5 sustained_period
1.3 rate
1.1 <

RateLimit#sustained_rate_exceeded?

Total Score: 5.2

Score Operator
1.3 sustained_rate
1.5 sustained_period
1.3 rate
1.1 <

RateLimit#country_burst_rate_exceeded?

Total Score: 5.2

Score Operator
1.3 country_burst_rate
1.5 burst_period
1.3 rate
1.1 <

RateLimit#convert_glob

Total Score: 5.1

Score Operator
3.6 branch
1.1 gsub
2.5 ==

RateLimit#strip_blank_lines

Total Score: 5.0

Score Operator
1.3 each_line
1.3 block_pass
1.3 to_proc_normal
1.1 reject

RateLimit#ignore_ip?

Total Score: 4.4

Score Operator
2.3 branch
1.2 ip_blocked?
1.3 ip_allowed?
1.3 ip_geoblocked?

RateLimit#normalize_lines

Total Score: 3.9

Score Operator
1.5 to_s
1.3 strip
1.1 gsub

RateLimit#validate_domain!

Total Score: 3.9

Score Operator
1.1 branch
1.1 =~
1.4 inspect
1.2 raise

RateLimit#domain_blocked?

Total Score: 3.8

Score Operator
1.1 branch
1.3 blocked_domains_list
1.1 any?
1.2 ===

RateLimit#domain_allowed?

Total Score: 3.8

Score Operator
1.1 branch
1.3 allowed_domains_list
1.1 any?
1.2 ===

RateLimit#ip_allowed?

Total Score: 3.8

Score Operator
1.1 branch
1.3 allowed_ips_list
1.1 any?
1.2 include?

RateLimit#ip_blocked?

Total Score: 3.8

Score Operator
1.1 branch
1.3 blocked_ips_list
1.1 any?
1.2 include?

RateLimit#country_blocked?

Total Score: 3.7

Score Operator
1.3 allowed_countries
1.3 country_for_ip
1.1 exclude?

RateLimit#ip_geoblocked?

Total Score: 2.6

Score Operator
1.1 branch
1.2 geoblocking_enabled?
1.2 country_blocked?

RateLimit#ignore_domain?

Total Score: 2.6

Score Operator
1.1 branch
1.2 domain_blocked?
1.2 domain_allowed?

RateLimit#geoip_db

Total Score: 2.6

Score Operator
1.1 assignment
1.3 fetch
1.1 new

RateLimit#country_rate_exceeded?

Total Score: 2.6

Score Operator
1.1 branch
1.2 country_burst_rate_exceeded?
1.2 country_sustained_rate_exceeded?

RateLimit#rate_exceeded?

Total Score: 2.6

Score Operator
1.1 branch
1.2 burst_rate_exceeded?
1.2 sustained_rate_exceeded?

RateLimit#blocked_ips=

Total Score: 2.5

Score Operator
1.1 assignment
1.1 super
1.1 normalize_lines

RateLimit#allowed_ips=

Total Score: 2.5

Score Operator
1.1 assignment
1.1 super
1.1 normalize_lines

RateLimit#allowed_domains=

Total Score: 2.5

Score Operator
1.1 assignment
1.1 super
1.1 normalize_lines

RateLimit#countries=

Total Score: 2.5

Score Operator
1.1 assignment
1.1 super
1.1 normalize_lines

RateLimit#blocked_domains=

Total Score: 2.5

Score Operator
1.1 assignment
1.1 super
1.1 normalize_lines

RateLimit#ignored_domains=

Total Score: 2.5

Score Operator
1.1 assignment
1.1 super
1.1 normalize_lines

RateLimit#allowed_countries

Total Score: 1.6

Score Operator
1.1 assignment
1.1 build_allowed_countries

RateLimit#ignored_domains_list

Total Score: 1.6

Score Operator
1.1 assignment
1.1 build_ignored_domains

RateLimit#blocked_ips_list

Total Score: 1.6

Score Operator
1.1 assignment
1.1 build_blocked_ips

RateLimit#allowed_ips_list

Total Score: 1.6

Score Operator
1.1 assignment
1.1 build_allowed_ips

RateLimit#blocked_domains_list

Total Score: 1.6

Score Operator
1.1 assignment
1.1 build_blocked_domains

RateLimit#allowed_domains_list

Total Score: 1.6

Score Operator
1.1 assignment
1.1 build_allowed_domains

RateLimit#strip_comments

Total Score: 1.1

Score Operator
1.1 gsub

app/models/signature.rb

Signature::search

Total Score: 78.2

Score Operator
36.9 assignment
1.6 to_s
5.2 []
4.2 to_i
1.4 lit_fixnum
1.6 max
1.8 preload
1.6 by_most_recent
17.8 branch
1.6 in?
5.6 where
1.6 present?
1.7 =~
2.1 in_time_zone
1.9 at_beginning_of_hour
1.9 advance
2.2 seconds
2.0 ago
2.0 current
1.6 ip_search?
1.7 for_ip
1.7 domain_search?
1.8 for_domain
1.8 email_search?
1.9 for_email
1.9 petition_search?
2.0 for_petition
2.0 postcode_search?
2.1 for_postcode
2.1 sector_search?
2.2 for_sector
2.2 for_name
1.6 paginate

app/models/archived/signature.rb

Archived::Signature::search

Total Score: 75.7

Score Operator
36.3 assignment
1.6 to_s
5.2 []
4.1 to_i
1.4 lit_fixnum
1.6 max
1.8 preload
1.6 by_most_recent
17.6 branch
1.6 in?
5.4 where
1.7 =~
2.0 in_time_zone
1.8 at_beginning_of_hour
1.8 advance
2.1 seconds
1.9 ago
1.9 current
1.6 ip_search?
1.7 for_ip
1.7 domain_search?
1.8 for_domain
1.8 email_search?
1.9 for_email
1.9 petition_search?
2.0 for_petition
2.0 postcode_search?
2.1 for_postcode
2.1 sector_search?
2.2 for_sector
2.2 for_name
1.6 paginate

app/lib/deprecated_attributes.rb

DeprecatedAttributes#deprecate_attribute

Total Score: 72.3

Score Operator
10.2 branch
1.2 each
21.0 define_method
4.8 assignment
6.0 caller_locations
6.0 block_pass
6.0 to_proc_normal
5.4 map
4.8 reject
6.0 class
5.4 name
4.8 warn
4.8 super

DeprecatedAttributes#none

Total Score: 3.5

Score Operator
2.2 extend
1.1 branch
1.1 class_methods

app/models/site.rb

Site#none

Total Score: 70.7

Score Operator
2.2 include
1.1 to_set
2.7 private
5.5 sclass
8.6 branch
1.1 table_exists?
1.6 column_names
4.8 block_pass
1.6 to_proc_normal
1.4 map
2.3 each
2.6 define_singleton_method
3.2 instance
2.8 public_send
13.0 define_method
1.6 type_cast_feature_flag
1.4 write_store_attribute
1.4 read_store_attribute
1.1 attr_reader
2.3 lit_fixnum
16.5 validates

Site#opened_at_for_closing

Total Score: 13.2

Score Operator
2.2 assignment
1.1 current
1.3 beginning_of_day
1.5 petition_duration
1.3 months
1.1 -
1.1 branch
4.0 day
1.1 <
0.4 lit_fixnum
1.2 +

Site#closed_at_for_opening

Total Score: 6.4

Score Operator
1.1 assignment
1.1 current
1.3 end_of_day
1.5 petition_duration
1.3 months
1.1 +

Site#authenticate

Total Score: 5.3

Score Operator
1.1 branch
1.4 username
2.4 ==
1.4 password_digest

Site#update_all

Total Score: 5.2

Score Operator
1.1 branch
1.5 scope
1.3 update_all
1.1 >
1.2 reload

Site#scope

Total Score: 5.2

Score Operator
1.5 class
1.3 unscoped
1.3 id
1.1 where

Site#constraints_for_moderation

Total Score: 4.8

Score Operator
1.1 branch
1.1 database_migrating?
1.2 moderate_protocol
1.2 moderate_host
1.2 moderate_port

Site#constraints_for_public

Total Score: 4.8

Score Operator
1.1 branch
1.1 database_migrating?
1.2 protocol
1.2 host
1.2 port

Site#standard_port?

Total Score: 3.7

Score Operator
1.3 port
1.3 standard_port
1.1 ==

Site#password=

Total Score: 3.7

Score Operator
2.3 assignment
1.1 presence
1.1 branch
0.4 lit_fixnum
1.2 create

Site#host_with_port

Total Score: 3.5

Score Operator
1.1 host
1.3 uri
1.1 port_string

Site#moderate_host_with_port

Total Score: 3.5

Score Operator
1.1 moderate_host
1.3 moderate_uri
1.1 port_string

Site#standard_port

Total Score: 2.9

Score Operator
2.3 branch
1.1 scheme
0.6 lit_fixnum

Site#uri

Total Score: 2.6

Score Operator
1.1 assignment
1.3 url
1.1 parse

Site#moderate_uri

Total Score: 2.6

Score Operator
1.1 assignment
1.3 moderate_url
1.1 parse

Site#port_string

Total Score: 2.5

Score Operator
1.1 branch
1.1 standard_port?
1.2 port

Site#formatted_threshold_for_response

Total Score: 2.4

Score Operator
1.3 threshold_for_response
1.1 number_to_delimited

Site#email_protocol

Total Score: 2.4

Score Operator
1.3 uri
1.1 scheme

Site#moderate_protocol

Total Score: 2.4

Score Operator
1.3 moderate_uri
1.1 scheme

Site#moderate_port

Total Score: 2.4

Score Operator
1.3 moderate_uri
1.1 port

Site#moderate_host

Total Score: 2.4

Score Operator
1.3 moderate_uri
1.1 host

Site#protocol

Total Score: 2.4

Score Operator
1.3 uri
1.1 scheme

Site#port

Total Score: 2.4

Score Operator
1.3 uri
1.1 port

Site#host

Total Score: 2.4

Score Operator
1.3 uri
1.1 host

Site#formatted_threshold_for_debate

Total Score: 2.4

Score Operator
1.3 threshold_for_debate
1.1 number_to_delimited

Site#formatted_threshold_for_moderation

Total Score: 2.4

Score Operator
1.3 threshold_for_moderation
1.1 number_to_delimited

Site#database_migrating?

Total Score: 1.6

Score Operator
1.1 branch
1.1 any?

Site#type_cast_feature_flag

Total Score: 1.6

Score Operator
1.1 branch
1.1 in?

Site#password_digest

Total Score: 1.1

Score Operator
1.1 new

app/models/petition_creator.rb

PetitionCreator#validate_creator

Total Score: 58.7

Score Operator
13.7 branch
1.3 name
7.0 present?
11.4 errors
8.6 add
1.5 action
2.6 length
1.4 lit_fixnum
2.2 >
2.6 email
2.6 location_code
1.3 uk_citizenship
2.2 ==
4.5 postcode
1.4 email_validator
2.6 validate
1.6 postcode_validator
1.1 replay_email?
2.5 assignment
1.2 any?

PetitionCreator#save

Total Score: 39.2

Score Operator
8.5 branch
1.1 moving_backwards?
22.0 assignment
1.3 previous_stage
1.1 valid?
1.1 done?
1.3 new
1.5 action
1.5 background
1.5 additional_details
1.5 build_creator
1.7 name
1.7 email
1.7 postcode
1.7 location_code
1.7 uk_citizenship
1.7 constituency_id
1.7 notify_by_email
1.9 request
1.7 remote_ip
1.3 save!
1.3 send_email_to_gather_sponsors
1.3 next_stage

PetitionCreator#validate_petition

Total Score: 34.6

Score Operator
6.6 branch
2.8 action
2.2 present?
8.3 errors
6.0 add
3.9 length
2.0 lit_fixnum
3.3 >
2.8 background
1.5 additional_details
1.1 any?
1.2 assignment

PetitionCreator#none

Total Score: 9.9

Score Operator
4.4 extend
2.2 include
1.1 +
1.1 attr_reader
1.1 private

PetitionCreator#validate

Total Score: 8.2

Score Operator
1.1 validate_petition
2.2 branch
1.4 errors
1.2 empty?
1.4 stage_index
0.4 lit_fixnum
1.2 >
1.2 validate_creator

PetitionCreator#action

Total Score: 7.6

Score Operator
1.5 branch
1.8 petition_creator_params
1.6 []
1.6 query_param
1.3 to_s
1.1 strip

PetitionCreator#replay_email?

Total Score: 6.9

Score Operator
1.1 branch
1.4 stage
2.4 ==
1.6 errors
1.4 keys

PetitionCreator#next_stage

Total Score: 6.4

Score Operator
1.7 stage_index
0.8 lit_fixnum
1.5 +
1.3 min
1.1 []

PetitionCreator#query_param

Total Score: 6.0

Score Operator
1.1 assignment
1.7 params
1.5 []
1.3 to_s
0.3 lit_fixnum
1.1 first

PetitionCreator#previous_stage

Total Score: 6.0

Score Operator
1.7 stage_index
0.4 lit_fixnum
1.5 -
1.3 max
1.1 []

PetitionCreator#valid?

Total Score: 5.9

Score Operator
2.6 errors
1.1 clear
1.1 validate
1.1 empty?

PetitionCreator#duplicates

Total Score: 5.8

Score Operator
1.5 current
1.5 action
0.4 lit_fixnum
1.3 search
1.1 presence

PetitionCreator#additional_details

Total Score: 5.6

Score Operator
1.7 petition_creator_params
1.5 []
1.3 to_s
1.1 strip

PetitionCreator#background

Total Score: 5.6

Score Operator
1.7 petition_creator_params
1.5 []
1.3 to_s
1.1 strip

PetitionCreator#email

Total Score: 5.6

Score Operator
1.7 petition_creator_params
1.5 []
1.3 to_s
1.1 strip

PetitionCreator#name

Total Score: 5.6

Score Operator
1.7 petition_creator_params
1.5 []
1.3 to_s
1.1 strip

PetitionCreator#stage

Total Score: 5.0

Score Operator
1.1 assignment
1.1 branch
2.5 stage_param
1.1 in?
1.2 first

PetitionCreator#to_param

Total Score: 4.2

Score Operator
2.2 branch
1.2 persisted?
1.2 to_param
1.2 raise

PetitionCreator#stage_param

Total Score: 4.1

Score Operator
1.1 assignment
1.5 params
1.3 []
1.1 to_s

PetitionCreator#initialize

Total Score: 4.0

Score Operator
3.3 assignment
1.1 permit
1.1 new

PetitionCreator#postcode

Total Score: 3.9

Score Operator
1.5 petition_creator_params
1.3 []
1.1 call

PetitionCreator#location_code

Total Score: 2.8

Score Operator
1.1 branch
1.4 petition_creator_params
1.2 []

PetitionCreator#petition_creator_params

Total Score: 2.8

Score Operator
1.1 branch
1.4 params
1.2 []

PetitionCreator#notify_by_email

Total Score: 2.8

Score Operator
1.1 branch
1.4 petition_creator_params
1.2 []

PetitionCreator#uk_citizenship

Total Score: 2.8

Score Operator
1.1 branch
1.4 petition_creator_params
1.2 []

PetitionCreator#constituency

Total Score: 2.6

Score Operator
1.1 assignment
1.3 postcode
1.1 find_by_postcode

PetitionCreator#done?

Total Score: 2.4

Score Operator
1.3 stage
1.1 ==

PetitionCreator#moving_backwards?

Total Score: 2.4

Score Operator
1.3 params
1.1 key?

PetitionCreator#constituency_id

Total Score: 2.4

Score Operator
1.3 constituency
1.1 try

PetitionCreator#action?

Total Score: 2.4

Score Operator
1.3 action
1.1 present?

PetitionCreator#background?

Total Score: 2.4

Score Operator
1.3 background
1.1 present?

PetitionCreator#stage_index

Total Score: 2.4

Score Operator
1.3 stage
1.1 index

PetitionCreator#postcode_validator

Total Score: 1.1

Score Operator
1.1 new

PetitionCreator#email_validator

Total Score: 1.1

Score Operator
1.1 new

PetitionCreator#to_partial_path

Total Score: 1.1

Score Operator
1.1 stage

PetitionCreator#read_attribute_for_validation

Total Score: 1.1

Score Operator
1.1 public_send

PetitionCreator#send_email_to_gather_sponsors

Total Score: 1.1

Score Operator
1.1 perform_later

AutoLinkHelper::AutoLinker#auto_link_urls

Total Score: 50.3

Score Operator
11.0 branch
1.0 gsub
12.6 assignment
1.2 auto_linked?
1.5 sub!
1.6 push
4.2 last
1.7 []
4.2 scan
3.8 size
1.7 >
2.0 pop
1.8 <<
3.1 block
1.5 call
2.9 +
3.2 sanitize?
3.2 sanitize
2.0 html_options
1.8 merge
1.6 content_tag
1.8 reverse
1.6 join

AutoLinkHelper::AutoLinker#auto_link_email_addresses

Total Score: 19.5

Score Operator
6.6 branch
1.0 gsub
5.9 assignment
1.2 auto_linked?
1.3 html_safe
3.1 block
1.5 call
1.4 sanitize?
3.3 sanitize
1.6 ==
1.6 html_options
1.4 mail_to

AutoLinkHelper::AutoLinker#generate

Total Score: 13.9

Score Operator
5.2 branch
1.2 text
1.0 blank?
1.0 assignment
1.0 scope
4.1 sanitized_text
1.2 auto_link_urls
1.2 auto_link_email_addresses
1.1 auto_link_all
1.0 sanitize?
1.1 html_safe

AutoLinkHelper::AutoLinker#auto_linked?

Total Score: 12.0

Score Operator
3.2 branch
5.6 []
3.6 =~
1.2 lit_fixnum
1.2 rindex

AutoLinkHelper::AutoLinker#sanitized_text

Total Score: 7.9

Score Operator
1.2 branch
1.2 sanitize?
2.8 text
1.5 sanitize_options
1.3 sanitize
1.0 to_str

AutoLinkHelper::AutoLinker#none

Total Score: 4.0

Score Operator
1.0 html_safe
1.0 attr_reader
1.0 delegate
1.0 private

AutoLinkHelper::AutoLinker#initialize

Total Score: 4.0

Score Operator
4.0 assignment

AutoLinkHelper::AutoLinker#sanitize?

Total Score: 3.9

Score Operator
1.0 branch
1.0 assignment
1.4 options
1.2 []
1.0 !=

AutoLinkHelper::AutoLinker#html_options

Total Score: 2.8

Score Operator
1.0 assignment
1.0 branch
1.3 options
1.1 []

AutoLinkHelper::AutoLinker#sanitize_options

Total Score: 2.8

Score Operator
1.0 assignment
1.0 branch
1.3 options
1.1 []

AutoLinkHelper::AutoLinker#scope

Total Score: 2.6

Score Operator
1.0 branch
1.3 options
1.1 []

AutoLinkHelper::AutoLinker#auto_link_all

Total Score: 2.2

Score Operator
1.2 auto_link_urls
1.0 auto_link_email_addresses

app/models/signature.rb

Signature#none

Total Score: 45.6

Score Operator
4.4 include
3.3 has_perishable_token
2.2 belongs_to
8.8 validates
1.0 lit_fixnum
1.1 attr_readonly
3.4 branch
1.1 before_destroy
1.4 creator?
1.2 !
1.1 after_destroy
1.2 validated?
1.4 assignment
1.4 current
2.8 invalidate_signature_for
1.6 petition
1.4 decrement_signature_count!
2.7 private
5.5 sclass
1.1 attr_accessor
2.2 alias_method

Signature#validate!

Total Score: 43.6

Score Operator
14.4 assignment
1.1 current
15.9 branch
1.1 constituency_id?
1.3 united_kingdom?
1.3 postcode?
1.5 constituency
1.3 try
1.1 retry_lock
1.3 pending?
1.4 creator?
9.5 petition
1.5 validate_creator!
1.6 signature_count
0.4 lit_fixnum
1.4 +
1.5 remote_ip
1.4 signed_token?
1.5 friendly_token
1.4 update_columns
1.2 inline_updates?
1.3 last_signed_at
1.3 increment_signature_count!
2.6 increment_signature_counts_for

Signature#find_duplicate

Total Score: 20.3

Score Operator
5.8 branch
2.6 petition
2.2 assignment
1.3 signatures
1.3 id
1.3 email
1.1 duplicate
1.1 many?
2.3 first
2.8 sanitized_name
1.2 ==
3.0 postcode
1.3 !=

Signature#find_similar

Total Score: 20.3

Score Operator
5.8 branch
2.6 petition
2.2 assignment
1.3 signatures
1.3 id
1.3 canonical_email
1.1 similar
1.1 many?
2.3 first
2.8 sanitized_name
1.2 ==
3.0 postcode
1.3 !=

Signature#rate

Total Score: 13.9

Score Operator
2.2 assignment
0.3 lit_fixnum
1.1 minutes
2.8 created_at
1.3 -
1.1 new
1.7 petition
1.5 signatures
1.5 ip_address
1.3 where
1.1 count

Signature#invalidate!

Total Score: 11.8

Score Operator
4.7 assignment
1.1 current
3.5 branch
1.1 retry_lock
1.3 validated?
1.3 update_columns
2.6 invalidate_signature_for
1.5 petition
1.3 decrement_signature_count!

Signature#unsubscribe!

Total Score: 10.7

Score Operator
2.3 branch
1.1 unsubscribed?
2.9 errors
2.5 add
1.4 unsubscribe_token
1.2 !=
1.3 update

Signature#retry_lock

Total Score: 10.0

Score Operator
3.7 assignment
3.5 branch
1.2 with_lock
1.3 yield
1.3 raise
1.8 class
1.6 connection
1.4 clear_cache!

Signature#save

Total Score: 9.5

Score Operator
3.6 branch
1.2 assignment
1.2 creator?
1.6 errors
1.6 name
1.6 email
1.4 add
1.3 raise

Signature#find_duplicate!

Total Score: 8.6

Score Operator
2.3 branch
1.2 find_duplicate
1.3 find_similar
1.5 name
1.5 email
1.5 postcode
1.3 raise

Signature#constituency

Total Score: 8.4

Score Operator
2.3 branch
1.1 constituency_id?
2.5 assignment
1.4 constituency_id
1.2 find_by_external_id
1.2 united_kingdom?
1.5 postcode
1.3 find_by_postcode

Signature#form_token_reused?

Total Score: 7.6

Score Operator
1.7 class
1.7 form_token
1.5 where
1.3 count
0.3 lit_fixnum
1.1 >

Signature#update_all

Total Score: 7.1

Score Operator
1.7 class
1.5 unscoped
1.5 id
1.3 where
1.1 update_all

Signature#generate_and_save_signed_token

Total Score: 6.9

Score Operator
2.4 assignment
1.1 friendly_token
2.3 branch
1.1 retry_lock
1.2 signed_token?
1.3 read_attribute
1.3 update_column

Signature#fraudulent!

Total Score: 5.3

Score Operator
1.1 assignment
1.1 current
2.3 branch
1.1 retry_lock
1.2 pending?
1.3 update_columns

Signature#form_duration

Total Score: 5.2

Score Operator
1.1 branch
1.1 form_requested_at?
1.4 created_at
1.4 form_requested_at
1.2 -

Signature#formatted_postcode

Total Score: 5.0

Score Operator
1.1 branch
1.1 united_kingdom?
2.6 postcode
1.2 gsub

Signature#email=

Total Score: 5.0

Score Operator
1.1 super
1.5 to_s
1.3 strip
1.1 downcase

Signature#location

Total Score: 4.8

Score Operator
1.1 branch
1.1 postcode?
1.2 formatted_postcode
2.4 location_code

Signature#number

Total Score: 4.7

Score Operator
1.1 branch
1.6 petition
1.4 signature_count
0.4 lit_fixnum
1.2 +

Signature#domain

Total Score: 4.3

Score Operator
1.1 branch
1.6 email
1.4 new
1.2 domain

Signature#account

Total Score: 4.3

Score Operator
1.1 branch
1.6 email
1.4 new
1.2 local

Signature#validated_before?

Total Score: 4.0

Score Operator
1.1 branch
1.2 validated?
1.4 validated_at
1.2 <

Signature#subscribed?

Total Score: 4.0

Score Operator
1.1 branch
1.2 validated?
1.4 unsubscribed?
1.2 !

Signature#invalid_unsubscribe_token?

Total Score: 3.9

Score Operator
1.5 errors
1.3 []
1.1 include?

Signature#update_canonical_email

Total Score: 3.9

Score Operator
1.5 email
1.3 normalize
1.1 update_column

Signature#already_unsubscribed?

Total Score: 3.9

Score Operator
1.5 errors
1.3 []
1.1 include?

Signature#sanitized_name

Total Score: 3.9

Score Operator
1.5 name
1.3 to_s
1.1 parameterize

Signature#name=

Total Score: 3.5

Score Operator
1.1 super
1.3 to_s
1.1 strip

Signature#set_email_sent_at_for

Total Score: 3.5

Score Operator
1.1 current
1.3 column_name_for
1.1 update_column

Signature#email_threshold_reached?

Total Score: 2.7

Score Operator
1.3 email_count
0.3 lit_fixnum
1.1 >=

Signature#pending?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Signature#inline_updates?

Total Score: 2.4

Score Operator
1.3 []
1.1 ==

Signature#invalidated?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Signature#validated?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Signature#generate_uuid

Total Score: 2.4

Score Operator
1.3 email
1.1 uuid_v5

Signature#unsubscribed?

Total Score: 2.4

Score Operator
1.3 notify_by_email
1.1 ==

Signature#column_name_for

Total Score: 2.4

Score Operator
1.3 class
1.1 column_name_for

Signature#get_email_sent_at_for

Total Score: 2.4

Score Operator
1.3 column_name_for
1.1 []

Signature#fraudulent?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Signature#united_kingdom?

Total Score: 2.4

Score Operator
1.3 location_code
1.1 ==

Signature#update_uuid

Total Score: 2.4

Score Operator
1.3 generate_uuid
1.1 update_column

Signature#postcode=

Total Score: 2.2

Score Operator
1.1 super
1.1 call

Signature#reload

Total Score: 2.0

Score Operator
1.1 branch
1.1 tap
1.2 assignment

Signature#signed_token

Total Score: 1.6

Score Operator
1.1 branch
1.2 generate_and_save_signed_token

Signature#mark_seen_signed_confirmation_page!

Total Score: 1.1

Score Operator
1.1 update

Signature#just_validated?

Total Score: 1.1

Score Operator
1.1 branch

app/models/petition.rb

Petition::open_at_dissolution

Total Score: 45.5

Score Operator
3.4 assignment
1.6 dissolution_at
1.6 branch
1.8 opened_at_for_closing
11.4 arel_table
10.6 []
4.8 eq
5.0 gteq
4.4 and
2.2 or
1.8 where
1.7 none

app/models/archived/debate_outcome.rb

Archived::DebateOutcome#validate_commons_image_dimensions

Total Score: 42.9

Score Operator
6.6 assignment
1.9 commons_image
1.7 queued_for_write
9.5 []
1.3 path
1.1 from_file
3.3 branch
4.0 width
2.2 <
4.2 errors
3.6 add
4.0 height
2.2 image_ratio
1.3 -
0.7 lit_fixnum
2.2 round
1.3 +
1.1 include?

Archived::DebateOutcome#none

Total Score: 37.8

Score Operator
1.1 belongs_to
3.3 validates
1.2 lit_fixnum
4.7 branch
1.3 lambda
1.6 helpers
1.4 image_url
6.0 []
3.0 /
2.6 to_i
1.1 has_attached_file
1.1 validates_attachment_content_type
1.1 validate
1.1 after_create
4.3 petition
1.2 debate_outcome_at?
1.3 touch
1.1 after_save
1.4 debate_state
1.2 update_columns
1.1 private

Archived::DebateOutcome#no_commons_image_queued

Total Score: 8.7

Score Operator
1.1 branch
3.2 commons_image
1.2 blank?
1.6 queued_for_write
1.4 []
1.2 !

Archived::DebateOutcome#image_ratio

Total Score: 5.7

Score Operator
3.0 to_f
1.3 /
0.3 lit_fixnum
1.1 round

Archived::DebateOutcome#debate_state

Total Score: 1.6

Score Operator
1.1 branch
1.1 debated?

Archived::DebateOutcome#date

Total Score: 1.1

Score Operator
1.1 debated_on

app/models/admin_user.rb

AdminUser#none

Total Score: 42.2

Score Operator
0.6 lit_fixnum
9.0 branch
1.0 acts_as_authentic
4.8 assignment
1.2 login_timeout
2.4 merge_validates_length_of_password_field_options
1.2 merge_validates_uniqueness_of_email_field_options
8.0 lambda
3.4 email
6.0 blank?
1.2 merge_validates_format_of_email_field_options
1.2 merge_validates_length_of_email_field_options
3.4 password
1.2 merge_validates_confirmation_of_password_field_options
2.0 validates_presence_of
1.0 validates_format_of
1.0 validates_inclusion_of
2.6 order
2.0 scope
1.5 where

AdminUser#update_with_password

Total Score: 30.4

Score Operator
6.5 branch
2.6 []
3.2 blank?
2.5 delete
1.0 assignment
1.0 valid?
4.1 current_password
5.5 errors
3.6 add
1.3 valid_password?
1.1 !
1.4 password
1.2 ==
1.1 empty?
1.1 save

AdminUser#destroy

Total Score: 9.0

Score Operator
2.1 branch
1.0 ==
2.3 raise
1.5 class
1.3 count
0.3 lit_fixnum
1.1 <
1.2 super

AdminUser#has_to_change_password?

Total Score: 8.6

Score Operator
2.1 branch
1.1 force_password_reset
2.6 password_changed_at
0.5 lit_fixnum
1.6 months
1.4 ago
1.2 <

AdminUser#time_remaining

Total Score: 6.1

Score Operator
1.0 assignment
1.0 current
1.4 login_timeout
1.4 elapsed_time
1.2 -
1.0 max

AdminUser#elapsed_time

Total Score: 4.7

Score Operator
1.0 assignment
1.0 current
1.4 last_request_at
1.2 -
1.0 floor

AdminUser#account_disabled=

Total Score: 3.1

Score Operator
1.0 assignment
2.0 branch
1.1 ==
1.1 !

AdminUser#can_take_petitions_down?

Total Score: 2.4

Score Operator
1.0 branch
1.1 is_a_sysadmin?
1.1 is_a_moderator?

AdminUser#can_edit_responses?

Total Score: 2.4

Score Operator
1.0 branch
1.1 is_a_sysadmin?
1.1 is_a_moderator?

AdminUser#is_a_moderator?

Total Score: 2.2

Score Operator
1.2 role
1.0 ==

AdminUser#account_disabled

Total Score: 2.2

Score Operator
1.2 failed_login_count
1.0 >=

AdminUser#is_a_sysadmin?

Total Score: 2.2

Score Operator
1.2 role
1.0 ==

AdminUser#name

Total Score: 2.0

Score Operator
1.0 last_name
1.0 first_name

AdminUser#pretty_name

Total Score: 2.0

Score Operator
1.0 first_name
1.0 last_name

AdminUser#current_password=

Total Score: 1.0

Score Operator
1.0 assignment

AdminUser#current_password

Total Score: 1.0

Score Operator
1.0 branch

app/models/debate_outcome.rb

DebateOutcome#validate_commons_image_dimensions

Total Score: 39.6

Score Operator
6.0 assignment
1.8 commons_image
1.6 queued_for_write
8.8 []
1.2 path
1.0 from_file
3.0 branch
3.7 width
2.0 <
3.9 errors
3.3 add
3.7 height
2.0 image_ratio
1.2 -
0.6 lit_fixnum
2.0 round
1.2 +
1.0 include?

DebateOutcome#none

Total Score: 34.9

Score Operator
1.0 belongs_to
3.0 validates
1.1 lit_fixnum
4.3 branch
1.2 lambda
1.5 helpers
1.3 image_url
5.6 []
2.8 /
2.4 to_i
1.0 has_attached_file
1.0 validates_attachment_content_type
1.0 validate
1.0 after_create
4.0 petition
1.1 debate_outcome_at?
1.2 touch
1.0 after_save
1.3 debate_state
1.1 update_columns
1.0 private

DebateOutcome#no_commons_image_queued

Total Score: 8.1

Score Operator
1.0 branch
3.0 commons_image
1.1 blank?
1.5 queued_for_write
1.3 []
1.1 !

DebateOutcome#image_ratio

Total Score: 5.3

Score Operator
2.8 to_f
1.2 /
0.3 lit_fixnum
1.0 round

DebateOutcome#debate_state

Total Score: 1.4

Score Operator
1.0 branch
1.0 debated?

DebateOutcome#date

Total Score: 1.0

Score Operator
1.0 debated_on

app/models/signature.rb

Signature::fraudulent_domains

Total Score: 38.7

Score Operator
7.4 where
5.0 select
4.2 group
3.8 order
3.2 count
0.9 lit_fixnum
1.8 hour
1.6 ago
3.2 arel_table
3.0 []
2.8 gt
1.8 limit

app/models/signature.rb

Signature::trending_ips_by_petition

Total Score: 38.3

Score Operator
19.9 assignment
0.4 lit_fixnum
4.8 branch
1.6 new
3.3 where
1.6 empty?
2.4 group
7.2 count_star
2.4 gteq
2.2 having
2.2 desc
2.0 order
2.0 to_sql
1.8 pluck
1.6 each_with_object
1.7 []

app/jobs/update_signature_counts_job.rb

UpdateSignatureCountsJob#perform

Total Score: 38.2

Score Operator
5.8 assignment
1.0 current_time
9.2 branch
1.0 update_signature_counts
1.0 in_time_zone
1.4 signature_count_interval
1.2 seconds
2.6 ago
1.2 signature_count_updated_at
2.4 <
1.2 petitions
1.0 each
1.3 last_signed_at?
2.7 last_signed_at
1.3 >
1.2 signature_count_reset_at?
1.6 signature_count_reset_at
0.5 lit_fixnum
1.8 minutes
1.6 id
1.8 new
1.6 send_exception
1.2 increment_signature_count!
2.8 increment_signature_counts_for
1.0 signature_count_updated_at!
1.2 scheduled_time
1.0 reschedule_job

UpdateSignatureCountsJob#none

Total Score: 11.8

Score Operator
1.0 queue_as
5.0 delegate
1.0 branch
1.0 rescue_from
1.2 log_exception
1.4 signature_count_interval
1.2 retry_job
1.0 private

UpdateSignatureCountsJob#reschedule_job

Total Score: 4.8

Score Operator
1.4 class
1.2 set
1.2 iso8601
1.0 perform_later

UpdateSignatureCountsJob#log_message

Total Score: 4.4

Score Operator
2.4 class
2.0 name

UpdateSignatureCountsJob#current_time

Total Score: 3.6

Score Operator
1.4 current
1.2 change
1.0 iso8601

UpdateSignatureCountsJob#scheduled_time

Total Score: 3.6

Score Operator
1.4 signature_count_interval
1.2 seconds
1.0 since

UpdateSignatureCountsJob#log_exception

Total Score: 3.4

Score Operator
1.2 logger
1.2 log_message
1.0 info

UpdateSignatureCountsJob#petitions

Total Score: 2.2

Score Operator
1.2 petition_ids
1.0 where

UpdateSignatureCountsJob#petition_ids

Total Score: 2.2

Score Operator
1.2 signature_count_updated_at
1.0 petition_ids_signed_since

lib/tasks/errors.rake

namespace(errors)::task#precompile

Total Score: 38.1

Score Operator
1.2 task
1.3 require
5.4 assignment
6.7 branch
8.6 new
2.1 application
1.9 routes
1.7 url_helpers
3.0 include
1.3 each
3.6 public_path
3.2 join
2.8 open
3.4 render
3.0 write

namespace(errors)::task#asset_data

Total Score: 5.1

Score Operator
1.9 root
1.7 join
1.5 read

namespace(errors)::task#data_uri

Total Score: 3.2

Score Operator
1.7 asset_data
1.5 strict_encode64

namespace(errors)::task#url_options

Total Score: 1.4

Score Operator
1.4 constraints_for_public

app/models/concerns/browseable.rb

Browseable::Search#inspect

Total Score: 37.3

Score Operator
4.0 branch
1.2 tap
1.8 class
1.6 name
1.6 object_id
8.6 <<
4.2 klass
3.7 to_s
5.0 inspect
1.4 scoped?
2.1 scope
1.4 search?
1.9 query
1.6 total_entries
1.0 join

Browseable::Search#execute_search

Total Score: 20.9

Score Operator
1.0 branch
1.0 search?
4.7 assignment
4.1 klass
1.4 query
1.2 basic_search
2.6 except
1.4 star
1.2 select
1.2 block_pass
1.2 to_proc_normal
1.4 facet_definitions
1.4 scope
1.2 []
1.0 instance_exec

Browseable::Search#scope

Total Score: 10.3

Score Operator
1.0 assignment
2.2 branch
1.4 facets
1.2 keys
1.2 lambda
1.0 detect
1.3 to_s
1.5 params
1.3 []
1.1 ==

Browseable::Search#new_params

Total Score: 9.7

Score Operator
2.2 branch
1.0 tap
2.7 query
1.2 present?
3.7 assignment
1.2 scope
1.4 filters
1.2 merge!

Browseable::Search#page_size

Total Score: 8.2

Score Operator
1.0 assignment
1.8 params
1.1 lit_fixnum
1.6 fetch
1.4 to_i
1.2 min
1.0 max

Browseable::Search#none

Total Score: 8.0

Score Operator
2.0 include
1.0 attr_reader
4.0 delegate
1.0 private

Browseable::Search#current_page

Total Score: 5.6

Score Operator
1.0 assignment
1.6 params
1.4 []
1.2 to_i
0.3 lit_fixnum
1.0 max

Browseable::Search#star

Total Score: 4.8

Score Operator
1.4 klass
1.2 arel_table
1.2 star
1.0 []

Browseable::Search#execute_search_with_pagination

Total Score: 4.6

Score Operator
1.2 execute_search
1.2 current_page
1.2 page_size
1.0 paginate

Browseable::Search#initialize

Total Score: 4.0

Score Operator
4.0 assignment

Browseable::Search#query

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 to_s

Browseable::Search#filters

Total Score: 3.5

Score Operator
1.0 assignment
1.2 klass
1.2 params
1.0 new

Browseable::Search#in_batches

Total Score: 3.4

Score Operator
1.0 branch
1.2 execute_search
1.0 find_each
1.1 call

Browseable::Search#each

Total Score: 3.4

Score Operator
1.2 results
1.2 block_pass
1.0 each

Browseable::Search#last_page?

Total Score: 3.4

Score Operator
1.2 current_page
1.2 total_pages
1.0 >=

Browseable::Search#find_each

Total Score: 3.4

Score Operator
1.2 execute_search
1.2 block_pass
1.0 find_each

Browseable::Search#first_page?

Total Score: 2.5

Score Operator
1.2 current_page
0.3 lit_fixnum
1.0 <=

Browseable::Search#second_page?

Total Score: 2.5

Score Operator
1.2 current_page
0.3 lit_fixnum
1.0 ==

Browseable::Search#facets

Total Score: 2.4

Score Operator
1.0 assignment
1.2 klass
1.0 new

Browseable::Search#model

Total Score: 2.2

Score Operator
2.2 klass

Browseable::Search#next_params

Total Score: 2.2

Score Operator
1.2 next_page
1.0 new_params

Browseable::Search#previous_params

Total Score: 2.2

Score Operator
1.2 previous_page
1.0 new_params

Browseable::Search#to_a

Total Score: 2.2

Score Operator
1.2 results
1.0 to_a

Browseable::Search#search?

Total Score: 2.2

Score Operator
1.2 query
1.0 present?

Browseable::Search#scoped?

Total Score: 2.2

Score Operator
1.2 scope
1.0 !=

Browseable::Search#results

Total Score: 1.4

Score Operator
1.0 assignment
1.0 execute_search_with_pagination

app/models/signature.rb

Signature::trending_domains

Total Score: 37.1

Score Operator
0.9 lit_fixnum
1.8 hour
1.6 ago
2.8 select
6.2 arel_table
5.8 []
2.8 gt
5.0 where
2.6 eq
2.2 group
2.0 order
1.8 limit
1.6 count

app/models/signature.rb

Signature::trending_ips

Total Score: 37.1

Score Operator
0.9 lit_fixnum
1.8 hour
1.6 ago
2.8 select
6.2 arel_table
5.8 []
2.8 gt
5.0 where
2.6 eq
2.2 group
2.0 order
1.8 limit
1.6 count

app/models/constituency/api_query.rb

Constituency::ApiQuery#parse

Total Score: 35.1

Score Operator
11.8 assignment
1.1 XML
5.2 branch
11.8 xpath
1.1 map
1.2 tap
11.0 text
3.3 at_xpath
1.5 present?
1.6 merge!

Constituency::ApiQuery#fetch

Total Score: 9.4

Score Operator
2.4 branch
3.7 assignment
1.5 client
1.3 call
1.3 success?
1.6 body
1.4 parse
1.2 send_exception

Constituency::ApiQuery#client

Total Score: 2.2

Score Operator
1.1 current
1.1 new

Constituency::ApiQuery#none

Total Score: 1.1

Score Operator
1.1 private

app/helpers/page_title_helper.rb

PageTitleHelper::PageTitleBuilder#none

Total Score: 33.9

Score Operator
5.0 sclass
1.0 attr_reader
4.0 delegate
1.0 private
3.4 branch
1.0 each
12.0 define_method
8.4 send
1.3 present?

PageTitleHelper::PageTitleBuilder#options

Total Score: 25.9

Score Operator
7.2 branch
1.0 tap
10.5 assignment
2.8 controller
1.2 constituency?
1.5 constituency
2.8 name
2.4 postcode?
1.3 formatted_postcode
0.3 lit_fixnum
1.2 petition?
3.5 petition
1.4 action
1.4 ==
1.7 creator

PageTitleHelper::PageTitleBuilder#controller

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 tr

PageTitleHelper::PageTitleBuilder#build

Total Score: 3.4

Score Operator
1.2 key
1.2 options
1.0 translate

PageTitleHelper::PageTitleBuilder#action

Total Score: 2.4

Score Operator
1.0 assignment
1.2 params
1.0 []

PageTitleHelper::PageTitleBuilder#key

Total Score: 2.2

Score Operator
1.0 assignment
1.0 controller
1.0 action

PageTitleHelper::PageTitleBuilder#formatted_postcode

Total Score: 2.2

Score Operator
1.2 postcode
1.0 gsub

PageTitleHelper::PageTitleBuilder#initialize

Total Score: 1.0

Score Operator
1.0 assignment

app/models/signature.rb

Signature::trending_domains_by_petition

Total Score: 33.8

Score Operator
15.0 assignment
0.4 lit_fixnum
3.2 branch
1.6 new
2.6 where
2.4 group
7.2 count_star
2.4 gteq
2.2 having
2.2 desc
2.0 order
2.0 to_sql
1.8 pluck
1.6 each_with_object
1.7 []

app/controllers/admin/parliaments_controller.rb

Admin::ParliamentsController#update

Total Score: 30.3

Score Operator
6.0 branch
1.2 parliament_params
1.0 update
1.1 email_creators?
1.3 notify_creators!
8.3 admin_root_url
7.3 redirect_to
1.2 schedule_closure?
1.4 schedule_closure!
1.3 archive_petitions?
1.5 start_archiving!
1.4 archive_parliament?
1.6 archive!
1.1 render

Admin::ParliamentsController#archive_parliament?

Total Score: 3.6

Score Operator
1.0 branch
1.3 params
1.1 key?
1.1 can_archive?

Admin::ParliamentsController#email_creators?

Total Score: 3.6

Score Operator
1.0 branch
1.3 params
1.1 key?
1.1 dissolution_announced?

Admin::ParliamentsController#schedule_closure?

Total Score: 3.6

Score Operator
1.0 branch
1.3 params
1.1 key?
1.1 dissolution_announced?

Admin::ParliamentsController#archive_petitions?

Total Score: 3.6

Score Operator
1.0 branch
1.3 params
1.1 key?
1.1 can_archive_petitions?

Admin::ParliamentsController#parliament_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::ParliamentsController#none

Total Score: 3.0

Score Operator
2.0 before_action
1.0 private

Admin::ParliamentsController#fetch_parliament

Total Score: 1.4

Score Operator
1.0 assignment
1.0 instance

app/presenters/petition_csv_presenter.rb

PetitionCSVPresenter#none

Total Score: 29.5

Score Operator
4.4 include
1.7 application
1.5 routes
1.3 url_helpers
1.1 attr_reader
1.1 private
1.3 attributes
1.1 delegate
2.3 branch
1.3 timestamps
1.1 each
6.0 define_method
1.7 petition
4.5 send
1.3 api_date_format

PetitionCSVPresenter#values

Total Score: 7.6

Score Operator
1.1 branch
1.5 class
1.3 fields
1.1 map
3.6 send

PetitionCSVPresenter#to_csv

Total Score: 7.1

Score Operator
1.7 class
1.5 fields
1.5 values
1.3 new
1.1 to_s

PetitionCSVPresenter#notes

Total Score: 6.7

Score Operator
1.1 branch
2.9 petition
2.5 note
1.2 details

PetitionCSVPresenter#admin_url

Total Score: 2.4

Score Operator
1.3 id
1.1 admin_petition_url

PetitionCSVPresenter#public_url

Total Score: 2.4

Score Operator
1.3 id
1.1 petition_url

PetitionCSVPresenter#initialize

Total Score: 1.1

Score Operator
1.1 assignment

app/controllers/admin/archived/petitions_controller.rb

Admin::Archived::PetitionsController#scope

Total Score: 28.9

Score Operator
3.3 branch
7.9 params
6.9 []
2.2 ==
5.7 petitions
1.1 untagged
1.1 present?
1.3 tagged_with_all
1.3 tagged_with_any
1.2 all

Admin::Archived::PetitionsController#none

Total Score: 12.2

Score Operator
5.0 before_action
1.0 branch
1.0 rescue_from
1.3 admin_root_url
1.5 params
1.3 []
1.1 redirect_to
1.0 protected

Admin::Archived::PetitionsController#fetch_parliament

Total Score: 8.6

Score Operator
1.0 branch
1.2 params
1.0 key?
2.2 assignment
2.6 archived
1.3 parliament_id
1.1 find
1.1 first

Admin::Archived::PetitionsController#redirect_to_show_page

Total Score: 7.0

Score Operator
1.8 params
1.6 []
1.4 to_i
1.2 admin_archived_petition_url
1.0 redirect_to

Admin::Archived::PetitionsController#csv_filename

Total Score: 5.8

Score Operator
1.4 scope
2.2 to_s
1.0 dasherize
1.2 current

Admin::Archived::PetitionsController#index

Total Score: 5.2

Score Operator
2.2 branch
1.0 respond_to
1.2 html
1.2 csv
1.3 render_csv

Admin::Archived::PetitionsController#set_streaming_headers

Total Score: 4.3

Score Operator
1.0 assignment
3.2 headers
1.0 delete

Admin::Archived::PetitionsController#render_csv

Total Score: 4.3

Score Operator
1.0 set_file_headers
1.0 set_streaming_headers
1.0 assignment
1.2 new
1.0 render

Admin::Archived::PetitionsController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::Archived::PetitionsController#set_file_headers

Total Score: 3.6

Score Operator
2.0 assignment
2.0 headers
1.0 csv_filename

Admin::Archived::PetitionsController#parliament_id

Total Score: 3.6

Score Operator
1.4 params
1.2 []
1.0 to_i

Admin::Archived::PetitionsController#petition_id?

Total Score: 3.6

Score Operator
1.4 params
1.2 []
1.0 to_s

Admin::Archived::PetitionsController#fetch_petitions

Total Score: 3.5

Score Operator
1.0 assignment
1.2 scope
1.2 params
1.0 search

Admin::Archived::PetitionsController#show

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::Archived::PetitionsController#redirect_to_admin_hub

Total Score: 2.2

Score Operator
1.2 admin_root_url
1.0 redirect_to

Admin::Archived::PetitionsController#parliament_present?

Total Score: 1.0

Score Operator
1.0 present?

app/models/signature.rb

Signature::fraudulent_ips

Total Score: 28.7

Score Operator
0.9 lit_fixnum
1.8 hour
1.6 ago
2.8 select
3.2 arel_table
3.0 []
2.8 gt
5.0 where
2.2 group
2.0 order
1.8 limit
1.6 count

lib/package_builder.rb

PackageBuilder#track_progress

Total Score: 28.2

Score Operator
8.0 assignment
1.3 credentials
1.1 new
7.1 branch
2.7 !
1.3 get_deployment
1.3 successful?
1.5 deployment_info
1.5 status
1.9 complete_time
1.7 nil?
1.6 deployment_complete
3.2 ==
1.8 deployment_progress
0.5 lit_fixnum
1.7 sleep
1.6 yield
1.4 raise

PackageBuilder#write_scripts

Total Score: 27.2

Score Operator
1.1 branch
2.7 scripts_path
1.1 exist?
1.2 mkdir
1.3 application_start_script_file
1.3 application_start_script
6.6 write_script
1.3 application_stop_script_file
1.3 application_stop_script
1.3 after_install_script_file
1.3 after_install_script
1.3 common_functions_script_file
1.3 common_functions_script
1.3 deregister_from_elb_script_file
1.3 deregister_from_elb_script
1.3 register_with_elb_script_file
1.3 register_with_elb_script

PackageBuilder#notify_appsignal

Total Score: 20.5

Score Operator
3.7 branch
2.6 appsignal_push_api_key
7.1 assignment
1.3 new
1.3 post
1.5 url
1.5 headers
1.5 application_name
3.3 revision
1.7 username
1.5 strip_heredoc
1.3 success?
1.4 info

PackageBuilder#build!

Total Score: 19.3

Score Operator
1.3 tmpdir
2.2 info
1.1 create_archive
1.1 extract_archive
1.1 remove_archive
1.1 write_appspec
1.1 write_scripts
2.4 branch
1.3 archive_path
1.1 chdir
1.3 skip_gems?
1.4 package_gems
1.3 create_revision_file
1.3 remove_artifacts
1.1 build_package
1.3 package_name

PackageBuilder#upload!

Total Score: 18.7

Score Operator
5.5 assignment
1.3 region
1.3 profile
1.1 new
1.3 release_bucket
1.1 bucket
1.3 release_key
1.1 object
1.3 package_name
2.2 info
2.4 now
1.3 package_path
1.1 upload_file
1.1 -

PackageBuilder#deploy!

Total Score: 14.5

Score Operator
5.9 branch
1.2 allow_net_connect!
1.2 ci?
1.4 deploy_build?
1.2 !
1.2 info
1.3 skip_build?
1.5 build!
1.5 upload!
1.3 deploy_release?
1.4 create_deployment!

PackageBuilder#after_install_script

Total Score: 12.8

Score Operator
11.7 release
1.1 strip_heredoc

PackageBuilder#deployment_progress

Total Score: 11.9

Score Operator
5.5 assignment
1.1 deployment_id
1.1 create_time
1.3 current
1.1 -
1.1 deployment_overview
1.3 values
2.4 %
1.1 info

PackageBuilder#build_package

Total Score: 11.6

Score Operator
1.1 branch
1.1 exist?
1.2 mkdir
1.1 assignment
4.4 concat
1.3 package_path
1.3 tmpdir
1.1 info
1.1 system

PackageBuilder#create_deployment!

Total Score: 11.2

Score Operator
2.2 assignment
1.3 credentials
1.1 new
1.3 deployment_config
1.1 create_deployment
1.1 info
1.1 branch
1.3 deployment_id
1.1 track_progress
1.3 notify_appsignal
1.3 notify_slack

PackageBuilder#deployment_complete

Total Score: 10.7

Score Operator
5.5 assignment
1.1 deployment_id
1.1 create_time
1.1 complete_time
1.1 -
1.3 status
1.1 downcase
1.3 %
1.1 info

PackageBuilder#initialize

Total Score: 9.8

Score Operator
5.5 assignment
1.1 to_s
1.3 treeish
1.1 strip
1.1 mktmpdir
1.3 now
1.1 getutc
1.1 strftime

PackageBuilder#create_archive

Total Score: 9.3

Score Operator
1.1 assignment
4.4 concat
1.3 archive_file
1.3 treeish
1.1 info
1.1 system

PackageBuilder#notify_slack

Total Score: 8.4

Score Operator
1.1 branch
2.6 slack_webhook
1.3 assignment
1.3 new
1.5 slack_message
1.5 slack_options
1.3 ping

PackageBuilder#none

Total Score: 7.7

Score Operator
5.5 sclass
1.1 attr_reader
1.1 private

PackageBuilder#extract_archive

Total Score: 7.1

Score Operator
1.1 assignment
1.3 tmpdir
2.2 concat
1.3 archive_file
1.1 info
1.1 system

PackageBuilder#deployment_config

Total Score: 6.6

Score Operator
1.1 application_name
1.1 deployment_group_name
1.1 release_bucket
1.1 deployment_key
1.1 deployment_config_name
1.1 description

PackageBuilder#remove_archive

Total Score: 4.7

Score Operator
1.1 assignment
1.3 archive_file
1.1 concat
1.1 info
1.1 system

PackageBuilder#deploy_build?

Total Score: 4.0

Score Operator
1.1 branch
1.4 pull_request?
1.2 !
1.2 deploy_branch?

PackageBuilder#write_script

Total Score: 3.9

Score Operator
1.1 assignment
0.3 lit_fixnum
1.1 write
1.3 new
1.1 chmod

PackageBuilder#skip_gems?

Total Score: 3.9

Score Operator
1.5 fetch
1.3 to_i
1.1 nonzero?

PackageBuilder#skip_build?

Total Score: 3.9

Score Operator
1.5 fetch
1.3 to_i
1.1 nonzero?

PackageBuilder#deploy_release?

Total Score: 3.9

Score Operator
1.5 fetch
1.3 to_i
1.1 nonzero?

PackageBuilder#deployment_config_name

Total Score: 3.8

Score Operator
1.1 assignment
1.1 fetch
3.5 branch

PackageBuilder#website_url

Total Score: 3.8

Score Operator
1.1 branch
2.5 environment
1.1 ==

PackageBuilder#package_gems

Total Score: 3.7

Score Operator
1.1 assignment
1.1 info
1.1 branch
1.1 with_clean_env
1.2 system

PackageBuilder#write_appspec

Total Score: 3.7

Score Operator
1.3 appspec_file
1.3 appspec_yaml
1.1 write

PackageBuilder#archive_file

Total Score: 3.7

Score Operator
1.3 tmpdir
1.3 archive_name
1.1 join

PackageBuilder#archive_path

Total Score: 3.7

Score Operator
1.3 tmpdir
1.3 archive_name
1.1 join

PackageBuilder#create_revision_file

Total Score: 3.7

Score Operator
1.3 revision_file
1.3 revision
1.1 write

PackageBuilder#deployment_key

Total Score: 3.7

Score Operator
1.1 branch
1.1 skip_build?
1.2 latest_key
1.2 release_key

PackageBuilder#remove_artifacts

Total Score: 3.5

Score Operator
1.1 assignment
1.1 concat
1.1 info
1.1 system

PackageBuilder#treeish

Total Score: 3.4

Score Operator
2.3 branch
2.5 []

PackageBuilder#username

Total Score: 3.4

Score Operator
2.3 branch
2.5 []

PackageBuilder#slack_message

Total Score: 3.3

Score Operator
1.1 commit_url
1.1 short_revision
1.1 website_url

PackageBuilder#short_revision

Total Score: 2.7

Score Operator
1.3 revision
0.3 lit_fixnum
1.1 first

PackageBuilder#register_with_elb_script_file

Total Score: 2.4

Score Operator
1.3 tmpdir
1.1 join

PackageBuilder#deregister_from_elb_script_file

Total Score: 2.4

Score Operator
1.3 tmpdir
1.1 join

PackageBuilder#common_functions_script_file

Total Score: 2.4

Score Operator
1.3 tmpdir
1.1 join

PackageBuilder#after_install_script_file

Total Score: 2.4

Score Operator
1.3 tmpdir
1.1 join

PackageBuilder#application_stop_script_file

Total Score: 2.4

Score Operator
1.3 tmpdir
1.1 join

PackageBuilder#application_start_script_file

Total Score: 2.4

Score Operator
1.3 tmpdir
1.1 join

PackageBuilder#appspec_yaml

Total Score: 2.4

Score Operator
1.3 release
1.1 strip_heredoc

PackageBuilder#appspec_file

Total Score: 2.4

Score Operator
1.3 tmpdir
1.1 join

PackageBuilder#scripts_path

Total Score: 2.4

Score Operator
1.3 tmpdir
1.1 join

PackageBuilder#ci?

Total Score: 2.4

Score Operator
1.3 fetch
1.1 ==

PackageBuilder#pull_request?

Total Score: 2.4

Score Operator
1.3 fetch
1.1 !=

PackageBuilder#revision_file

Total Score: 2.4

Score Operator
1.3 archive_path
1.1 join

PackageBuilder#package_path

Total Score: 2.4

Score Operator
1.3 package_name
1.1 join

PackageBuilder#package_name

Total Score: 2.4

Score Operator
1.3 timestamp
1.1 strftime

PackageBuilder#deploy_branch?

Total Score: 2.4

Score Operator
1.3 fetch
1.1 ==

PackageBuilder#application_name

Total Score: 2.2

Score Operator
1.1 fetch
1.1 environment

PackageBuilder#credentials

Total Score: 2.2

Score Operator
1.1 region
1.1 profile

PackageBuilder#deregister_from_elb_script

Total Score: 1.1

Score Operator
1.1 strip_heredoc

PackageBuilder#application_start_script

Total Score: 1.1

Score Operator
1.1 strip_heredoc

PackageBuilder#application_stop_script

Total Score: 1.1

Score Operator
1.1 strip_heredoc

PackageBuilder#register_with_elb_script

Total Score: 1.1

Score Operator
1.1 strip_heredoc

PackageBuilder#common_functions_script

Total Score: 1.1

Score Operator
1.1 strip_heredoc

PackageBuilder#deployment_group_name

Total Score: 1.1

Score Operator
1.1 fetch

PackageBuilder#description

Total Score: 1.1

Score Operator
1.1 fetch

PackageBuilder#info

Total Score: 1.1

Score Operator
1.1 puts

PackageBuilder#profile

Total Score: 1.1

Score Operator
1.1 fetch

PackageBuilder#appsignal_push_api_key

Total Score: 1.1

Score Operator
1.1 fetch

PackageBuilder#slack_webhook

Total Score: 1.1

Score Operator
1.1 fetch

PackageBuilder#region

Total Score: 1.1

Score Operator
1.1 fetch

PackageBuilder#release_bucket

Total Score: 1.1

Score Operator
1.1 environment

PackageBuilder#release_key

Total Score: 1.1

Score Operator
1.1 release

PackageBuilder#commit_url

Total Score: 1.1

Score Operator
1.1 revision

app/models/signature.rb

Signature::duplicate_emails

Total Score: 28.0

Score Operator
2.0 unscoped
2.6 validated
2.4 select
2.2 group
2.8 arel_table
2.8 star
2.6 []
4.0 count
0.6 lit_fixnum
2.2 gt
2.0 having
1.8 from

app/models/site.rb

Site::defaults

Total Score: 27.2

Score Operator
1.6 default_title
1.6 default_url
1.6 default_moderate_url
1.6 default_email_from
1.6 default_feedback_email
1.6 default_username
1.6 default_password
1.6 default_enabled
1.6 default_protected
1.6 default_login_timeout
1.6 default_petition_duration
1.6 default_minimum_number_of_sponsors
1.6 default_maximum_number_of_sponsors
1.6 default_threshold_for_moderation
1.6 default_threshold_for_moderation_delay
1.6 default_threshold_for_response
1.6 default_threshold_for_debate

app/controllers/signatures_controller.rb

SignaturesController#none

Total Score: 27.2

Score Operator
2.0 include
12.0 before_action
4.3 branch
2.0 rescue_from
1.2 assignment
1.2 find_duplicate!
1.2 delete_form_request
1.2 send_email_to_petition_signer
1.4 thank_you_url
1.2 redirect_to
1.1 respond_to
1.2 html
1.3 render
1.0 private

SignaturesController#build_signature

Total Score: 9.9

Score Operator
1.0 branch
1.2 action_name
1.0 ==
2.2 assignment
2.6 signatures
1.3 signature_params_for_new
2.2 build
1.3 signature_params_for_create

SignaturesController#signature_params_for_create

Total Score: 8.4

Score Operator
1.2 signature_params
1.4 request
1.2 remote_ip
1.2 form_token
1.2 form_requested_at
1.2 image_loaded_at
1.0 merge

SignaturesController#expired_form_requests

Total Score: 8.2

Score Operator
2.1 branch
1.2 form_requests
1.0 each_with_object
3.3 assignment
1.3 form_request_max_age
1.1 form_request_expired?
1.4 []
1.2 <<

SignaturesController#expire_form_requests

Total Score: 7.5

Score Operator
1.0 branch
1.2 expired_form_requests
1.0 each
1.4 cookies
2.4 delete
1.4 form_requests

SignaturesController#verify_unsubscribe_token

Total Score: 7.4

Score Operator
1.0 branch
1.2 unsubscribe_token
2.7 token_param
1.0 ==
1.3 inspect
1.1 raise

SignaturesController#verify_token

Total Score: 7.4

Score Operator
1.0 branch
1.2 perishable_token
2.7 token_param
1.0 ==
1.3 inspect
1.1 raise

SignaturesController#form_request_max_age

Total Score: 7.1

Score Operator
1.4 last_form_request_timestamp
0.5 lit_fixnum
1.6 day
1.4 ago
1.2 compact
1.0 max

SignaturesController#retrieve_signature

Total Score: 7.0

Score Operator
2.0 assignment
2.5 signature_id
1.0 find
1.0 petition
1.0 branch
1.0 visible?
1.1 raise

SignaturesController#delete_form_request

Total Score: 6.8

Score Operator
1.2 cookies
1.2 form_token
2.0 delete
1.2 form_requests
1.2 form_request_id

SignaturesController#verify

Total Score: 6.7

Score Operator
1.0 branch
1.0 validated?
1.3 request
1.1 validate!
1.0 store_signed_token_in_session
1.2 signed_signature_url
1.0 redirect_to

SignaturesController#form_request_expired?

Total Score: 6.2

Score Operator
1.0 assignment
0.4 lit_fixnum
1.2 day
1.0 ago
1.4 []
1.2 in_time_zone
1.0 <

SignaturesController#create

Total Score: 6.1

Score Operator
1.0 branch
1.0 save!
1.2 delete_form_request
1.2 send_email_to_petition_signer
1.4 thank_you_url
1.2 redirect_to

SignaturesController#verify_signed_token

Total Score: 5.9

Score Operator
1.0 branch
1.2 signed_token
1.2 session_signed_token
1.0 ==
1.3 signed_token_failure_url
1.1 redirect_to

SignaturesController#confirm

Total Score: 5.9

Score Operator
3.5 branch
1.0 respond_to
1.1 html
1.4 valid?
1.2 render

SignaturesController#token_param

Total Score: 5.3

Score Operator
1.0 assignment
1.6 params
1.4 []
1.2 to_s
1.0 encode

SignaturesController#send_email_to_petition_signer

Total Score: 5.0

Score Operator
2.1 branch
1.0 email_threshold_reached?
1.1 pending?
2.4 perform_later

SignaturesController#form_request_timestamps

Total Score: 4.8

Score Operator
1.0 assignment
1.0 branch
1.2 form_requests
1.0 map
1.3 []
1.1 in_time_zone

SignaturesController#signature_params

Total Score: 4.8

Score Operator
1.4 params
1.2 require
1.2 signature_attributes
1.0 permit

SignaturesController#session_signed_token

Total Score: 4.8

Score Operator
1.2 signed_tokens
1.4 signature_id
1.2 to_s
1.0 delete

SignaturesController#signed

Total Score: 4.7

Score Operator
2.0 branch
1.0 seen_signed_confirmation_page?
1.1 mark_seen_signed_confirmation_page!
1.0 respond_to
1.1 html

SignaturesController#store_signed_token_in_session

Total Score: 4.5

Score Operator
1.0 assignment
1.0 session
1.2 signed_tokens
1.2 signed_token_hash
1.0 merge

SignaturesController#unsubscribe

Total Score: 4.4

Score Operator
1.2 token_param
1.0 unsubscribe!
1.0 branch
1.0 respond_to
1.1 html

SignaturesController#last_form_request_timestamp

Total Score: 3.9

Score Operator
1.4 form_request_timestamps
1.2 sort
0.3 lit_fixnum
1.0 []

SignaturesController#signature_id

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 Integer

SignaturesController#petition_id

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 Integer

SignaturesController#redirect_to_petition_page_if_rejected

Total Score: 3.5

Score Operator
1.0 branch
1.0 rejected?
1.3 petition_url
1.1 redirect_to

SignaturesController#retrieve_petition

Total Score: 3.5

Score Operator
1.0 assignment
1.2 visible
1.2 petition_id
1.0 find

SignaturesController#redirect_to_petition_page_if_closed_for_signing

Total Score: 3.5

Score Operator
1.0 branch
1.0 closed_for_signing?
1.3 petition_url
1.1 redirect_to

SignaturesController#redirect_to_petition_page_if_closed

Total Score: 3.5

Score Operator
1.0 branch
1.0 closed?
1.3 petition_url
1.1 redirect_to

SignaturesController#expire_signed_tokens

Total Score: 3.4

Score Operator
1.0 branch
1.2 signed_tokens
1.0 delete_if
1.1 validated?

SignaturesController#signed_token_hash

Total Score: 3.2

Score Operator
1.2 signature_id
1.0 to_s
1.0 signed_token

SignaturesController#signed_tokens

Total Score: 2.8

Score Operator
1.0 assignment
1.0 branch
1.3 session
1.1 []

SignaturesController#thank_you

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

SignaturesController#new

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

SignaturesController#signature_params_for_new

Total Score: 2.0

Score Operator
1.0 form_token
1.0 form_requested_at

SignaturesController#thank_you_url

Total Score: 1.0

Score Operator
1.0 thank_you_petition_signatures_url

SignaturesController#signed_token_failure_url

Total Score: 1.0

Score Operator
1.0 petition_url

app/models/archived/signature.rb

Archived::Signature#none

Total Score: 26.9

Score Operator
2.2 include
3.3 belongs_to
0.7 lit_fixnum
5.5 validates
1.1 attr_readonly
1.1 branch
1.1 before_destroy
1.4 creator?
1.2 !
2.7 private
5.5 sclass
2.2 alias_method

Archived::Signature#unsubscribe!

Total Score: 10.7

Score Operator
2.3 branch
1.1 unsubscribed?
2.9 errors
2.5 add
1.4 unsubscribe_token
1.2 !=
1.3 update

Archived::Signature#formatted_postcode

Total Score: 5.0

Score Operator
1.1 branch
1.1 united_kingdom?
2.6 postcode
1.2 gsub

Archived::Signature#location

Total Score: 4.8

Score Operator
1.1 branch
1.1 postcode?
1.2 formatted_postcode
2.4 location_code

Archived::Signature#domain

Total Score: 4.3

Score Operator
1.1 branch
1.6 email
1.4 new
1.2 domain

Archived::Signature#account

Total Score: 4.3

Score Operator
1.1 branch
1.6 email
1.4 new
1.2 local

Archived::Signature#subscribed?

Total Score: 4.0

Score Operator
1.1 branch
1.2 validated?
1.4 unsubscribed?
1.2 !

Archived::Signature#invalid_unsubscribe_token?

Total Score: 3.9

Score Operator
1.5 errors
1.3 []
1.1 include?

Archived::Signature#already_unsubscribed?

Total Score: 3.9

Score Operator
1.5 errors
1.3 []
1.1 include?

Archived::Signature#set_email_sent_at_for

Total Score: 3.5

Score Operator
1.1 current
1.3 column_name_for
1.1 update_column

Archived::Signature#validated?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Archived::Signature#invalidated?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Archived::Signature#column_name_for

Total Score: 2.4

Score Operator
1.3 class
1.1 column_name_for

Archived::Signature#united_kingdom?

Total Score: 2.4

Score Operator
1.3 location_code
1.1 ==

Archived::Signature#unsubscribed?

Total Score: 2.4

Score Operator
1.3 notify_by_email
1.1 ==

Archived::Signature#fraudulent?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Archived::Signature#pending?

Total Score: 2.4

Score Operator
1.3 state
1.1 ==

Archived::Signature#get_email_sent_at_for

Total Score: 2.4

Score Operator
1.3 column_name_for
1.1 []

app/models/petition.rb

Petition::in_moderation

Total Score: 26.8

Score Operator
6.7 branch
13.3 where
6.6 moderation_threshold_reached_at
1.9 between
2.0 gt
2.1 lt

app/models/parliament.rb

Parliament#none

Total Score: 26.1

Score Operator
2.2 include
2.9 lit_fixnum
1.1 civil
1.1 has_many
5.5 sclass
3.3 validates_presence_of
4.4 validates_length_of
3.3 validates_numericality_of
1.1 branch
1.1 after_save
1.2 touch

Parliament#schedule_closure!

Total Score: 9.7

Score Operator
2.2 branch
1.2 dissolution_announced?
1.4 dissolved?
1.2 !
3.0 dissolution_at
2.6 schedule_for

Parliament#period

Total Score: 7.9

Score Operator
2.2 branch
1.2 opening_at?
1.2 dissolution_at?
1.4 opening_at
2.4 year
1.4 dissolution_at

Parliament#can_archive_petitions?

Total Score: 7.2

Score Operator
2.3 branch
1.2 dissolved?
1.5 archiving_finished?
2.6 !
1.5 archiving?

Parliament#start_archiving!

Total Score: 6.6

Score Operator
1.1 assignment
1.1 current
2.2 branch
1.2 archiving?
1.2 archiving_finished?
1.3 perform_later
1.3 update_column

Parliament#notify_creators!

Total Score: 5.5

Score Operator
2.2 branch
1.2 dissolution_announced?
1.4 dissolved?
1.2 !
1.2 perform_later

Parliament#registration_closed?

Total Score: 5.1

Score Operator
1.1 assignment
1.1 current
1.1 branch
1.2 registration_closed_at?
1.4 registration_closed_at
1.2 <=

Parliament#archived?

Total Score: 5.1

Score Operator
1.1 assignment
1.1 current
1.1 branch
1.2 archived_at?
1.4 archived_at
1.2 <=

Parliament#dissolved?

Total Score: 5.1

Score Operator
1.1 assignment
1.1 current
1.1 branch
1.2 dissolution_at?
1.4 dissolution_at
1.2 <=

Parliament#opened?

Total Score: 5.1

Score Operator
1.1 assignment
1.1 current
1.1 branch
1.2 opening_at?
1.4 opening_at
1.2 <=

Parliament#archive!

Total Score: 5.0

Score Operator
1.1 assignment
1.1 current
1.1 branch
1.1 archiving_finished?
1.3 perform_later
1.3 update_column

Parliament#archiving?

Total Score: 4.0

Score Operator
1.1 branch
1.2 archiving_started_at?
1.4 archiving_finished?
1.2 !

Parliament#archiving_finished?

Total Score: 4.0

Score Operator
1.1 branch
1.2 archiving_started_at?
1.4 unarchived
1.2 empty?

Parliament#can_archive?

Total Score: 2.6

Score Operator
1.1 branch
1.2 dissolved?
1.2 archiving_finished?

Parliament#show_on_a_map?

Total Score: 2.4

Score Operator
1.3 opening_at
1.1 >

Parliament#formatted_threshold_for_debate

Total Score: 2.4

Score Operator
1.3 threshold_for_debate
1.1 number_to_delimited

Parliament#period?

Total Score: 2.4

Score Operator
1.3 period
1.1 present?

Parliament#formatted_threshold_for_response

Total Score: 2.4

Score Operator
1.3 threshold_for_response
1.1 number_to_delimited

Parliament#name

Total Score: 2.2

Score Operator
1.1 period
1.1 government

Parliament#dissolution_announced?

Total Score: 1.1

Score Operator
1.1 dissolution_at?

app/models/petition.rb

Petition::trending

Total Score: 26.1

Score Operator
3.2 assignment
0.9 lit_fixnum
1.8 hour
1.6 ago
3.2 select
3.0 joins
10.0 where
2.0 group
1.8 order
1.6 limit

app/lib/email_reminder.rb

EmailReminder::threshold_email_reminder

Total Score: 26.0

Score Operator
5.2 branch
3.7 assignment
1.2 by_role
2.6 any?
1.8 threshold
1.6 where
1.4 order
3.1 logger
1.6 info
1.8 threshold_email_reminder
1.6 deliver_now
1.6 each
1.7 update_attribute
1.5 class
1.3 name
1.3 message
1.1 error

app/models/constituency.rb

Constituency#refresh!

Total Score: 24.8

Score Operator
4.8 branch
1.1 example_postcode?
6.4 assignment
1.3 query
1.3 example_postcode
1.1 fetch
1.1 first
1.1 nil?
1.4 empty_results_exception
2.5 raise
1.4 external_id
5.6 []
1.2 !=
1.5 mismatched_results_exception
1.4 changed?
1.5 save!

Constituency#none

Total Score: 17.8

Score Operator
2.2 has_many
1.3 lit_fixnum
6.6 validates
1.1 delegate
5.5 sclass
1.1 private

Constituency#mismatched_results_exception

Total Score: 8.6

Score Operator
1.7 example_postcode
1.5 inspect
1.5 external_id
1.5 []
1.3 squish
1.1 new

Constituency#empty_results_exception

Total Score: 5.6

Score Operator
1.7 example_postcode
1.5 inspect
1.3 squish
1.1 new

Constituency#mp_url

Total Score: 3.5

Score Operator
1.3 mp_name
1.1 parameterize
1.1 mp_id

Constituency#to_param

Total Score: 1.1

Score Operator
1.1 slug

Constituency#sitting_mp?

Total Score: 1.1

Score Operator
1.1 mp_id?

app/models/petition.rb

Petition::popular_in

Total Score: 24.5

Score Operator
4.8 assignment
4.6 arel_table
4.2 []
1.6 as
1.8 with_signatures_for
1.6 ordered
2.6 star
2.2 select
2.0 joins
1.8 merge
1.6 limit

TrendingIpsByPetitionJob#perform

Total Score: 23.6

Score Operator
5.3 assignment
1.0 current
9.0 branch
1.0 enable_logging_of_trending_items?
3.0 trending_ips
2.2 each
1.2 find
1.4 present?
1.4 ignore_ip?
1.8 starts_at
1.6 log!
1.8 threshold_for_notifying_trending_items
1.6 >=
1.7 perform_later
1.5 send_exception

TrendingIpsByPetitionJob#none

Total Score: 7.0

Score Operator
6.0 delegate
1.0 private

TrendingIpsByPetitionJob#trending_ips

Total Score: 4.6

Score Operator
1.2 window
1.2 threshold_for_logging_trending_items
1.2 ignored_domains_list
1.0 trending_ips_by_petition

TrendingIpsByPetitionJob#starts_at

Total Score: 2.4

Score Operator
1.0 assignment
1.2 ends_at
1.0 advance

TrendingIpsByPetitionJob#petitions

Total Score: 2.2

Score Operator
1.2 petition_ids
1.0 where

TrendingIpsByPetitionJob#window

Total Score: 2.0

Score Operator
1.0 starts_at
1.0 ends_at

TrendingIpsByPetitionJob#ends_at

Total Score: 1.4

Score Operator
1.0 assignment
1.0 at_beginning_of_hour

TrendingIpsByPetitionJob#rate_limit

Total Score: 1.4

Score Operator
1.0 assignment
1.0 first_or_create!

TrendingDomainsByPetitionJob#perform

Total Score: 23.6

Score Operator
5.3 assignment
1.0 current
9.0 branch
1.0 enable_logging_of_trending_items?
3.0 trending_domains
2.2 each
1.2 find
1.4 present?
1.4 ignore_domain?
1.8 starts_at
1.6 log!
1.8 threshold_for_notifying_trending_items
1.6 >=
1.7 perform_later
1.5 send_exception

TrendingDomainsByPetitionJob#none

Total Score: 6.0

Score Operator
5.0 delegate
1.0 private

TrendingDomainsByPetitionJob#trending_domains

Total Score: 3.4

Score Operator
1.2 window
1.2 threshold_for_logging_trending_items
1.0 trending_domains_by_petition

TrendingDomainsByPetitionJob#starts_at

Total Score: 2.4

Score Operator
1.0 assignment
1.2 ends_at
1.0 advance

TrendingDomainsByPetitionJob#petitions

Total Score: 2.2

Score Operator
1.2 petition_ids
1.0 where

TrendingDomainsByPetitionJob#window

Total Score: 2.0

Score Operator
1.0 starts_at
1.0 ends_at

TrendingDomainsByPetitionJob#rate_limit

Total Score: 1.4

Score Operator
1.0 assignment
1.0 first_or_create!

TrendingDomainsByPetitionJob#ends_at

Total Score: 1.4

Score Operator
1.0 assignment
1.0 at_beginning_of_hour

app/lib/admin/task_runner.rb

Admin::TaskRunner#none

Total Score: 23.6

Score Operator
6.1 branch
1.0 lambda
1.2 []
5.5 assignment
1.4 lit_fixnum
1.6 week
4.2 ago
1.6 month
1.6 months
1.4 try
1.2 perform_later
1.0 attr_reader
5.0 sclass
1.0 private

Admin::TaskRunner#tasks

Total Score: 6.4

Score Operator
1.0 branch
1.6 params
1.4 []
1.2 Array
1.0 select
1.1 key?

Admin::TaskRunner#run_task

Total Score: 4.8

Score Operator
2.4 []
1.4 params
1.0 call

Admin::TaskRunner#run

Total Score: 3.4

Score Operator
1.0 branch
1.2 tasks
1.0 each
1.1 run_task

Admin::TaskRunner#initialize

Total Score: 1.0

Score Operator
1.0 assignment

app/models/signature_logs.rb

SignatureLogs#fetch_validate_events

Total Score: 23.5

Score Operator
3.7 branch
4.7 validated_at
2.6 validated_ip
2.5 assignment
1.3 log_group_name
1.0 lit_fixnum
3.4 minutes
1.5 -
2.6 ms
1.5 +
1.7 client
1.5 filter_log_events
1.3 events

SignatureLogs#fetch_create_events

Total Score: 20.6

Score Operator
1.1 branch
2.5 assignment
1.3 log_group_name
3.4 created_at
1.0 lit_fixnum
3.4 minutes
1.5 -
2.6 ms
1.5 +
1.3 ip_address
1.7 client
1.5 filter_log_events
1.3 events

SignatureLogs#fetch_combined_events

Total Score: 20.6

Score Operator
1.1 branch
2.5 assignment
1.3 log_group_name
1.7 created_at
1.0 lit_fixnum
3.4 minutes
1.5 -
2.6 ms
1.7 validated_at
1.5 +
1.3 ip_address
1.7 client
1.5 filter_log_events
1.3 events

SignatureLogs#overlapping?

Total Score: 16.8

Score Operator
3.3 branch
2.6 validated_at
2.4 validated_ip
1.3 ip_address
1.1 ==
1.5 created_at
0.9 lit_fixnum
3.0 minutes
1.3 +
1.3 -
1.1 >=

SignatureLogs#none

Total Score: 15.4

Score Operator
2.2 include
1.1 attr_reader
5.5 delegate
5.5 sclass
1.1 private

SignatureLogs#logs

Total Score: 14.7

Score Operator
1.1 assignment
1.5 branch
1.7 fetch_events
1.5 map
1.8 message
1.6 new
2.8 block_pass
2.8 to_proc_normal
1.3 reject
1.1 sort_by

SignatureLogs#fetch_events

Total Score: 6.4

Score Operator
1.1 branch
1.1 overlapping?
1.2 fetch_combined_events
1.4 fetch_create_events
1.4 fetch_validate_events
1.2 +

SignatureLogs#ms

Total Score: 4.3

Score Operator
1.5 to_f
0.4 lit_fixnum
1.3 *
1.1 to_i

SignatureLogs#each

Total Score: 3.8

Score Operator
1.1 branch
1.3 logs
1.1 each
1.2 yield

SignatureLogs#client

Total Score: 1.6

Score Operator
1.1 assignment
1.1 new

SignatureLogs#initialize

Total Score: 1.6

Score Operator
1.1 assignment
1.1 find

SignatureLogs#log_group_name

Total Score: 1.1

Score Operator
1.1 fetch

app/models/tag.rb

Tag#none

Total Score: 23.4

Score Operator
1.3 Searchable
2.2 extend
2.2 include
1.1 validates_presence_of
1.1 validates_uniqueness_of
0.7 lit_fixnum
2.2 validates_length_of
1.3 branch
1.3 lambda
1.4 by_name
1.1 facet
2.2 after_destroy
5.5 sclass
1.1 private

Tag#remove_tag_from_archived_petitions

Total Score: 5.2

Score Operator
2.8 id
1.3 tagged_with
1.1 update_all

Tag#remove_tag_from_petitions

Total Score: 5.2

Score Operator
2.8 id
1.3 tagged_with
1.1 update_all

app/presenters/petitions_csv_presenter.rb

PetitionsCSVPresenter#render

Total Score: 23.3

Score Operator
2.4 branch
4.6 new
6.2 presenter_class
3.8 fields
1.5 to_s
2.7 <<
1.5 petitions
1.3 in_batches
1.6 to_csv

PetitionsCSVPresenter#initialize

Total Score: 3.3

Score Operator
3.3 assignment

PetitionsCSVPresenter#none

Total Score: 1.1

Score Operator
1.1 attr_reader

app/controllers/admin/petitions_controller.rb

Admin::PetitionsController#scope

Total Score: 23.2

Score Operator
3.3 branch
7.9 params
6.9 []
2.2 ==
1.1 untagged
1.1 present?
1.3 tagged_with_all
1.3 tagged_with_any
1.2 all

Admin::PetitionsController#none

Total Score: 10.2

Score Operator
3.0 before_action
1.0 branch
1.0 rescue_from
1.3 admin_root_url
1.5 params
1.3 []
1.1 redirect_to
1.0 protected

Admin::PetitionsController#redirect_to_show_page

Total Score: 7.0

Score Operator
1.8 params
1.6 []
1.4 to_i
1.2 admin_petition_url
1.0 redirect_to

Admin::PetitionsController#csv_filename

Total Score: 5.8

Score Operator
1.4 scope
2.2 to_s
1.0 dasherize
1.2 current

Admin::PetitionsController#index

Total Score: 5.2

Score Operator
2.2 branch
1.0 respond_to
1.2 html
1.2 csv
1.3 render_csv

Admin::PetitionsController#resend

Total Score: 4.4

Score Operator
1.2 feedback_email
1.0 perform_later
1.2 admin_petition_url
1.0 redirect_to

Admin::PetitionsController#render_csv

Total Score: 4.3

Score Operator
1.0 set_file_headers
1.0 set_streaming_headers
1.0 assignment
1.2 new
1.0 render

Admin::PetitionsController#set_streaming_headers

Total Score: 4.3

Score Operator
1.0 assignment
3.2 headers
1.0 delete

Admin::PetitionsController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::PetitionsController#set_file_headers

Total Score: 3.6

Score Operator
2.0 assignment
2.0 headers
1.0 csv_filename

Admin::PetitionsController#petition_id?

Total Score: 3.6

Score Operator
1.4 params
1.2 []
1.0 to_s

Admin::PetitionsController#fetch_petitions

Total Score: 3.5

Score Operator
1.0 assignment
1.2 scope
1.2 params
1.0 search

Admin::PetitionsController#show

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

app/helpers/application_helper.rb

ApplicationHelper#referer_url

Total Score: 22.1

Score Operator
3.7 branch
2.5 assignment
5.1 request
2.9 referer
1.3 parse
1.3 all?
9.6 send
1.4 ==

ApplicationHelper#create_petition_page?

Total Score: 8.5

Score Operator
1.1 branch
3.2 params
2.8 []
1.2 ==
1.2 in?

ApplicationHelper#archived_petition_page?

Total Score: 8.5

Score Operator
1.1 branch
3.2 params
2.8 []
2.4 ==

ApplicationHelper#noindex_page?

Total Score: 5.6

Score Operator
1.7 params
1.5 values_at
1.3 in?
1.1 !

ApplicationHelper#home_page?

Total Score: 3.9

Score Operator
1.5 params
1.3 values_at
1.1 ==

ApplicationHelper#petition_page?

Total Score: 3.9

Score Operator
1.5 params
1.3 values_at
1.1 ==

ApplicationHelper#original_url

Total Score: 3.9

Score Operator
1.5 request
1.3 original_url
1.1 force_encoding

ApplicationHelper#increment

Total Score: 3.6

Score Operator
3.3 assignment
0.3 lit_fixnum
1.1 +

ApplicationHelper#open_petition_page?

Total Score: 2.6

Score Operator
1.1 branch
1.2 petition_page?
1.2 open?

ApplicationHelper#back_url

Total Score: 1.6

Score Operator
1.1 branch
1.2 referer_url

ApplicationHelper#none

Total Score: 1.1

Score Operator
1.1 private

app/helpers/form_helper.rb

FormHelper#form_row

Total Score: 21.8

Score Operator
2.0 assignment
3.0 branch
11.5 []
2.2 push
1.5 errors
0.4 lit_fixnum
1.1 any?
1.4 block_pass
1.2 capture
1.2 join
1.0 content_tag

FormHelper#error_messages_for_field

Total Score: 8.1

Score Operator
2.0 assignment
2.0 branch
1.5 errors
1.3 []
1.1 presence
1.3 first
1.3 merge
1.1 content_tag

FormHelper#countries_for_select

Total Score: 1.0

Score Operator
1.0 menu

app/lib/email_reminder.rb

EmailReminder::special_resend_of_signature_email_validation

Total Score: 21.6

Score Operator
4.0 assignment
3.0 where
1.1 lit_fixnum
1.2 new
1.2 to_date
2.2 branch
1.0 find_each
1.5 special_resend_of_email_confirmation_for_signer
1.3 deliver_now
2.9 logger
2.9 email
1.3 warn
1.4 current
1.2 update_attribute
1.2 info

app/controllers/admin/searches_controller.rb

Admin::SearchesController#search_params

Total Score: 21.5

Score Operator
4.4 branch
1.0 petition_search?
8.9 params
2.7 []
1.1 ==
5.0 slice
1.2 present?
1.1 signature_search?

Admin::SearchesController#show

Total Score: 13.0

Score Operator
2.1 branch
1.0 petition_search?
3.1 search_params
1.3 admin_petitions_url
3.5 redirect_to
1.1 signature_search?
1.4 admin_signatures_url
1.4 admin_root_url

Admin::SearchesController#signature_search?

Total Score: 3.6

Score Operator
1.4 params
1.2 []
1.0 ==

Admin::SearchesController#petition_search?

Total Score: 3.6

Score Operator
1.4 params
1.2 []
1.0 ==

Admin::SearchesController#none

Total Score: 1.0

Score Operator
1.0 private

app/jobs/backfill_constituencies_job.rb

BackfillConstituenciesJob#perform

Total Score: 21.2

Score Operator
5.4 branch
1.0 disable_constituency_api?
4.2 assignment
2.3 try
1.2 signatures_missing_constituency_id
1.0 to_a
1.4 block_pass
1.4 to_proc_normal
1.2 map
1.0 max
1.0 each
1.2 constituency_id?
1.2 constituency
1.5 external_id
1.3 update_column
1.0 reschedule?
1.3 class
1.1 perform_later

BackfillConstituenciesJob#reschedule?

Total Score: 2.2

Score Operator
1.2 signatures_missing_constituency_id
1.0 exists?

BackfillConstituenciesJob#signatures_missing_constituency_id

Total Score: 2.2

Score Operator
1.2 missing_constituency_id
1.0 batch

BackfillConstituenciesJob#none

Total Score: 2.0

Score Operator
1.0 queue_as
1.0 private

app/controllers/application_controller.rb

ApplicationController#url_without_format

Total Score: 21.1

Score Operator
2.3 branch
5.9 request
1.7 original_url
1.5 parse
1.3 tap
2.5 assignment
3.6 path
1.6 dirname
1.6 basename
1.4 join
1.1 to_s
1.1 home_url

ApplicationController#none

Total Score: 10.0

Score Operator
1.0 protect_from_forgery
6.0 before_action
1.0 helper_method
1.0 hide_action
1.0 protected

ApplicationController#csv_request?

Total Score: 5.2

Score Operator
1.6 request
1.4 format
1.2 symbol
1.0 ==

ApplicationController#json_request?

Total Score: 5.2

Score Operator
1.6 request
1.4 format
1.2 symbol
1.0 ==

ApplicationController#set_cors_headers

Total Score: 4.2

Score Operator
3.0 assignment
3.0 headers

ApplicationController#show_cookie_message?

Total Score: 3.7

Score Operator
1.0 assignment
1.4 cookies
1.2 []
1.0 !=

ApplicationController#set_seen_cookie_message

Total Score: 3.7

Score Operator
1.0 assignment
1.0 cookies
0.4 lit_fixnum
1.2 year
1.0 from_now

ApplicationController#current_time

Total Score: 3.6

Score Operator
1.4 current
1.2 getutc
1.0 iso8601

ApplicationController#unknown_format?

Total Score: 3.6

Score Operator
1.4 request
1.2 format
1.0 nil?

ApplicationController#site_protected?

Total Score: 3.4

Score Operator
1.0 branch
1.2 request
1.0 local?
1.1 protected?

ApplicationController#authenticate

Total Score: 3.4

Score Operator
1.0 branch
1.2 name
1.0 authenticate_or_request_with_http_basic
1.1 authenticate

ApplicationController#do_not_cache

Total Score: 2.4

Score Operator
1.0 assignment
1.2 response
1.0 headers

ApplicationController#redirect_to_home_page

Total Score: 2.2

Score Operator
1.2 home_url
1.0 redirect_to

ApplicationController#redirect_to_url_without_format

Total Score: 2.2

Score Operator
1.2 url_without_format
1.0 redirect_to

ApplicationController#reload_site

Total Score: 1.0

Score Operator
1.0 reload

ApplicationController#reload_parliament

Total Score: 1.0

Score Operator
1.0 reload

ApplicationController#service_unavailable

Total Score: 1.0

Score Operator
1.0 raise

ApplicationController#site_enabled?

Total Score: 1.0

Score Operator
1.0 enabled?

ApplicationController#parliament_dissolved?

Total Score: 1.0

Score Operator
1.0 dissolved?

ApplicationController#public_petition_facets

Total Score: 1.0

Score Operator
1.0 t

app/models/statistics.rb

Statistics::moderation

Total Score: 20.9

Score Operator
9.2 branch
9.2 assignment
1.5 in?
1.8 inspect
1.6 raise
4.6 <<
1.8 id
1.9 join
1.7 strip_heredoc
1.5 select_rows

app/controllers/concerns/flash_render.rb

FlashRender#render

Total Score: 19.6

Score Operator
7.5 assignment
5.2 branch
1.0 ===
1.4 class
1.2 _flash_types
2.1 each
2.1 delete
2.8 flash
2.4 now
2.4 translate_flash
1.0 super
1.0 block_pass

FlashRender#none

Total Score: 4.0

Score Operator
2.0 extend
2.0 include

app/models/signature.rb

Signature::before_create#if

Total Score: 19.2

Score Operator
1.1 before_create
2.4 assignment
1.2 generate_uuid
4.4 email
1.2 normalize
2.4 branch
1.2 find_duplicate
3.0 name
3.0 postcode
2.6 raise
1.2 find_similar

app/helpers/search_helper.rb

SearchHelper#paginate

Total Score: 19.1

Score Operator
1.0 assignment
1.0 previous_page
1.0 next_page
1.0 total_pages
2.4 model
1.2 previous_params
2.0 polymorphic_path
1.2 next_params
3.4 branch
1.0 capture
1.2 first_page?
3.0 t
2.6 concat
1.2 last_page?

SearchHelper#filtered_petition_count

Total Score: 4.6

Score Operator
2.0 assignment
1.0 total_entries
1.0 branch
1.0 search?
1.0 number_with_delimiter
1.0 pluralize

SearchHelper#petition_result_path

Total Score: 3.5

Score Operator
1.0 assignment
1.0 branch
1.0 is_a?
1.1 archived_petition_path
1.1 petition_path

app/helpers/archived_petition_helper.rb

ArchivedPetitionHelper#petition_duration_to_words

Total Score: 19.1

Score Operator
1.0 assignment
1.0 to_d
3.3 branch
3.9 frac
1.0 zero?
4.3 floor
4.9 pluralize
1.1 >
1.4 ceil
1.2 <

ArchivedPetitionHelper#archived_threshold_percentage

Total Score: 9.5

Score Operator
3.0 assignment
1.0 archived_threshold
1.4 signature_count
1.2 Rational
1.3 lit_fixnum
1.0 *
1.2 max
1.0 min
1.0 number_to_percentage

ArchivedPetitionHelper#archived_threshold

Total Score: 4.8

Score Operator
2.0 branch
1.1 threshold_for_response_reached?
1.1 government_response?
1.1 threshold_for_debate
1.1 threshold_for_response

ArchivedPetitionHelper#archived_petition_facets_with_counts

Total Score: 3.4

Score Operator
1.2 facets
1.2 archived_petition_facets
1.0 slice

ArchivedPetitionHelper#archived_parliaments

Total Score: 1.4

Score Operator
1.0 assignment
1.0 archived

app/models/constituency.rb

Constituency::find_by_postcode

Total Score: 18.8

Score Operator
6.8 branch
1.6 disable_constituency_api?
6.8 assignment
1.8 query
1.6 fetch
1.6 first
2.0 []
1.8 find_or_initialize_by
1.9 changed?
1.9 new_record?
1.9 save!

app/models/archived/rejection.rb

Archived::Rejection#none

Total Score: 18.7

Score Operator
1.1 belongs_to
3.3 validates
0.3 lit_fixnum
2.3 branch
1.1 after_create
4.4 petition
1.2 rejected_at?
3.0 state_for_petition
2.6 update!
1.5 current

Archived::Rejection#hide_petition?

Total Score: 2.4

Score Operator
1.3 code
1.1 in?

Archived::Rejection#state_for_petition

Total Score: 1.6

Score Operator
1.1 branch
1.1 hide_petition?

ApiPaginationLinksPresenter#prev_url

Total Score: 18.3

Score Operator
3.0 branch
1.0 second_page?
1.1 first_url
1.4 results
4.1 current_page
1.2 total_pages
2.0 >
1.1 last_url
0.7 lit_fixnum
1.5 url_params
1.5 -
1.3 merge
1.1 url_for

ApiPaginationLinksPresenter#next_url

Total Score: 9.8

Score Operator
1.0 branch
1.2 results
1.0 last_page?
1.5 url_params
1.7 current_page
0.4 lit_fixnum
1.5 +
1.3 merge
1.1 url_for

ApiPaginationLinksPresenter#none

Total Score: 9.2

Score Operator
1.6 application
1.4 routes
1.2 url_helpers
2.0 include
1.0 private
1.0 attr_reader
1.0 delegate

ApiPaginationLinksPresenter#last_url

Total Score: 9.1

Score Operator
1.0 branch
2.7 total_pages
0.3 lit_fixnum
1.0 ==
1.1 first_url
1.5 url_params
1.3 merge
1.1 url_for

ApiPaginationLinksPresenter#current_page

Total Score: 6.2

Score Operator
2.8 results
1.2 current_page
1.2 total_pages
1.0 min

ApiPaginationLinksPresenter#serialize

Total Score: 4.0

Score Operator
1.0 first_url
1.0 last_url
1.0 next_url
1.0 prev_url

ApiPaginationLinksPresenter#url_params

Total Score: 3.4

Score Operator
1.2 params
1.2 api_links_allowed_components
1.0 slice

ApiPaginationLinksPresenter#initialize

Total Score: 3.0

Score Operator
3.0 assignment

ApiPaginationLinksPresenter#first_url

Total Score: 2.2

Score Operator
1.2 url_params
1.0 url_for

app/jobs/concerns/rate_limiting.rb

RateLimiting#perform

Total Score: 18.2

Score Operator
2.0 branch
1.2 rate_limit
1.0 exceeded?
1.1 fraudulent!
1.4 mailer
1.4 email
3.6 send
1.0 deliver_now
5.2 assignment
2.2 <<
1.0 constituency
1.2 external_id
1.2 join
1.0 update_all

RateLimiting#none

Total Score: 6.6

Score Operator
2.0 extend
2.1 branch
1.0 included
1.1 rescue_from
1.2 send_exception
1.0 private

RateLimiting#rate_limit

Total Score: 1.4

Score Operator
1.0 assignment
1.0 first_or_create!

app/models/concerns/taggable.rb

Taggable#normalize_tags

Total Score: 17.7

Score Operator
2.1 Array
1.9 flatten
3.4 block_pass
3.4 to_proc_normal
1.7 map
1.5 compact
1.3 reject
1.3 class
1.1 normalize_tags

Taggable#none

Total Score: 8.5

Score Operator
2.2 extend
2.2 branch
1.1 included
1.2 validate
1.1 class_methods
2.6 alias_method

Taggable#tags_exist

Total Score: 6.6

Score Operator
2.2 branch
1.3 tags
1.1 all?
1.2 exists?
1.4 errors
1.2 add

Taggable#tagged_with_all

Total Score: 6.2

Score Operator
1.7 tags_column
1.7 normalize_tags
1.5 contains
1.3 where

Taggable#tagged_with_any

Total Score: 6.2

Score Operator
1.7 tags_column
1.7 normalize_tags
1.5 overlaps
1.3 where

Taggable#untagged

Total Score: 4.5

Score Operator
1.7 tags_column
1.5 eq
1.3 where

Taggable#tagged

Total Score: 4.5

Score Operator
1.7 tags_column
1.5 not_eq
1.3 where

Taggable#tag_names

Total Score: 3.9

Score Operator
1.5 tags
1.3 where
1.1 pluck

Taggable#tags_column

Total Score: 2.8

Score Operator
1.5 arel_table
1.3 []

Taggable#tags=

Total Score: 2.2

Score Operator
1.1 super
1.1 normalize_tags

app/jobs/backfill_canonical_emails_job.rb

BackfillCanonicalEmailsJob#perform

Total Score: 17.5

Score Operator
3.0 assignment
1.4 where
1.2 batch
1.0 to_a
1.4 block_pass
1.4 to_proc_normal
1.2 map
1.0 max
4.4 branch
1.0 each
1.2 canonical_email?
1.2 email?
1.3 update_canonical_email
1.0 exists?
1.3 class
1.1 perform_later

BackfillCanonicalEmailsJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

app/jobs/backfill_signature_uuids_job.rb

BackfillSignatureUuidsJob#perform

Total Score: 17.5

Score Operator
3.0 assignment
1.4 where
1.2 batch
1.0 to_a
1.4 block_pass
1.4 to_proc_normal
1.2 map
1.0 max
4.4 branch
1.0 each
1.2 uuid?
1.2 email?
1.3 update_uuid
1.0 exists?
1.3 class
1.1 perform_later

BackfillSignatureUuidsJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

app/controllers/concerns/bulk_verification.rb

BulkVerification#selected_ids

Total Score: 17.5

Score Operator
1.0 assignment
2.2 params
2.0 []
1.8 to_s
1.6 split
3.0 block_pass
3.0 to_proc_normal
1.4 map
1.2 reject
0.3 lit_fixnum
1.0 take

BulkVerification#none

Total Score: 12.3

Score Operator
2.0 extend
2.2 branch
1.0 included
1.2 before_action
1.2 helper_method
1.2 rescue_from
1.7 selected_ids
1.5 inspect
1.3 raise
1.0 private

BulkVerification#verify_bulk_request

Total Score: 5.8

Score Operator
1.2 selected_ids
1.2 block_pass
1.2 to_proc_normal
1.2 method
1.0 all?

BulkVerification#all_ids

Total Score: 4.9

Score Operator
1.0 assignment
1.2 bulk_verifier
1.4 params
1.2 []
1.0 verify

BulkVerification#verify_bulk_request_id

Total Score: 3.6

Score Operator
1.0 branch
1.3 all_ids
1.1 include?
1.1 raise_bad_request

BulkVerification#raise_bad_request

Total Score: 3.6

Score Operator
1.4 all_ids
1.2 inspect
1.0 raise

BulkVerification#bulk_verifier

Total Score: 2.4

Score Operator
1.0 assignment
1.2 bulk_verification_token
1.0 new

BulkVerification#bulk_verification_token

Total Score: 2.3

Score Operator
1.0 session
0.3 lit_fixnum
1.0 base64

BulkVerification#bulk_request?

Total Score: 1.0

Score Operator
1.0 action_name

app/jobs/refresh_constituency_party_job.rb

RefreshConstituencyPartyJob#parse

Total Score: 17.3

Score Operator
5.3 assignment
1.1 XML
2.3 branch
7.5 xpath
1.1 map
5.4 text
1.2 tap

RefreshConstituencyPartyJob#perform

Total Score: 9.6

Score Operator
2.3 branch
1.1 find_each
1.2 assignment
1.4 members
1.4 mp_id
2.7 []
2.6 update!

RefreshConstituencyPartyJob#load_members

Total Score: 9.3

Score Operator
2.4 branch
2.5 assignment
1.3 fetch_members
1.3 success?
1.8 body
1.6 parse
1.4 []
1.2 send_exception

RefreshConstituencyPartyJob#fetch_members

Total Score: 5.7

Score Operator
1.1 branch
1.3 faraday
1.1 get
2.6 assignment
2.6 options

RefreshConstituencyPartyJob#faraday

Total Score: 5.1

Score Operator
1.1 branch
1.1 new
2.6 response
1.3 adapter

RefreshConstituencyPartyJob#none

Total Score: 3.8

Score Operator
0.3 lit_fixnum
1.1 branch
1.1 rescue_from
1.2 send_exception
1.1 private

RefreshConstituencyPartyJob#members

Total Score: 1.6

Score Operator
1.1 assignment
1.1 load_members

app/models/rejection.rb

Rejection#none

Total Score: 17.2

Score Operator
1.0 belongs_to
3.0 validates
0.3 lit_fixnum
2.1 branch
1.0 after_create
4.1 petition
1.1 rejected_at?
2.8 state_for_petition
2.4 update!
1.4 current

Rejection#hide_petition?

Total Score: 2.2

Score Operator
1.2 code
1.0 in?

Rejection#state_for_petition

Total Score: 1.4

Score Operator
1.0 branch
1.0 hide_petition?

app/helpers/admin_helper.rb

AdminHelper#selected_tags

Total Score: 16.8

Score Operator
1.0 assignment
2.2 params
2.0 []
1.8 Array
1.6 flatten
2.8 block_pass
2.8 to_proc_normal
1.4 map
1.2 compact
1.0 reject

AdminHelper#build_trending_domains

Total Score: 14.9

Score Operator
5.3 assignment
0.4 lit_fixnum
1.2 +
1.0 trending_domains
1.2 rate_limit
1.0 allowed_domains_list
4.6 branch
2.0 inject
1.4 size
1.2 ==
1.2 any?
1.3 ===
1.3 <<

AdminHelper#build_trending_ips

Total Score: 14.9

Score Operator
5.3 assignment
0.4 lit_fixnum
1.2 +
1.0 trending_ips
1.2 rate_limit
1.0 allowed_ips_list
4.6 branch
2.0 inject
1.4 size
1.2 ==
1.2 any?
1.3 include?
1.3 <<

AdminHelper#email_petitioners_with_count_submit_button

Total Score: 8.2

Score Operator
3.0 assignment
2.2 signature_count
1.0 number_with_delimiter
2.4 t
1.0 merge
1.0 submit

AdminHelper#cms_delete_link

Total Score: 8.1

Score Operator
1.0 assignment
1.0 name
1.0 resource_path
1.2 image_tag
2.6 []
1.2 h
1.0 link_to

AdminHelper#trending_window?

Total Score: 7.9

Score Operator
1.0 branch
3.0 params
2.6 []
1.1 present?
1.1 =~

AdminHelper#trending_window

Total Score: 7.2

Score Operator
1.0 branch
1.0 trending_window?
2.4 assignment
1.6 params
1.4 []
1.2 in_time_zone
0.4 lit_fixnum
1.2 advance

AdminHelper#fraudulent_ips?

Total Score: 6.4

Score Operator
0.6 lit_fixnum
1.2 hour
1.0 ago
1.4 fraudulent_ips
1.2 empty?
1.0 !

AdminHelper#fraudulent_domains?

Total Score: 6.4

Score Operator
0.6 lit_fixnum
1.2 hour
1.0 ago
1.4 fraudulent_domains
1.2 empty?
1.0 !

AdminHelper#trending_ips?

Total Score: 6.4

Score Operator
0.6 lit_fixnum
1.2 hour
1.0 ago
1.4 trending_ips
1.2 empty?
1.0 !

AdminHelper#trending_domains?

Total Score: 6.4

Score Operator
0.6 lit_fixnum
1.2 hour
1.0 ago
1.4 trending_domains
1.2 empty?
1.0 !

AdminHelper#admin_invalidation_facets_for_select

Total Score: 5.8

Score Operator
1.0 assignment
1.0 branch
1.2 admin_invalidation_facets
1.0 map
1.3 []
1.1 t
1.0 options_for_select

AdminHelper#admin_petition_facets_for_select

Total Score: 5.8

Score Operator
1.0 assignment
1.0 branch
1.2 admin_petition_facets
1.0 map
1.3 []
1.1 t
1.0 options_for_select

AdminHelper#admin_archived_petition_facets_for_select

Total Score: 5.8

Score Operator
1.0 assignment
1.0 branch
1.2 admin_archived_petition_facets
1.0 map
1.3 []
1.1 t
1.0 options_for_select

AdminHelper#trending_domains

Total Score: 3.9

Score Operator
0.6 lit_fixnum
1.2 hour
1.0 ago
1.0 assignment
1.0 build_trending_domains

AdminHelper#fraudulent_ips

Total Score: 3.9

Score Operator
0.6 lit_fixnum
1.2 hour
1.0 ago
1.0 assignment
1.0 build_fraudulent_ips

AdminHelper#fraudulent_domains

Total Score: 3.9

Score Operator
0.6 lit_fixnum
1.2 hour
1.0 ago
1.0 assignment
1.0 build_fraudulent_domains

AdminHelper#trending_ips

Total Score: 3.9

Score Operator
0.6 lit_fixnum
1.2 hour
1.0 ago
1.0 assignment
1.0 build_trending_ips

AdminHelper#admin_signature_states_for_select

Total Score: 2.2

Score Operator
1.2 t
1.0 options_for_select

AdminHelper#mandatory_field

Total Score: 2.2

Score Operator
1.2 raw
1.0 content_tag

AdminHelper#admin_parliaments_for_select

Total Score: 2.2

Score Operator
1.2 archived_parliaments
1.0 options_from_collection_for_select

AdminHelper#rate_limit

Total Score: 1.4

Score Operator
1.0 assignment
1.0 first_or_create!

AdminHelper#admin_archived_petition_facets

Total Score: 1.0

Score Operator
1.0 t

AdminHelper#build_fraudulent_ips

Total Score: 1.0

Score Operator
1.0 fraudulent_ips

AdminHelper#build_fraudulent_domains

Total Score: 1.0

Score Operator
1.0 fraudulent_domains

AdminHelper#admin_invalidation_facets

Total Score: 1.0

Score Operator
1.0 t

AdminHelper#admin_petition_facets

Total Score: 1.0

Score Operator
1.0 t

AdminHelper#none

Total Score: 1.0

Score Operator
1.0 private

app/controllers/admin/moderation_delays_controller.rb

Admin::ModerationDelaysController#create

Total Score: 16.8

Score Operator
7.2 branch
1.0 valid?
1.2 save_attributes_to_session
1.2 enqeue_job
1.2 send_email_to_creators?
1.5 admin_petitions_url
1.3 redirect_to
2.4 respond_to
2.6 html
2.8 render

Admin::ModerationDelaysController#enqeue_job

Total Score: 10.5

Score Operator
1.0 branch
1.0 send_email_to_creators?
7.2 assignment
1.2 feedback_signature
1.2 subject
2.0 <<
1.2 body
1.0 public_send

Admin::ModerationDelaysController#moderation_delay_params

Total Score: 8.9

Score Operator
2.1 branch
2.7 params
1.0 key?
1.3 require
1.1 permit
1.4 session
1.2 []

Admin::ModerationDelaysController#build_moderation_delay

Total Score: 2.4

Score Operator
1.0 assignment
1.2 moderation_delay_params
1.0 new

Admin::ModerationDelaysController#new

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::ModerationDelaysController#save_attributes_to_session

Total Score: 2.2

Score Operator
1.0 assignment
1.0 session
1.0 attributes

Admin::ModerationDelaysController#send_email_to_creators?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::ModerationDelaysController#example_petition

Total Score: 2.2

Score Operator
1.2 overdue_in_moderation
1.0 last

Admin::ModerationDelaysController#feedback_signature

Total Score: 2.2

Score Operator
1.2 example_petition
1.0 new

Admin::ModerationDelaysController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

app/models/invalidation.rb

Invalidation::enqueued

Total Score: 16.6

Score Operator
4.8 arel_table
4.4 []
2.0 not_eq
2.0 eq
1.8 and
1.6 where

app/models/signature.rb

Signature::duplicate

Total Score: 16.6

Score Operator
4.8 arel_table
4.4 []
2.0 not_eq
2.0 eq
1.8 and
1.6 where

app/controllers/petitions_controller.rb

PetitionsController#none

Total Score: 16.5

Score Operator
14.3 before_action
1.1 after_action
1.1 protected

PetitionsController#redirect_to_archived_petition_if_archived

Total Score: 11.5

Score Operator
2.3 branch
1.1 assignment
3.0 petition_id
1.1 find_by
1.4 parliament
1.2 archived?
1.7 request_format
1.5 archived_petition_url
1.3 redirect_to

PetitionsController#create

Total Score: 8.4

Score Operator
3.6 branch
1.1 save
1.4 thank_you_petition_url
1.2 redirect_to
1.2 respond_to
1.3 html
1.4 render

PetitionsController#redirect_to_valid_state

Total Score: 8.3

Score Operator
2.2 branch
1.2 state_present?
1.4 valid_state?
1.2 !
1.6 search_params
1.4 petitions_url
1.2 redirect_to

PetitionsController#valid_state?

Total Score: 6.9

Score Operator
1.3 public_petition_facets
1.7 params
1.5 []
1.3 to_sym
1.1 include?

PetitionsController#index

Total Score: 5.1

Score Operator
1.1 branch
1.1 respond_to
1.3 html
1.3 json
1.3 csv

PetitionsController#search_params

Total Score: 4.1

Score Operator
1.1 assignment
1.5 params
1.3 permit
1.1 merge

PetitionsController#request_format

Total Score: 4.1

Score Operator
1.1 branch
1.5 request
1.3 format
1.1 json?

PetitionsController#state_present?

Total Score: 3.9

Score Operator
1.5 params
1.3 []
1.1 present?

PetitionsController#petition_id

Total Score: 3.9

Score Operator
1.5 params
1.3 []
1.1 to_i

PetitionsController#show

Total Score: 3.9

Score Operator
1.1 branch
1.1 respond_to
1.3 html
1.3 json

PetitionsController#build_petition_creator

Total Score: 3.9

Score Operator
1.1 assignment
1.3 params
1.3 request
1.1 new

PetitionsController#retrieve_petitions

Total Score: 3.9

Score Operator
1.1 assignment
1.3 visible
1.3 params
1.1 search

PetitionsController#retrieve_petition

Total Score: 3.9

Score Operator
1.1 assignment
1.3 show
1.3 petition_id
1.1 find

PetitionsController#redirect_to_home_page_unless_opened

Total Score: 3.9

Score Operator
1.1 branch
1.1 opened?
1.4 home_url
1.2 redirect_to

PetitionsController#redirect_to_home_page_if_dissolved

Total Score: 3.9

Score Operator
1.1 branch
1.1 dissolved?
1.4 home_url
1.2 redirect_to

PetitionsController#set_content_disposition

Total Score: 3.7

Score Operator
1.1 assignment
1.3 response
1.1 headers
1.1 csv_filename

PetitionsController#check

Total Score: 2.5

Score Operator
1.1 branch
1.1 respond_to
1.2 html

PetitionsController#moderation_info

Total Score: 2.5

Score Operator
1.1 branch
1.1 respond_to
1.2 html

PetitionsController#thank_you

Total Score: 2.5

Score Operator
1.1 branch
1.1 respond_to
1.2 html

PetitionsController#gathering_support

Total Score: 2.5

Score Operator
1.1 branch
1.1 respond_to
1.2 html

PetitionsController#new

Total Score: 2.5

Score Operator
1.1 branch
1.1 respond_to
1.2 html

PetitionsController#check_results

Total Score: 2.5

Score Operator
1.1 branch
1.1 respond_to
1.2 html

PetitionsController#count

Total Score: 2.5

Score Operator
1.1 branch
1.1 respond_to
1.2 json

PetitionsController#redirect_to_petition_url

Total Score: 2.4

Score Operator
1.3 petition_url
1.1 redirect_to

PetitionsController#redirect_to_gathering_support_url

Total Score: 2.4

Score Operator
1.3 gathering_support_petition_url
1.1 redirect_to

PetitionsController#redirect_to_stopped_page

Total Score: 2.4

Score Operator
1.3 home_url
1.1 redirect_to

PetitionsController#redirect_to_moderation_info_url

Total Score: 2.4

Score Operator
1.3 moderation_info_petition_url
1.1 redirect_to

PetitionsController#csv_filename

Total Score: 1.1

Score Operator
1.1 scope

PetitionsController#collecting_sponsors?

Total Score: 1.1

Score Operator
1.1 collecting_sponsors?

PetitionsController#in_moderation?

Total Score: 1.1

Score Operator
1.1 in_moderation?

PetitionsController#moderated?

Total Score: 1.1

Score Operator
1.1 moderated?

PetitionsController#stopped?

Total Score: 1.1

Score Operator
1.1 stopped?

lib/tasks/petitions.rake

namespace(epets)::namespace(petitions)::task#moderated_at

Total Score: 16.4

Score Operator
1.5 branch
1.5 respond_to?
2.0 open_at
4.0 rejected_at
3.6 compact
3.2 min
2.0 opened_at

namespace(epets)::namespace(petitions)::task#backfill_moderation_lag

Total Score: 11.2

Score Operator
1.1 task
5.2 branch
1.1 each
2.8 assignment
1.3 new
1.3 find_each
1.5 moderated?
1.7 moderation_lag
1.5 update_column

namespace(epets)::namespace(petitions)::task#update_statistics

Total Score: 10.4

Score Operator
1.1 task
1.1 branch
0.9 lit_fixnum
3.1 hours
1.1 run
1.6 ago
1.4 iso8601
1.2 perform_later

namespace(epets)::namespace(petitions)::task#debated

Total Score: 9.7

Score Operator
1.1 task
1.1 branch
1.1 run
1.3 assignment
1.3 tomorrow
1.7 beginning_of_day
1.5 set
1.5 iso8601
1.3 perform_later

namespace(epets)::namespace(petitions)::task#moderated?

Total Score: 9.5

Score Operator
4.7 branch
1.5 respond_to?
1.7 open_at?
3.4 rejected_at?
1.7 opened_at?

namespace(epets)::namespace(petitions)::task#close

Total Score: 9.5

Score Operator
1.1 task
1.1 branch
1.1 run
1.3 assignment
1.5 tomorrow
1.3 beginning_of_day
1.5 set
1.5 iso8601
1.3 perform_later

namespace(epets)::namespace(petitions)::task#moderation_lag

Total Score: 8.7

Score Operator
1.9 moderated_at
3.4 to_date
1.9 moderation_threshold_reached_at
1.5 -

namespace(epets)::namespace(petitions)::task#count

Total Score: 3.6

Score Operator
1.1 task
1.1 branch
1.1 run
1.2 perform_later

namespace(epets)::namespace(petitions)::task#update_moderation_lag

Total Score: 3.2

Score Operator
1.7 moderation_lag
1.5 update_column

app/jobs/import_constituencies_job.rb

ImportConstituenciesJob#perform

Total Score: 16.2

Score Operator
3.4 branch
1.2 current_constituencies
1.0 each
4.8 assignment
6.4 []
1.2 find_or_initialize_by
1.4 example_postcodes
1.3 changed?
1.3 new_record?
1.3 save!

ImportConstituenciesJob#constituencies

Total Score: 9.5

Score Operator
4.1 assignment
1.0 fetch_constituencies
1.2 body
1.0 force_encoding
1.0 branch
1.0 =~
3.3 []
1.0 parse

ImportConstituenciesJob#fetch_constituencies

Total Score: 6.9

Score Operator
1.0 branch
1.2 faraday
1.0 get
3.6 assignment
1.2 headers
2.4 options

ImportConstituenciesJob#current_constituencies

Total Score: 4.7

Score Operator
1.0 branch
1.2 constituencies
1.0 select
1.3 []
1.1 nil?

ImportConstituenciesJob#faraday

Total Score: 4.7

Score Operator
1.0 branch
1.0 new
2.4 response
1.2 adapter

ImportConstituenciesJob#example_postcodes

Total Score: 3.7

Score Operator
1.0 assignment
1.4 root
1.2 join
1.0 load_file

ImportConstituenciesJob#none

Total Score: 3.5

Score Operator
0.3 lit_fixnum
1.0 branch
1.0 rescue_from
1.1 send_exception
1.0 private

app/models/archived/signature.rb

Archived::Signature::unsubscribe!

Total Score: 16.2

Score Operator
1.6 assignment
1.6 find
7.0 branch
1.6 transaction
1.7 each
1.8 creator?
3.9 raise
1.9 pending?
2.0 update!

app/models/signature.rb

Signature::unsubscribe!

Total Score: 16.2

Score Operator
1.6 assignment
1.6 find
7.0 branch
1.6 transaction
1.7 each
1.8 creator?
3.9 raise
1.9 pending?
2.0 update!

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::reset_signature_counts_for

Total Score: 15.8

Score Operator
3.2 branch
1.7 signature_counts
1.5 each
1.7 blank?
1.9 for
1.7 reset_signature_count
1.9 constituency_petition_journals
1.9 last_signed_at
1.7 older_than
1.5 delete_all

app/models/country_petition_journal.rb

CountryPetitionJournal::reset_signature_counts_for

Total Score: 15.8

Score Operator
3.2 branch
1.7 signature_counts
1.5 each
1.7 blank?
1.9 for
1.7 reset_signature_count
1.9 country_petition_journals
1.9 last_signed_at
1.7 older_than
1.5 delete_all

TrendingDomain::search

Total Score: 15.7

Score Operator
7.7 assignment
1.5 to_s
1.9 []
1.7 to_i
0.9 lit_fixnum
1.5 max
1.5 branch
1.5 present?
1.6 where
1.6 all
1.5 paginate

TrendingIp::search

Total Score: 15.7

Score Operator
7.7 assignment
1.5 to_s
1.9 []
1.7 to_i
0.9 lit_fixnum
1.5 max
1.5 branch
1.5 present?
1.6 where
1.6 all
1.5 paginate

app/controllers/sponsors_controller.rb

SponsorsController#retrieve_petition

Total Score: 15.6

Score Operator
1.0 assignment
1.2 not_hidden
2.5 petition_id
1.0 find
3.0 branch
1.1 flagged?
1.1 stopped?
2.2 raise
1.2 sponsor_token
2.7 token_param
1.0 ==
1.3 inspect

SponsorsController#retrieve_signature

Total Score: 10.9

Score Operator
2.0 assignment
1.2 sponsors
2.5 signature_id
1.0 find
1.0 petition
3.1 branch
1.1 flagged?
1.2 hidden?
1.2 stopped?
1.1 raise

SponsorsController#build_signature

Total Score: 9.9

Score Operator
1.0 branch
1.2 action_name
1.0 ==
2.2 assignment
2.6 sponsors
1.3 signature_params_for_new
2.2 build
1.3 signature_params_for_create

SponsorsController#none

Total Score: 8.0

Score Operator
3.0 skip_before_filter
4.0 before_action
1.0 private

SponsorsController#redirect_to_new_sponsor_page_if_validated

Total Score: 8.0

Score Operator
1.0 branch
0.4 lit_fixnum
1.4 minutes
1.2 ago
1.0 validated_before?
1.5 sponsor_token
1.3 new_petition_sponsor_url
1.1 redirect_to

SponsorsController#verify

Total Score: 7.7

Score Operator
1.0 branch
1.0 validated?
1.3 request
1.1 validate!
1.0 store_signed_token_in_session
1.0 send_sponsor_support_notification_email_to_petition_owner
1.2 signed_sponsor_url
1.0 redirect_to

SponsorsController#send_sponsor_support_notification_email_to_petition_owner

Total Score: 6.7

Score Operator
3.3 branch
1.0 collecting_sponsors?
1.1 will_reach_threshold_for_moderation?
2.5 perform_later
1.2 just_validated?

SponsorsController#send_email_to_petition_signer

Total Score: 5.0

Score Operator
2.1 branch
1.0 email_threshold_reached?
1.1 pending?
2.4 perform_later

SponsorsController#redirect_to_moderation_info_page_if_sponsored

Total Score: 3.5

Score Operator
1.0 branch
1.0 has_maximum_sponsors?
1.3 moderation_info_petition_url
1.1 redirect_to

SponsorsController#redirect_to_petition_page_if_moderated

Total Score: 3.5

Score Operator
1.0 branch
1.0 moderated?
1.3 petition_url
1.1 redirect_to

SponsorsController#thank_you_url

Total Score: 2.2

Score Operator
1.2 sponsor_token
1.0 thank_you_petition_sponsors_url

SponsorsController#validate_creator

Total Score: 1.0

Score Operator
1.0 validate_creator!

SponsorsController#signed_token_failure_url

Total Score: 1.0

Score Operator
1.0 moderation_info_petition_url

app/models/signature_logs.rb

SignatureLogs::Log#timestamp

Total Score: 15.6

Score Operator
2.3 branch
1.1 present?
1.2 assignment
1.3 data
1.7 year
1.7 month
1.7 day
1.7 hour
1.7 min
1.7 sec
1.5 utc
1.3 in_time_zone

SignatureLogs::Log#ip_address

Total Score: 7.4

Score Operator
2.3 branch
1.1 present?
1.2 assignment
3.0 data
1.5 []
1.3 new

SignatureLogs::Log#==

Total Score: 6.2

Score Operator
1.1 branch
1.3 class
1.1 is_a?
2.6 message
1.1 ==

SignatureLogs::Log#month

Total Score: 5.9

Score Operator
1.7 data
1.5 []
1.3 index
0.3 lit_fixnum
1.1 +

SignatureLogs::Log#year

Total Score: 3.9

Score Operator
1.5 data
1.3 []
1.1 to_i

SignatureLogs::Log#day

Total Score: 3.9

Score Operator
1.5 data
1.3 []
1.1 to_i

SignatureLogs::Log#sec

Total Score: 3.9

Score Operator
1.5 data
1.3 []
1.1 to_i

SignatureLogs::Log#min

Total Score: 3.9

Score Operator
1.5 data
1.3 []
1.1 to_i

SignatureLogs::Log#hour

Total Score: 3.9

Score Operator
1.5 data
1.3 []
1.1 to_i

SignatureLogs::Log#referrer

Total Score: 3.9

Score Operator
1.1 branch
1.1 present?
1.4 data
1.2 []

SignatureLogs::Log#uri

Total Score: 3.9

Score Operator
1.1 branch
1.1 present?
1.4 data
1.2 []

SignatureLogs::Log#method

Total Score: 3.9

Score Operator
1.1 branch
1.1 present?
1.4 data
1.2 []

SignatureLogs::Log#agent

Total Score: 3.9

Score Operator
1.1 branch
1.1 present?
1.4 data
1.2 []

SignatureLogs::Log#response

Total Score: 3.9

Score Operator
1.1 branch
1.1 present?
1.4 data
1.2 []

SignatureLogs::Log#initialize

Total Score: 2.5

Score Operator
2.2 assignment
1.1 match

SignatureLogs::Log#blank?

Total Score: 2.4

Score Operator
1.3 data
1.1 nil?

SignatureLogs::Log#none

Total Score: 2.2

Score Operator
1.1 attr_reader
1.1 private

app/models/signature.rb

Signature::pending_rate

Total Score: 15.6

Score Operator
2.4 pending
4.4 count
2.4 total
2.0 Rational
1.0 lit_fixnum
1.8 *
1.6 to_d

app/models/domain.rb

Domain#none

Total Score: 15.4

Score Operator
6.0 validates
0.9 lit_fixnum
1.0 attr_writer
2.5 private
5.0 sclass

Domain#local

Total Score: 12.1

Score Operator
3.4 branch
1.4 local
1.2 dup
1.0 tap
1.2 strip_characters?
1.5 characters_regexp
2.6 gsub!
1.2 strip_extension?
1.5 extension_regexp

Domain#aliased_domains

Total Score: 5.2

Score Operator
1.6 aliases
1.4 by_name
1.2 pluck
1.0 join

Domain#domain

Total Score: 4.6

Score Operator
1.0 branch
1.0 alias?
1.3 canonical_domain
1.1 name
1.1 domain

Domain#name=

Total Score: 4.6

Score Operator
1.0 super
1.4 to_s
1.2 downcase
1.0 strip

Domain#characters_regexp

Total Score: 3.6

Score Operator
1.4 strip_characters
1.2 chars
1.0 union

Domain#strip_characters?

Total Score: 3.5

Score Operator
1.0 branch
1.0 alias?
1.3 canonical_domain
1.1 strip_characters?

Domain#strip_extension?

Total Score: 3.5

Score Operator
1.0 branch
1.0 alias?
1.3 canonical_domain
1.1 strip_extension?

Domain#strip_characters

Total Score: 3.5

Score Operator
1.0 branch
1.0 alias?
1.3 canonical_domain
1.1 strip_characters

Domain#strip_extension

Total Score: 3.5

Score Operator
1.0 branch
1.0 alias?
1.3 canonical_domain
1.1 strip_extension

Domain#find_canonical_domain

Total Score: 3.4

Score Operator
1.2 class
1.2 aliased_domain
1.0 find_by

Domain#aliased_domain

Total Score: 2.6

Score Operator
1.0 branch
1.3 canonical_domain
1.1 try

Domain#normalize

Total Score: 2.4

Score Operator
1.0 branch
1.1 local
1.1 domain

Domain#extension_regexp

Total Score: 2.4

Score Operator
1.0 assignment
1.2 strip_extension
1.0 escape

Domain#aliased_domain?

Total Score: 2.2

Score Operator
1.2 aliased_domain
1.0 present?

Domain#alias?

Total Score: 2.2

Score Operator
1.2 canonical_domain
1.0 present?

Domain#alias

Total Score: 2.2

Score Operator
1.2 canonical_domain
1.0 name

app/jobs/deliver_debate_outcome_email_job.rb

DeliverDebateOutcomeEmailJob#create_email

Total Score: 15.2

Score Operator
1.0 branch
6.8 signature
1.0 creator?
2.6 mailer
2.6 petition
1.1 notify_creator_of_debate_outcome
1.1 notify_signer_of_debate_outcome

DeliverDebateOutcomeEmailJob#none

Total Score: 2.0

Score Operator
2.0 include

app/jobs/archived/deliver_debate_scheduled_email_job.rb

Archived::DeliverDebateScheduledEmailJob#create_email

Total Score: 15.2

Score Operator
1.0 branch
6.8 signature
1.0 creator?
2.6 mailer
2.6 petition
1.1 notify_creator_of_debate_scheduled
1.1 notify_signer_of_debate_scheduled

Archived::DeliverDebateScheduledEmailJob#none

Total Score: 2.0

Score Operator
2.0 include

app/jobs/archived/deliver_threshold_response_email_job.rb

Archived::DeliverThresholdResponseEmailJob#create_email

Total Score: 15.2

Score Operator
1.0 branch
6.8 signature
1.0 creator?
2.6 mailer
2.6 petition
1.1 notify_creator_of_threshold_response
1.1 notify_signer_of_threshold_response

Archived::DeliverThresholdResponseEmailJob#none

Total Score: 2.0

Score Operator
2.0 include

app/jobs/archived/deliver_debate_outcome_email_job.rb

Archived::DeliverDebateOutcomeEmailJob#create_email

Total Score: 15.2

Score Operator
1.0 branch
6.8 signature
1.0 creator?
2.6 mailer
2.6 petition
1.1 notify_creator_of_debate_outcome
1.1 notify_signer_of_debate_outcome

Archived::DeliverDebateOutcomeEmailJob#none

Total Score: 2.0

Score Operator
2.0 include

app/jobs/deliver_threshold_response_email_job.rb

DeliverThresholdResponseEmailJob#create_email

Total Score: 15.2

Score Operator
1.0 branch
6.8 signature
1.0 creator?
2.6 mailer
2.6 petition
1.1 notify_creator_of_threshold_response
1.1 notify_signer_of_threshold_response

DeliverThresholdResponseEmailJob#none

Total Score: 2.0

Score Operator
2.0 include

app/jobs/deliver_debate_scheduled_email_job.rb

DeliverDebateScheduledEmailJob#create_email

Total Score: 15.2

Score Operator
1.0 branch
6.8 signature
1.0 creator?
2.6 mailer
2.6 petition
1.1 notify_creator_of_debate_scheduled
1.1 notify_signer_of_debate_scheduled

DeliverDebateScheduledEmailJob#none

Total Score: 2.0

Score Operator
2.0 include

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::with_signatures_for

Total Score: 15.2

Score Operator
4.4 arel_table
4.0 []
1.9 gt
3.2 where
1.7 eq

app/models/constituency.rb

Constituency::validate#on

Total Score: 15.1

Score Operator
1.1 validate
2.4 assignment
1.4 query
1.4 example_postcode
1.2 fetch
1.2 first
2.4 branch
1.3 nil?
1.5 external_id
1.5 []
1.3 !=
1.5 errors
1.3 add

app/models/admin_user_session.rb

AdminUserSession#none

Total Score: 15.0

Score Operator
1.0 allow_http_basic_auth
1.0 consecutive_failed_logins_limit
1.0 logout_on_timeout
3.1 branch
1.0 before_save
2.7 record
3.5 reset_persistence_token!
1.0 before_destroy
1.1 stale?
1.4 stale_record
1.0 private

AdminUserSession#last_login_attempt?

Total Score: 5.1

Score Operator
1.2 failed_login_count
1.4 consecutive_failed_logins_limit
0.4 lit_fixnum
1.2 -
1.0 ==

AdminUserSession#failed_login_count

Total Score: 4.7

Score Operator
1.0 branch
2.5 attempted_record
1.0 present?
1.1 failed_login_count

AdminUserSession#time_remaining

Total Score: 3.5

Score Operator
1.0 branch
2.3 record
1.1 time_remaining

app/models/site.rb

Site::default_url

Total Score: 14.9

Score Operator
1.6 branch
1.8 fetch
1.6 ==
4.2 default_url_components
3.8 build
3.4 to_s

app/models/site.rb

Site::default_moderate_url

Total Score: 14.9

Score Operator
1.6 branch
1.8 fetch
1.6 ==
4.2 default_moderate_url_components
3.8 build
3.4 to_s

app/jobs/archived/deliver_petition_email_job.rb

Archived::DeliverPetitionEmailJob#create_email

Total Score: 14.8

Score Operator
1.0 branch
3.8 signature
1.0 creator?
2.6 mailer
2.6 petition
2.6 email
1.1 email_creator
1.1 email_signer

Archived::DeliverPetitionEmailJob#none

Total Score: 3.0

Score Operator
2.0 include
1.0 attr_reader

Archived::DeliverPetitionEmailJob#perform

Total Score: 1.4

Score Operator
1.0 assignment
1.0 []

app/jobs/deliver_petition_email_job.rb

DeliverPetitionEmailJob#create_email

Total Score: 14.8

Score Operator
1.0 branch
3.8 signature
1.0 creator?
2.6 mailer
2.6 petition
2.6 email
1.1 email_creator
1.1 email_signer

DeliverPetitionEmailJob#none

Total Score: 3.0

Score Operator
2.0 include
1.0 attr_reader

DeliverPetitionEmailJob#perform

Total Score: 1.4

Score Operator
1.0 assignment
1.0 []

app/jobs/fetch_country_register_job.rb

FetchCountryRegisterJob#perform

Total Score: 14.8

Score Operator
3.7 branch
1.3 countries
1.1 each
5.2 assignment
5.4 []
1.3 find_or_initialize_by
1.4 changed?
1.4 new_record?
1.4 save!

FetchCountryRegisterJob#countries

Total Score: 8.3

Score Operator
1.1 branch
1.7 fetch_register
1.5 body
1.3 values
1.1 map
1.4 []
1.2 first

FetchCountryRegisterJob#faraday

Total Score: 6.4

Score Operator
1.1 branch
1.1 new
3.9 response
1.3 adapter

FetchCountryRegisterJob#fetch_register

Total Score: 5.7

Score Operator
1.1 branch
1.3 faraday
1.1 get
2.6 assignment
2.6 options

FetchCountryRegisterJob#none

Total Score: 3.8

Score Operator
0.3 lit_fixnum
1.1 branch
1.1 rescue_from
1.2 send_exception
1.1 private

lib/tasks/epets.rake

namespace(epets)::namespace(site)::task#signature_counts

Total Score: 14.6

Score Operator
1.2 task
4.0 branch
0.9 lit_fixnum
3.2 minutes
1.2 run
1.4 update_signature_counts
1.6 signature_count_updated_at
1.6 ago
1.4 >
1.5 perform_later

namespace(epets)::namespace(site)::task#protect

Total Score: 6.6

Score Operator
1.2 task
1.4 instance
2.8 fetch
1.2 update!

namespace(epets)::namespace(site)::task#trending_ips

Total Score: 5.6

Score Operator
1.2 task
1.2 branch
0.4 lit_fixnum
1.4 minutes
1.2 run
1.3 perform_later

namespace(epets)::namespace(site)::task#trending_domains

Total Score: 5.6

Score Operator
1.2 task
1.2 branch
0.4 lit_fixnum
1.4 minutes
1.2 run
1.3 perform_later

namespace(epets)::namespace(site)::task#unprotect

Total Score: 3.8

Score Operator
1.2 task
1.4 instance
1.2 update!

namespace(epets)::namespace(site)::task#disable

Total Score: 3.8

Score Operator
1.2 task
1.4 instance
1.2 update!

namespace(epets)::namespace(site)::task#enable

Total Score: 3.8

Score Operator
1.2 task
1.4 instance
1.2 update!

app/jobs/concerns/email_delivery.rb

EmailDelivery#none

Total Score: 14.5

Score Operator
2.0 extend
3.4 branch
1.0 included
1.2 before_perform
1.2 attr_reader
1.2 queue_as
2.4 rescue_from
2.7 log_exception
1.4 retry_job
1.0 private

EmailDelivery#email_not_previously_sent?

Total Score: 9.8

Score Operator
1.6 petition
1.6 timestamp_name
1.4 signatures_to_email_for
1.6 signature
1.4 id
1.2 where
1.0 exists?

EmailDelivery#perform

Total Score: 9.5

Score Operator
4.0 assignment
4.2 []
1.0 in_time_zone
1.0 branch
1.0 can_send_email?
1.2 send_email
1.2 record_email_sent

EmailDelivery#petition_has_not_been_updated?

Total Score: 8.9

Score Operator
1.6 petition_timestamp
1.8 requested_at
1.6 in_time_zone
1.4 -
1.2 abs
0.3 lit_fixnum
1.0 <

EmailDelivery#log_message

Total Score: 8.8

Score Operator
2.4 class
2.0 name
1.2 signature
1.0 email
1.2 petition
1.0 action

EmailDelivery#mailer

Total Score: 5.9

Score Operator
3.2 branch
2.5 petition
1.3 class
1.1 raise

EmailDelivery#record_email_sent

Total Score: 4.6

Score Operator
1.2 signature
1.2 timestamp_name
1.2 petition_timestamp
1.0 set_email_sent_at_for

EmailDelivery#petition_timestamp

Total Score: 3.4

Score Operator
1.2 petition
1.2 timestamp_name
1.0 get_email_requested_at_for

EmailDelivery#log_exception

Total Score: 3.4

Score Operator
1.2 logger
1.2 log_message
1.0 info

EmailDelivery#can_send_email?

Total Score: 2.4

Score Operator
1.0 branch
1.1 petition_has_not_been_updated?
1.1 email_not_previously_sent?

EmailDelivery#create_email

Total Score: 2.2

Score Operator
1.2 new
1.0 raise

EmailDelivery#send_email

Total Score: 2.2

Score Operator
1.2 create_email
1.0 deliver_now

EmailDelivery#set_appsignal_namespace

Total Score: 1.0

Score Operator
1.0 set_namespace

app/helpers/cache_helper.rb

CacheHelper::CacheKey::Keys#none

Total Score: 14.3

Score Operator
1.1 attr_reader
12.1 delegate
1.1 private

CacheHelper::CacheKey::Keys#cache_key_for

Total Score: 13.0

Score Operator
5.1 branch
1.1 respond_to?
1.2 cache_key
2.5 ===
1.5 map
1.6 cache_key_for
2.7 to_param
1.4 to_s

CacheHelper::CacheKey::Keys#method_missing

Total Score: 7.8

Score Operator
1.1 branch
2.7 assigns
2.7 to_s
1.1 key?
1.2 []

CacheHelper::CacheKey::Keys#petition

Total Score: 5.5

Score Operator
2.2 branch
1.2 petition_page?
1.2 archived_petition_page?
1.4 assigns
1.2 []

CacheHelper::CacheKey::Keys#for

Total Score: 4.0

Score Operator
1.3 branch
1.3 map
1.4 value_for
1.1 uniq

CacheHelper::CacheKey::Keys#url

Total Score: 3.9

Score Operator
1.5 request
1.3 original_url
1.1 force_encoding

CacheHelper::CacheKey::Keys#reveal_response

Total Score: 3.9

Score Operator
1.5 params
1.3 []
1.1 ==

CacheHelper::CacheKey::Keys#constituency

Total Score: 2.4

Score Operator
1.3 assigns
1.1 []

CacheHelper::CacheKey::Keys#value_for

Total Score: 2.4

Score Operator
1.3 public_send
1.1 cache_key_for

CacheHelper::CacheKey::Keys#site_updated_at

Total Score: 1.1

Score Operator
1.1 updated_at

CacheHelper::CacheKey::Keys#petition_page

Total Score: 1.1

Score Operator
1.1 petition_page?

CacheHelper::CacheKey::Keys#last_petition_created_at

Total Score: 1.1

Score Operator
1.1 last_petition_created_at

CacheHelper::CacheKey::Keys#home_page

Total Score: 1.1

Score Operator
1.1 home_page?

CacheHelper::CacheKey::Keys#open_petition_page

Total Score: 1.1

Score Operator
1.1 open_petition_page?

CacheHelper::CacheKey::Keys#create_petition_page

Total Score: 1.1

Score Operator
1.1 create_petition_page?

CacheHelper::CacheKey::Keys#archived_petition_page

Total Score: 1.1

Score Operator
1.1 archived_petition_page?

CacheHelper::CacheKey::Keys#initialize

Total Score: 1.1

Score Operator
1.1 assignment

app/models/signature.rb

Signature::validated

Total Score: 14.3

Score Operator
5.0 assignment
5.0 where
3.2 branch
4.2 validated_at
1.9 gt
1.9 lteq

app/models/government_response.rb

GovernmentResponse#default_responded_on

Total Score: 14.3

Score Operator
4.3 branch
3.9 petition
2.4 government_response_at
2.3 to_date
2.5 created_at
1.2 new_record?
1.3 current

GovernmentResponse#none

Total Score: 12.8

Score Operator
1.0 belongs_to
4.0 validates
0.6 lit_fixnum
2.1 branch
1.0 after_create
2.7 petition
1.1 government_response_at?
1.2 touch
1.0 private

GovernmentResponse#responded_on

Total Score: 1.5

Score Operator
1.0 branch
1.1 default_responded_on

app/models/archived/government_response.rb

Archived::GovernmentResponse#none

Total Score: 13.9

Score Operator
1.1 belongs_to
4.4 validates
0.7 lit_fixnum
2.3 branch
1.1 after_create
2.9 petition
1.2 government_response_at?
1.3 touch
1.1 private

Archived::GovernmentResponse#default_responded_on

Total Score: 12.5

Score Operator
3.4 branch
4.2 petition
2.6 government_response_at
2.5 to_date
2.7 created_at

Archived::GovernmentResponse#responded_on

Total Score: 1.6

Score Operator
1.1 branch
1.2 default_responded_on

app/controllers/admin/archived/petition_emails_controller.rb

Admin::Archived::PetitionEmailsController#update

Total Score: 13.9

Score Operator
3.5 branch
1.2 email_params
1.0 update
1.2 send_email_to_petitioners?
1.4 schedule_email_petitioners_job
2.9 send_preview_email
4.3 assignment
1.3 send_preview_email?
1.4 admin_archived_petition_url
1.2 redirect_to
1.1 render

Admin::Archived::PetitionEmailsController#create

Total Score: 13.9

Score Operator
3.5 branch
1.2 email_params
1.0 update
1.2 send_email_to_petitioners?
1.4 schedule_email_petitioners_job
2.9 send_preview_email
4.3 assignment
1.3 send_preview_email?
1.4 admin_archived_petition_url
1.2 redirect_to
1.1 render

Admin::Archived::PetitionEmailsController#email_params

Total Score: 7.8

Score Operator
1.6 params
1.4 require
1.2 permit
1.4 current_user
1.2 pretty_name
1.0 merge

Admin::Archived::PetitionEmailsController#fetch_email

Total Score: 4.9

Score Operator
1.0 assignment
1.2 emails
1.4 params
1.2 []
1.0 find

Admin::Archived::PetitionEmailsController#fetch_petition

Total Score: 4.9

Score Operator
1.0 assignment
1.2 published
1.4 params
1.2 []
1.0 find

Admin::Archived::PetitionEmailsController#destroy

Total Score: 4.0

Score Operator
1.0 branch
1.0 destroy
2.2 assignment
1.2 admin_archived_petition_url
1.0 redirect_to

Admin::Archived::PetitionEmailsController#none

Total Score: 4.0

Score Operator
3.0 before_action
1.0 private

Admin::Archived::PetitionEmailsController#send_preview_email

Total Score: 3.6

Score Operator
1.4 feedback_signature
1.2 email_signer
1.0 deliver_now

Admin::Archived::PetitionEmailsController#build_email

Total Score: 2.4

Score Operator
1.0 assignment
1.2 emails
1.0 build

Admin::Archived::PetitionEmailsController#send_preview_email?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::Archived::PetitionEmailsController#send_email_to_petitioners?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::Archived::PetitionEmailsController#schedule_email_petitioners_job

Total Score: 1.0

Score Operator
1.0 run_later_tonight

Admin::Archived::PetitionEmailsController#feedback_signature

Total Score: 1.0

Score Operator
1.0 new

Admin::Archived::PetitionEmailsController#new

Total Score: 1.0

Score Operator
1.0 render

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal#none

Total Score: 13.8

Score Operator
2.0 belongs_to
3.0 validates
0.3 lit_fixnum
1.0 delegate
2.5 private
5.0 sclass

ConstituencyPetitionJournal#update_all

Total Score: 6.6

Score Operator
1.6 class
1.4 unscoped
1.4 id
1.2 where
1.0 update_all

ConstituencyPetitionJournal#decrement_signature_count

Total Score: 3.8

Score Operator
3.0 assignment
1.0 current
0.3 lit_fixnum
1.0 update_all

ConstituencyPetitionJournal#reset_signature_count

Total Score: 3.5

Score Operator
1.0 assignment
1.2 last_signed_at
1.2 updated_at
1.0 update_all

ConstituencyPetitionJournal#increment_signature_count

Total Score: 3.5

Score Operator
1.0 assignment
1.2 last_signed_at
1.2 updated_at
1.0 update_all

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::unrecordable?

Total Score: 13.7

Score Operator
4.8 branch
3.3 nil?
1.9 petition
2.0 constituency_id
1.8 blank?
2.0 validated_at?
1.8 !

app/models/country_petition_journal.rb

CountryPetitionJournal::unrecordable?

Total Score: 13.7

Score Operator
4.8 branch
3.3 nil?
1.9 petition
2.0 location_code
1.8 blank?
2.0 validated_at?
1.8 !

app/models/country_petition_journal.rb

CountryPetitionJournal#none

Total Score: 13.5

Score Operator
2.0 belongs_to
3.0 validates
1.0 delegate
2.5 private
5.0 sclass

CountryPetitionJournal#update_all

Total Score: 6.6

Score Operator
1.6 class
1.4 unscoped
1.4 id
1.2 where
1.0 update_all

CountryPetitionJournal#decrement_signature_count

Total Score: 3.8

Score Operator
3.0 assignment
1.0 current
0.3 lit_fixnum
1.0 update_all

CountryPetitionJournal#reset_signature_count

Total Score: 3.5

Score Operator
1.0 assignment
1.2 last_signed_at
1.2 updated_at
1.0 update_all

CountryPetitionJournal#increment_signature_count

Total Score: 3.5

Score Operator
1.0 assignment
1.2 last_signed_at
1.2 updated_at
1.0 update_all

app/controllers/admin/signatures_controller.rb

Admin::SignaturesController#bulk_invalidate

Total Score: 13.3

Score Operator
1.0 branch
1.4 scope
1.4 selected_ids
1.2 invalidate!
3.1 search_params
2.7 index_url
2.3 redirect_to
1.1 assignment
1.1 send_exception

Admin::SignaturesController#bulk_subscribe

Total Score: 13.3

Score Operator
1.0 branch
1.4 scope
1.4 selected_ids
1.2 subscribe!
3.1 search_params
2.7 index_url
2.3 redirect_to
1.1 assignment
1.1 send_exception

Admin::SignaturesController#bulk_destroy

Total Score: 13.3

Score Operator
1.0 branch
1.4 scope
1.4 selected_ids
1.2 destroy!
3.1 search_params
2.7 index_url
2.3 redirect_to
1.1 assignment
1.1 send_exception

Admin::SignaturesController#bulk_validate

Total Score: 13.3

Score Operator
1.0 branch
1.4 scope
1.4 selected_ids
1.2 validate!
3.1 search_params
2.7 index_url
2.3 redirect_to
1.1 assignment
1.1 send_exception

Admin::SignaturesController#bulk_unsubscribe

Total Score: 13.3

Score Operator
1.0 branch
1.4 scope
1.4 selected_ids
1.2 unsubscribe!
3.1 search_params
2.7 index_url
2.3 redirect_to
1.1 assignment
1.1 send_exception

Admin::SignaturesController#invalidate

Total Score: 10.5

Score Operator
1.0 branch
1.2 invalidate!
1.6 search_params
2.7 index_url
2.3 redirect_to
1.1 assignment
1.1 send_exception
1.5 email

Admin::SignaturesController#validate

Total Score: 10.5

Score Operator
1.0 branch
1.2 validate!
3.1 search_params
2.7 index_url
2.3 redirect_to
1.1 assignment
1.1 send_exception

Admin::SignaturesController#destroy

Total Score: 8.9

Score Operator
1.0 branch
1.0 destroy
3.0 search_params
2.6 index_url
2.2 redirect_to

Admin::SignaturesController#subscribe

Total Score: 8.9

Score Operator
1.0 branch
1.0 update
3.0 search_params
2.6 admin_signatures_url
2.2 redirect_to

Admin::SignaturesController#unsubscribe

Total Score: 8.9

Score Operator
1.0 branch
1.0 update
3.0 search_params
2.6 index_url
2.2 redirect_to

Admin::SignaturesController#none

Total Score: 7.0

Score Operator
2.0 include
3.0 before_action
1.0 helper_method
1.0 private

Admin::SignaturesController#fetch_signatures

Total Score: 6.1

Score Operator
1.0 assignment
1.2 scope
1.4 params
1.2 []
1.2 search_params
1.0 search

Admin::SignaturesController#fetch_signature

Total Score: 4.9

Score Operator
1.0 assignment
1.2 scope
1.4 params
1.2 []
1.0 find

Admin::SignaturesController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::SignaturesController#scope

Total Score: 3.4

Score Operator
1.0 branch
1.2 params
1.0 key?
1.1 signatures

Admin::SignaturesController#index_url

Total Score: 3.4

Score Operator
1.0 branch
1.0 petition_scope?
1.1 admin_petition_signatures_url
1.1 admin_signatures_url

Admin::SignaturesController#index

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::SignaturesController#search_params

Total Score: 2.2

Score Operator
1.2 params
1.0 slice

Admin::SignaturesController#petition_scope?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

app/helpers/home_helper.rb

HomeHelper#fetch_trending_petitions

Total Score: 13.2

Score Operator
1.0 branch
1.2 cache
0.4 lit_fixnum
1.2 minutes
1.0 fetch
2.4 assignment
1.4 arel_table
1.2 []
1.4 count
1.2 as
1.4 trending
1.4 to_sql
1.2 pluck

HomeHelper#trending_petitions

Total Score: 5.3

Score Operator
2.2 branch
1.0 disable_trending_petitions?
1.2 assignment
1.2 fetch_trending_petitions
1.2 empty?
1.3 yield

HomeHelper#any_actioned_petitions?

Total Score: 3.6

Score Operator
1.4 actioned_petitions_decorator
1.2 empty?
1.0 !

HomeHelper#actioned_petitions

Total Score: 3.4

Score Operator
1.0 assignment
1.0 actioned_petitions_decorator
1.0 branch
1.0 empty?
1.1 yield

HomeHelper#no_petitions_yet?

Total Score: 2.6

Score Operator
1.0 branch
1.0 assignment
1.2 visible
1.0 empty?

HomeHelper#petition_count

Total Score: 2.2

Score Operator
1.2 number_with_delimiter
1.0 t

HomeHelper#explanation_petitions

Total Score: 2.0

Score Operator
1.0 yield
1.0 actioned_petitions_decorator

HomeHelper#none

Total Score: 2.0

Score Operator
2.0 private

HomeHelper#actioned_petitions_decorator

Total Score: 1.4

Score Operator
1.0 assignment
1.0 new

NotifyTrendingIpJob#message

Total Score: 13.1

Score Operator
1.1 assignment
1.3 count
5.5 <<
1.3 start_time
1.3 end_time
1.3 petition_link
1.3 ip_address_link
1.1 %

NotifyTrendingIpJob#none

Total Score: 10.0

Score Operator
1.7 application
1.5 routes
1.3 url_helpers
2.2 include
1.1 queue_as
1.1 delegate
1.1 private

NotifyTrendingIpJob#ip_address_link

Total Score: 6.1

Score Operator
1.3 petition
2.4 ip_address
1.3 window
1.1 admin_petition_signatures_url

NotifyTrendingIpJob#petition_link

Total Score: 4.8

Score Operator
2.6 petition
1.1 admin_petition_url
1.1 action

NotifyTrendingIpJob#end_time

Total Score: 3.7

Score Operator
1.3 ends_at
1.3 time_format
1.1 strftime

NotifyTrendingIpJob#perform

Total Score: 3.7

Score Operator
1.3 slack
1.3 message
1.1 ping

NotifyTrendingIpJob#start_time

Total Score: 3.7

Score Operator
1.3 starts_at
1.3 time_format
1.1 strftime

NotifyTrendingIpJob#slack

Total Score: 2.6

Score Operator
1.1 assignment
1.3 trending_items_notification_url
1.1 new

NotifyTrendingIpJob#rate_limit

Total Score: 1.6

Score Operator
1.1 assignment
1.1 first_or_create!

NotifyTrendingDomainJob#message

Total Score: 13.1

Score Operator
1.1 assignment
1.3 count
5.5 <<
1.3 start_time
1.3 end_time
1.3 petition_link
1.3 domain_address_link
1.1 %

NotifyTrendingDomainJob#none

Total Score: 10.0

Score Operator
1.7 application
1.5 routes
1.3 url_helpers
2.2 include
1.1 queue_as
1.1 delegate
1.1 private

NotifyTrendingDomainJob#domain_address_link

Total Score: 6.1

Score Operator
1.3 petition
2.4 domain
1.3 window
1.1 admin_petition_signatures_url

NotifyTrendingDomainJob#petition_link

Total Score: 4.8

Score Operator
2.6 petition
1.1 admin_petition_url
1.1 action

NotifyTrendingDomainJob#end_time

Total Score: 3.7

Score Operator
1.3 ends_at
1.3 time_format
1.1 strftime

NotifyTrendingDomainJob#start_time

Total Score: 3.7

Score Operator
1.3 starts_at
1.3 time_format
1.1 strftime

NotifyTrendingDomainJob#perform

Total Score: 3.7

Score Operator
1.3 slack
1.3 message
1.1 ping

NotifyTrendingDomainJob#slack

Total Score: 2.6

Score Operator
1.1 assignment
1.3 trending_items_notification_url
1.1 new

NotifyTrendingDomainJob#rate_limit

Total Score: 1.6

Score Operator
1.1 assignment
1.1 first_or_create!

app/controllers/concerns/flash_i18n.rb

FlashI18n#redirect_to

Total Score: 13.1

Score Operator
4.4 assignment
4.2 branch
1.4 class
1.2 _flash_types
2.1 each
1.1 key?
2.4 []
2.4 translate_flash
1.0 super

FlashI18n#translate_flash

Total Score: 8.8

Score Operator
2.1 branch
2.1 ===
1.2 assignment
1.2 extract_options!
1.4 first
1.4 merge
2.4 t

FlashI18n#none

Total Score: 1.0

Score Operator
1.0 protected

app/models/archived/signature.rb

Archived::Signature::batch

Total Score: 13.1

Score Operator
1.6 assignment
0.4 lit_fixnum
2.6 arel_table
2.4 []
2.2 gteq
2.0 where
1.8 order
1.6 limit

app/models/petition.rb

Petition::in_need_of_closing

Total Score: 13.1

Score Operator
1.6 assignment
1.6 current
3.4 where
2.2 arel_table
2.0 []
2.0 opened_at_for_closing
1.8 lt

app/models/signature.rb

Signature::batch

Total Score: 13.1

Score Operator
1.6 assignment
0.4 lit_fixnum
2.6 arel_table
2.4 []
2.2 gt
2.0 where
1.8 order
1.6 limit

app/helpers/home_helper.rb

HomeHelper::ActionedPetitionsDecorator#generate_actioned

Total Score: 12.8

Score Operator
6.4 assignment
0.3 lit_fixnum
1.0 visible
1.0 facet_definitions
1.0 branch
1.0 each_with_object
1.4 block_pass
1.4 to_proc_normal
1.4 []
1.2 instance_exec
1.2 count
1.2 limit

HomeHelper::ActionedPetitionsDecorator#empty?

Total Score: 4.7

Score Operator
1.0 branch
1.2 actioned
1.0 all?
1.3 []
1.1 zero?

HomeHelper::ActionedPetitionsDecorator#with_result

Total Score: 4.4

Score Operator
2.4 actioned
2.0 []

HomeHelper::ActionedPetitionsDecorator#[]

Total Score: 2.2

Score Operator
1.2 actioned
1.0 fetch

HomeHelper::ActionedPetitionsDecorator#none

Total Score: 2.0

Score Operator
1.0 delegate
1.0 private

HomeHelper::ActionedPetitionsDecorator#actioned

Total Score: 1.4

Score Operator
1.0 assignment
1.0 generate_actioned

app/models/location.rb

Location::not_pending

Total Score: 12.8

Score Operator
1.5 assignment
1.5 current
4.2 start_date
1.9 eq
1.9 lteq
1.7 or
1.5 where

app/models/location.rb

Location::not_expired

Total Score: 12.8

Score Operator
1.5 assignment
1.5 current
4.2 end_date
1.9 eq
1.9 gt
1.7 or
1.5 where

app/lib/active_support/cache/atomic_dalli_store.rb

ActiveSupport::Cache::AtomicDalliStore#fetch

Total Score: 12.7

Score Operator
3.9 assignment
5.3 branch
1.1 block_given?
2.5 read
1.3 nil?
2.9 instrument
1.6 yield
1.5 write

ActiveSupport::Cache::AtomicDalliStore#ttl_add

Total Score: 11.9

Score Operator
4.7 branch
1.2 with
0.4 lit_fixnum
1.3 add
1.2 assignment
2.7 logger
1.5 message
1.3 error
1.2 raise_errors?
1.3 raise

ActiveSupport::Cache::AtomicDalliStore#ttl_get

Total Score: 11.6

Score Operator
4.7 branch
1.2 with
1.3 get
1.2 assignment
2.7 logger
1.5 message
1.3 error
1.2 raise_errors?
1.3 raise

ActiveSupport::Cache::AtomicDalliStore#ttl_delete

Total Score: 11.6

Score Operator
4.7 branch
1.2 with
1.3 delete
1.2 assignment
2.7 logger
1.5 message
1.3 error
1.2 raise_errors?
1.3 raise

ActiveSupport::Cache::AtomicDalliStore#ttl_set

Total Score: 11.6

Score Operator
4.7 branch
1.2 with
1.3 set
1.2 assignment
2.7 logger
1.5 message
1.3 error
1.2 raise_errors?
1.3 raise

ActiveSupport::Cache::AtomicDalliStore#write

Total Score: 8.6

Score Operator
3.4 assignment
4.5 branch
1.3 []
1.1 zero?
0.4 lit_fixnum
1.2 +
1.4 ttl_key
1.2 ttl_set

ActiveSupport::Cache::AtomicDalliStore#read

Total Score: 5.2

Score Operator
1.1 assignment
3.6 branch
1.1 tap
1.2 present?
1.3 lock!

ActiveSupport::Cache::AtomicDalliStore#lock!

Total Score: 3.7

Score Operator
1.1 assignment
1.1 ttl_key
1.1 branch
1.1 ttl_get
1.2 ttl_add

ActiveSupport::Cache::AtomicDalliStore#delete

Total Score: 3.0

Score Operator
1.1 assignment
1.1 branch
1.4 ttl_key
1.2 ttl_delete

ActiveSupport::Cache::AtomicDalliStore#ttl_key

Total Score: 1.1

Score Operator
1.1 namespaced_key

ActiveSupport::Cache::AtomicDalliStore#none

Total Score: 1.1

Score Operator
1.1 private

app/models/archived/signature.rb

Archived::Signature::for_timestamp

Total Score: 12.7

Score Operator
1.6 assignment
1.8 arel_table
1.8 column_name_for
1.6 []
2.0 eq
2.0 lt
1.8 or
1.6 where

app/models/signature.rb

Signature::for_timestamp

Total Score: 12.7

Score Operator
1.6 assignment
1.8 arel_table
1.8 column_name_for
1.6 []
2.0 eq
2.0 lt
1.8 or
1.6 where

app/helpers/date_time_helper.rb

DateTimeHelper#waiting_for_in_words

Total Score: 12.7

Score Operator
4.0 assignment
1.0 current
1.0 branch
1.0 present?
3.2 end_of_day
1.4 -
1.2 /
1.0 round
1.0 []
1.2 number_with_delimiter
1.0 t

DateTimeHelper#scheduled_for_debate_in_words

Total Score: 7.5

Score Operator
4.0 assignment
1.0 current
1.2 -
1.0 to_i
1.0 []
1.2 short_date_format
1.0 t

DateTimeHelper#api_date_format

Total Score: 5.7

Score Operator
2.1 branch
1.1 respond_to?
1.4 getutc
0.4 lit_fixnum
1.2 iso8601
1.2 strftime

DateTimeHelper#none

Total Score: 5.0

Score Operator
2.4 new
0.6 lit_fixnum
2.0 merge

DateTimeHelper#date_time_format

Total Score: 4.0

Score Operator
3.2 branch
2.4 strftime

DateTimeHelper#local_date_time_format

Total Score: 2.6

Score Operator
1.0 branch
1.3 in_time_zone
1.1 strftime

DateTimeHelper#last_updated_at_time

Total Score: 2.6

Score Operator
1.0 branch
1.3 in_time_zone
1.1 strftime

DateTimeHelper#easter_period?

Total Score: 2.2

Score Operator
1.0 assignment
1.0 current
1.0 easter?

DateTimeHelper#christmas_period?

Total Score: 2.2

Score Operator
1.0 assignment
1.0 current
1.0 christmas?

DateTimeHelper#short_date_format

Total Score: 1.5

Score Operator
1.0 branch
1.1 strftime

DateTimeHelper#short_date_time_format

Total Score: 1.5

Score Operator
1.0 branch
1.1 strftime

DateTimeHelper#date_format

Total Score: 1.5

Score Operator
1.0 branch
1.1 strftime

DateTimeHelper#date_format_admin

Total Score: 1.5

Score Operator
1.0 branch
1.1 strftime

app/models/archived/signature.rb

Archived::Signature::normalize_user

Total Score: 12.6

Score Operator
4.8 split
4.4 first
1.8 tr
1.6 downcase

app/models/signature.rb

Signature::normalize_user

Total Score: 12.6

Score Operator
4.8 split
4.4 first
1.8 tr
1.6 downcase

app/controllers/admin/petition_emails_controller.rb

Admin::PetitionEmailsController#update

Total Score: 12.6

Score Operator
3.5 branch
1.2 email_params
1.0 update
1.2 send_email_to_petitioners?
1.4 schedule_email_petitioners_job
2.9 send_preview_email
4.3 assignment
1.3 send_preview_email?
1.2 redirect_to
1.1 render

Admin::PetitionEmailsController#create

Total Score: 12.6

Score Operator
3.5 branch
1.2 email_params
1.0 update
1.2 send_email_to_petitioners?
1.4 schedule_email_petitioners_job
2.9 send_preview_email
4.3 assignment
1.3 send_preview_email?
1.2 redirect_to
1.1 render

Admin::PetitionEmailsController#email_params

Total Score: 7.8

Score Operator
1.6 params
1.4 require
1.2 permit
1.4 current_user
1.2 pretty_name
1.0 merge

Admin::PetitionEmailsController#fetch_email

Total Score: 4.9

Score Operator
1.0 assignment
1.2 emails
1.4 params
1.2 []
1.0 find

Admin::PetitionEmailsController#fetch_petition

Total Score: 4.9

Score Operator
1.0 assignment
1.2 moderated
1.4 params
1.2 []
1.0 find

Admin::PetitionEmailsController#none

Total Score: 4.0

Score Operator
3.0 before_action
1.0 private

Admin::PetitionEmailsController#send_preview_email

Total Score: 3.6

Score Operator
1.4 feedback_signature
1.2 email_signer
1.0 deliver_now

Admin::PetitionEmailsController#destroy

Total Score: 3.1

Score Operator
1.0 branch
1.0 destroy
2.2 assignment
1.0 redirect_to

Admin::PetitionEmailsController#build_email

Total Score: 2.4

Score Operator
1.0 assignment
1.2 emails
1.0 build

Admin::PetitionEmailsController#send_email_to_petitioners?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::PetitionEmailsController#send_preview_email?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::PetitionEmailsController#schedule_email_petitioners_job

Total Score: 1.0

Score Operator
1.0 run_later_tonight

Admin::PetitionEmailsController#new

Total Score: 1.0

Score Operator
1.0 render

Admin::PetitionEmailsController#feedback_signature

Total Score: 1.0

Score Operator
1.0 new

app/helpers/cache_helper.rb

CacheHelper#csv_cache

Total Score: 12.4

Score Operator
2.4 assignment
2.2 branch
2.8 controller
1.2 respond_to?
1.2 perform_caching
1.3 expand_cache_key
1.5 cache
1.5 block_pass
1.3 fetch
1.2 yield

CacheHelper#cache_for

Total Score: 3.7

Score Operator
1.3 build
1.3 block_pass
1.1 cache

CacheHelper#last_signature_at

Total Score: 1.6

Score Operator
1.1 assignment
1.1 maximum

CacheHelper#last_government_response_updated_at

Total Score: 1.6

Score Operator
1.1 assignment
1.1 maximum

CacheHelper#last_debate_outcome_updated_at

Total Score: 1.6

Score Operator
1.1 assignment
1.1 maximum

app/models/petition.rb

Petition::in_need_of_validating

Total Score: 12.4

Score Operator
2.4 last_signed_at
2.4 signature_count_validated_at
2.2 gt
2.0 grouping
1.8 eq
1.6 where

app/mailers/petition_mailer.rb

PetitionMailer#i18n_options

Total Score: 12.3

Score Operator
4.6 branch
1.0 tap
8.0 assignment
3.0 signature_count
1.4 number_to_delimited
1.4 action
1.3 subject

PetitionMailer#notify_creator_of_closing_date_change

Total Score: 11.9

Score Operator
7.0 assignment
1.0 dissolution_at
1.0 petition
3.0 strftime
1.2 yesterday
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#notify_creator_of_debate_outcome

Total Score: 9.9

Score Operator
6.2 assignment
1.0 debate_outcome
1.0 branch
1.0 debated?
2.2 subject_for
1.2 email
1.2 unsubscribe_url
1.0 mail

PetitionMailer#notify_signer_of_debate_outcome

Total Score: 9.9

Score Operator
6.2 assignment
1.0 debate_outcome
1.0 branch
1.0 debated?
2.2 subject_for
1.2 email
1.2 unsubscribe_url
1.0 mail

PetitionMailer#notify_creator_that_moderation_is_delayed

Total Score: 8.2

Score Operator
6.0 assignment
1.0 petition
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

PetitionMailer#notify_sponsor_that_petition_was_rejected

Total Score: 7.7

Score Operator
4.0 assignment
2.2 petition
1.0 rejection
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#notify_creator_that_petition_was_rejected

Total Score: 7.7

Score Operator
4.0 assignment
2.2 petition
1.0 rejection
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#notify_creator_of_threshold_response

Total Score: 6.9

Score Operator
4.0 assignment
1.0 government_response
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

PetitionMailer#notify_signer_of_threshold_response

Total Score: 6.9

Score Operator
4.0 assignment
1.0 government_response
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

PetitionMailer#notify_creator_that_petition_is_published

Total Score: 6.4

Score Operator
3.0 assignment
1.0 petition
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

PetitionMailer#email_signer

Total Score: 6.1

Score Operator
4.0 assignment
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

PetitionMailer#email_creator

Total Score: 6.1

Score Operator
4.0 assignment
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

PetitionMailer#gather_sponsors_for_petition

Total Score: 5.9

Score Operator
4.0 assignment
1.0 creator
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#notify_signer_of_debate_scheduled

Total Score: 5.5

Score Operator
3.0 assignment
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

PetitionMailer#notify_creator_of_debate_scheduled

Total Score: 5.5

Score Operator
3.0 assignment
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

PetitionMailer#notify_creator_of_sponsored_petition_being_stopped

Total Score: 5.3

Score Operator
3.0 assignment
1.0 petition
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#notify_creator_of_validated_petition_being_stopped

Total Score: 5.3

Score Operator
3.0 assignment
1.0 petition
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#notify_sponsor_that_petition_is_published

Total Score: 5.3

Score Operator
3.0 assignment
1.0 petition
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#email_confirmation_for_signer

Total Score: 5.3

Score Operator
3.0 assignment
1.0 petition
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#special_resend_of_email_confirmation_for_signer

Total Score: 5.3

Score Operator
3.0 assignment
1.0 petition
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#email_duplicate_signatures

Total Score: 5.3

Score Operator
3.0 assignment
1.0 petition
1.2 email
1.2 subject_for
1.0 mail

PetitionMailer#subject_for

Total Score: 3.7

Score Operator
1.0 assignment
1.4 i18n_options
1.2 merge
1.0 t

PetitionMailer#none

Total Score: 3.0

Score Operator
2.0 include
1.0 private

PetitionMailer#unsubscribe_url

Total Score: 2.2

Score Operator
1.2 unsubscribe_token
1.0 unsubscribe_signature_url

PetitionMailer#signature_belongs_to_creator?

Total Score: 1.5

Score Operator
1.0 branch
1.1 creator?

app/validators/email_validator.rb

EmailValidator#validate_each

Total Score: 12.3

Score Operator
3.4 branch
1.1 =~
1.3 assignment
1.3 parsed_email
1.3 plus_address?
4.3 errors
3.7 add

EmailValidator#plus_address?

Total Score: 3.5

Score Operator
1.0 branch
1.0 disable_plus_address_check?
1.3 local
1.1 include?

EmailValidator#parsed_email

Total Score: 1.0

Score Operator
1.0 new

app/models/archived/signature.rb

Archived::Signature::for_name

Total Score: 12.0

Score Operator
2.4 arel_table
2.2 []
2.0 lower
2.0 downcase
1.8 eq
1.6 where

app/models/signature.rb

Signature::for_name

Total Score: 12.0

Score Operator
2.4 arel_table
2.2 []
2.0 lower
2.0 downcase
1.8 eq
1.6 where

TrendingIp#none

Total Score: 12.0

Score Operator
1.0 belongs_to
4.0 validates
1.0 attr_readonly
5.0 sclass
1.0 private

TrendingIp#window

Total Score: 3.6

Score Operator
1.4 starts_at
1.2 getutc
1.0 iso8601

TrendingIp#ends_at

Total Score: 2.5

Score Operator
1.2 starts_at
0.3 lit_fixnum
1.0 advance

TrendingIp#geoip_db

Total Score: 2.4

Score Operator
1.0 assignment
1.2 fetch
1.0 new

app/controllers/admin/invalidations_controller.rb

Admin::InvalidationsController#update

Total Score: 11.9

Score Operator
4.6 branch
1.0 pending?
1.3 invalidation_params
1.1 update
1.4 admin_invalidations_url
1.2 redirect_to
1.2 respond_to
1.3 html
1.4 render
1.1 redirect_to_index_url

Admin::InvalidationsController#count

Total Score: 8.9

Score Operator
2.1 branch
1.0 pending?
1.1 count!
1.6 summary
1.4 inspect
3.5 redirect_to_index_url

Admin::InvalidationsController#start

Total Score: 8.9

Score Operator
2.1 branch
1.0 pending?
1.1 start!
1.6 summary
1.4 inspect
3.5 redirect_to_index_url

Admin::InvalidationsController#create

Total Score: 7.7

Score Operator
3.3 branch
1.0 save
1.3 admin_invalidations_url
1.1 redirect_to
1.1 respond_to
1.2 html
1.3 render

Admin::InvalidationsController#invalidation_params

Total Score: 7.5

Score Operator
1.0 branch
2.7 params
1.0 key?
1.3 require
1.3 invalidation_attributes
1.1 permit

Admin::InvalidationsController#cancel

Total Score: 6.0

Score Operator
2.1 branch
1.0 completed?
3.5 redirect_to_index_url
1.1 cancel!

Admin::InvalidationsController#destroy

Total Score: 6.0

Score Operator
2.1 branch
1.0 started?
3.5 redirect_to_index_url
1.1 destroy

Admin::InvalidationsController#none

Total Score: 5.0

Score Operator
4.0 before_action
1.0 private

Admin::InvalidationsController#edit

Total Score: 4.9

Score Operator
2.1 branch
1.0 pending?
1.1 respond_to
1.2 html
1.1 redirect_to_index_url

Admin::InvalidationsController#find_invalidation

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::InvalidationsController#index_url

Total Score: 3.6

Score Operator
1.4 params
1.2 slice
1.0 admin_invalidations_url

Admin::InvalidationsController#find_invalidations

Total Score: 2.4

Score Operator
1.0 assignment
1.2 params
1.0 search

Admin::InvalidationsController#build_invalidation

Total Score: 2.4

Score Operator
1.0 assignment
1.2 invalidation_params
1.0 new

Admin::InvalidationsController#redirect_to_index_url

Total Score: 2.4

Score Operator
1.0 assignment
1.2 index_url
1.0 redirect_to

Admin::InvalidationsController#new

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::InvalidationsController#index

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::InvalidationsController#invalidation_attributes

Total Score: 1.0

Score Operator
1.0 +

app/controllers/admin/archived/signatures_controller.rb

Admin::Archived::SignaturesController#bulk_unsubscribe

Total Score: 11.9

Score Operator
1.0 branch
1.4 selected_ids
1.2 unsubscribe!
3.1 search_params
2.7 admin_archived_signatures_url
2.3 redirect_to
1.1 assignment
1.1 send_exception

Admin::Archived::SignaturesController#bulk_subscribe

Total Score: 11.9

Score Operator
1.0 branch
1.4 selected_ids
1.2 subscribe!
3.1 search_params
2.7 admin_archived_signatures_url
2.3 redirect_to
1.1 assignment
1.1 send_exception

Admin::Archived::SignaturesController#bulk_destroy

Total Score: 11.9

Score Operator
1.0 branch
1.4 selected_ids
1.2 destroy!
3.1 search_params
2.7 admin_archived_signatures_url
2.3 redirect_to
1.1 assignment
1.1 send_exception

Admin::Archived::SignaturesController#destroy

Total Score: 8.9

Score Operator
1.0 branch
1.0 destroy
3.0 search_params
2.6 admin_archived_signatures_url
2.2 redirect_to

Admin::Archived::SignaturesController#unsubscribe

Total Score: 8.9

Score Operator
1.0 branch
1.0 update
3.0 search_params
2.6 admin_archived_signatures_url
2.2 redirect_to

Admin::Archived::SignaturesController#subscribe

Total Score: 8.9

Score Operator
1.0 branch
1.0 update
3.0 search_params
2.6 admin_archived_signatures_url
2.2 redirect_to

Admin::Archived::SignaturesController#none

Total Score: 6.0

Score Operator
2.0 include
2.0 before_action
1.0 helper_method
1.0 private

Admin::Archived::SignaturesController#fetch_signatures

Total Score: 4.9

Score Operator
1.0 assignment
1.4 params
1.2 []
1.2 search_params
1.0 search

Admin::Archived::SignaturesController#fetch_signature

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::Archived::SignaturesController#index

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::Archived::SignaturesController#search_params

Total Score: 2.2

Score Operator
1.2 params
1.0 slice

app/controllers/admin/sites_controller.rb

Admin::SitesController#update

Total Score: 11.9

Score Operator
3.3 branch
1.2 site_params
1.0 update
1.7 params
1.5 []
1.3 edit_admin_site_url
1.1 redirect_to
1.1 respond_to
1.2 html
1.3 render

Admin::SitesController#site_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::SitesController#none

Total Score: 3.0

Score Operator
2.0 before_action
1.0 private

Admin::SitesController#edit

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::SitesController#fetch_site

Total Score: 1.4

Score Operator
1.0 assignment
1.0 instance

app/controllers/admin/rate_limits_controller.rb

Admin::RateLimitsController#update

Total Score: 11.9

Score Operator
3.3 branch
1.2 rate_limit_params
1.0 update
1.7 params
1.5 []
1.3 edit_admin_rate_limits_url
1.1 redirect_to
1.1 respond_to
1.2 html
1.3 render

Admin::RateLimitsController#rate_limit_params

Total Score: 4.8

Score Operator
1.4 params
1.2 require
1.2 rate_limit_attributes
1.0 permit

Admin::RateLimitsController#none

Total Score: 3.0

Score Operator
2.0 before_action
1.0 private

Admin::RateLimitsController#edit

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::RateLimitsController#find_rate_limit

Total Score: 1.4

Score Operator
1.0 assignment
1.0 first_or_create!

app/helpers/petition_helper.rb

PetitionHelper#signatures_threshold_percentage

Total Score: 11.7

Score Operator
4.3 assignment
1.2 current_threshold
1.0 to_f
1.4 signature_count
1.2 /
1.8 lit_fixnum
1.0 *
2.1 branch
1.0 >
1.1 <
1.0 number_to_percentage

PetitionHelper#current_threshold

Total Score: 4.8

Score Operator
2.0 branch
1.1 response_threshold_reached_at?
1.1 government_response_at?
1.1 threshold_for_debate
1.1 threshold_for_response

PetitionHelper#reveal_government_response?

Total Score: 3.6

Score Operator
1.4 params
1.2 []
1.0 ==

PetitionHelper#public_petition_facets_with_counts

Total Score: 3.4

Score Operator
1.2 facets
1.2 public_petition_facets
1.0 slice

PetitionHelper#petition_list_header

Total Score: 2.4

Score Operator
1.0 assignment
1.2 scope
1.0 t

PetitionHelper#petition_list_header?

Total Score: 2.2

Score Operator
1.2 petition_list_header
1.0 present?

app/models/parliament.rb

Parliament::archived

Total Score: 11.7

Score Operator
1.6 assignment
1.6 current
2.4 arel_table
2.2 []
2.0 lteq
1.8 where
1.6 order

app/models/signature.rb

Signature::missing_constituency_id

Total Score: 11.5

Score Operator
1.6 branch
4.2 uk
3.8 validated
3.4 where

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::older_than

Total Score: 11.2

Score Operator
4.2 last_signed_at
1.9 lt
1.9 eq
1.7 or
1.5 where

app/models/country_petition_journal.rb

CountryPetitionJournal::older_than

Total Score: 11.2

Score Operator
4.2 last_signed_at
1.9 lt
1.9 eq
1.7 or
1.5 where

app/mailers/archived/petition_mailer.rb

Archived::PetitionMailer#i18n_options

Total Score: 11.0

Score Operator
3.4 branch
1.0 tap
6.7 assignment
3.0 signature_count
1.4 number_to_delimited
1.4 action
1.3 subject

Archived::PetitionMailer#notify_creator_of_debate_outcome

Total Score: 9.9

Score Operator
6.2 assignment
1.0 debate_outcome
1.0 branch
1.0 debated?
2.2 subject_for
1.2 email
1.2 unsubscribe_url
1.0 mail

Archived::PetitionMailer#notify_signer_of_debate_outcome

Total Score: 9.9

Score Operator
6.2 assignment
1.0 debate_outcome
1.0 branch
1.0 debated?
2.2 subject_for
1.2 email
1.2 unsubscribe_url
1.0 mail

Archived::PetitionMailer#notify_signer_of_threshold_response

Total Score: 8.9

Score Operator
6.0 assignment
1.0 government_response
1.0 parliament
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

Archived::PetitionMailer#notify_creator_of_threshold_response

Total Score: 8.9

Score Operator
6.0 assignment
1.0 government_response
1.0 parliament
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

Archived::PetitionMailer#email_signer

Total Score: 6.1

Score Operator
4.0 assignment
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

Archived::PetitionMailer#email_creator

Total Score: 6.1

Score Operator
4.0 assignment
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

Archived::PetitionMailer#notify_creator_of_debate_scheduled

Total Score: 5.5

Score Operator
3.0 assignment
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

Archived::PetitionMailer#notify_signer_of_debate_scheduled

Total Score: 5.5

Score Operator
3.0 assignment
1.2 email
1.2 subject_for
1.2 unsubscribe_url
1.0 mail

Archived::PetitionMailer#subject_for

Total Score: 3.7

Score Operator
1.0 assignment
1.4 i18n_options
1.2 merge
1.0 t

Archived::PetitionMailer#none

Total Score: 3.0

Score Operator
2.0 include
1.0 private

Archived::PetitionMailer#unsubscribe_url

Total Score: 2.2

Score Operator
1.2 unsubscribe_token
1.0 unsubscribe_archived_signature_url

Archived::PetitionMailer#signature_belongs_to_creator?

Total Score: 1.5

Score Operator
1.0 branch
1.1 creator?

app/jobs/concerns/email_all_petition_signatories.rb

EmailAllPetitionSignatories::ClassMethods#run_later_tonight

Total Score: 11.0

Score Operator
3.0 assignment
1.0 []
1.2 timestamp_name
1.2 requested_at
1.0 set_email_requested_at_for
1.4 later_tonight
1.2 set
1.4 requested_at_iso8601
1.2 merge
1.0 perform_later

EmailAllPetitionSignatories::ClassMethods#random_interval

Total Score: 7.0

Score Operator
0.8 lit_fixnum
2.8 rand
1.2 minutes
1.2 seconds
1.0 +

EmailAllPetitionSignatories::ClassMethods#requested_at_iso8601

Total Score: 3.9

Score Operator
1.4 requested_at
1.2 getutc
0.3 lit_fixnum
1.0 iso8601

EmailAllPetitionSignatories::ClassMethods#later_tonight

Total Score: 3.4

Score Operator
1.2 midnight
1.2 random_interval
1.0 +

EmailAllPetitionSignatories::ClassMethods#midnight

Total Score: 2.2

Score Operator
1.2 requested_at
1.0 end_of_day

EmailAllPetitionSignatories::ClassMethods#requested_at

Total Score: 1.4

Score Operator
1.0 assignment
1.0 current

EmailAllPetitionSignatories::ClassMethods#none

Total Score: 1.0

Score Operator
1.0 private

lib/health_check.rb

HealthCheck#checkup

Total Score: 11.0

Score Operator
3.2 assignment
2.0 branch
2.0 each
7.2 send
1.1 stringify

HealthCheck#database_persistence

Total Score: 5.8

Score Operator
4.6 branch
1.2 database_connection
1.2 first_or_create
1.2 last_checked_at!

HealthCheck#utctime

Total Score: 3.6

Score Operator
1.4 current
1.2 getutc
1.0 rfc2822

HealthCheck#database_integrity

Total Score: 3.4

Score Operator
1.0 branch
1.0 database_connection
1.2 needs_migration?
1.0 !

HealthCheck#database_connection

Total Score: 2.6

Score Operator
1.0 branch
1.2 establish_connection
1.2 connection

HealthCheck#localtime

Total Score: 2.2

Score Operator
1.2 current
1.0 rfc2822

HealthCheck#url

Total Score: 1.0

Score Operator
1.0 fetch

HealthCheck#client_ip

Total Score: 1.0

Score Operator
1.0 fetch

HealthCheck#none

Total Score: 1.0

Score Operator
1.0 private

HealthCheck#stringify

Total Score: 1.0

Score Operator
1.0 branch

HealthCheck#initialize

Total Score: 1.0

Score Operator
1.0 assignment

HealthCheck#hostname

Total Score: 1.0

Score Operator
1.0 gethostname

app/controllers/admin/user_sessions_controller.rb

Admin::UserSessionsController#create

Total Score: 11.0

Score Operator
1.0 assignment
1.2 user_session_params
1.0 new
3.3 branch
1.0 save
1.1 redirect_to_target_or_default
1.1 last_login_attempt?
3.8 render
1.2 being_brute_force_protected?

Admin::UserSessionsController#destroy

Total Score: 5.7

Score Operator
1.0 branch
1.0 logged_in?
1.3 current_session
1.1 destroy
1.2 admin_login_url
1.0 redirect_to

Admin::UserSessionsController#user_session_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::UserSessionsController#none

Total Score: 3.0

Score Operator
2.0 skip_before_filter
1.0 private

Admin::UserSessionsController#continue

Total Score: 2.2

Score Operator
1.2 current_user
1.0 touch

Admin::UserSessionsController#last_request_update_allowed?

Total Score: 2.2

Score Operator
1.2 action_name
1.0 !=

Admin::UserSessionsController#new

Total Score: 1.4

Score Operator
1.0 assignment
1.0 new

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::invalidate_signature_for

Total Score: 10.6

Score Operator
1.5 assignment
1.5 current
1.5 branch
1.5 unrecordable?
2.0 petition
2.0 constituency_id
1.8 for
1.6 decrement_signature_count

app/models/country_petition_journal.rb

CountryPetitionJournal::invalidate_signature_for

Total Score: 10.6

Score Operator
1.5 assignment
1.5 current
1.5 branch
1.5 unrecordable?
2.0 petition
2.0 location_code
1.8 for
1.6 decrement_signature_count

app/helpers/cache_helper.rb

CacheHelper::CacheKey#none

Total Score: 10.4

Score Operator
1.1 attr_reader
1.1 delegate
2.7 private
5.5 sclass

CacheHelper::CacheKey#digest_keys

Total Score: 8.4

Score Operator
3.0 keys
1.7 fragment
1.3 for
1.3 dependency_keys
1.1 +

CacheHelper::CacheKey#dependency_keys

Total Score: 6.7

Score Operator
1.1 branch
1.5 dependencies
1.5 name
1.3 for
1.1 map
1.2 version

CacheHelper::CacheKey#cache_key

Total Score: 6.5

Score Operator
2.8 name
1.3 version
1.3 digest
1.1 to_param

CacheHelper::CacheKey#initialize

Total Score: 5.9

Score Operator
4.4 assignment
1.5 fragments
1.3 fetch
1.1 new

CacheHelper::CacheKey#digest

Total Score: 5.6

Score Operator
1.7 digest_keys
1.5 []
1.3 to_param
1.1 hexdigest

CacheHelper::CacheKey#version

Total Score: 4.2

Score Operator
1.5 fragments
2.4 fetch
0.3 lit_fixnum

CacheHelper::CacheKey#keys

Total Score: 2.6

Score Operator
1.1 assignment
1.3 template
1.1 new

CacheHelper::CacheKey#dependencies

Total Score: 2.6

Score Operator
1.1 assignment
1.3 fragments
1.1 new

CacheHelper::CacheKey#fragment_keys

Total Score: 2.4

Score Operator
1.3 fragment
1.1 fetch

CacheHelper::CacheKey#fragments

Total Score: 2.4

Score Operator
1.3 class
1.1 fragments

CacheHelper::CacheKey#build

Total Score: 2.2

Score Operator
1.1 cache_key
1.1 options

app/controllers/archived/petitions_controller.rb

Archived::PetitionsController#fetch_petition

Total Score: 10.4

Score Operator
2.2 assignment
1.3 visible
2.9 petition_id
1.1 find
1.1 parliament
1.1 branch
1.1 archived?
1.4 petition_url
1.2 redirect_to

Archived::PetitionsController#fetch_parliament

Total Score: 9.4

Score Operator
1.1 branch
1.3 params
1.1 key?
2.4 assignment
2.8 archived
1.4 parliament_id
1.2 find
1.2 first

Archived::PetitionsController#none

Total Score: 8.8

Score Operator
5.5 before_action
1.1 after_action
1.1 helper_method
1.1 private

Archived::PetitionsController#redirect_to_valid_state

Total Score: 8.3

Score Operator
2.2 branch
1.2 state_present?
1.4 valid_state?
1.2 !
1.6 search_params
1.4 archived_petitions_url
1.2 redirect_to

Archived::PetitionsController#valid_state?

Total Score: 6.9

Score Operator
1.3 archived_petition_facets
1.7 params
1.5 []
1.3 to_sym
1.1 include?

Archived::PetitionsController#index

Total Score: 5.1

Score Operator
1.1 branch
1.1 respond_to
1.3 html
1.3 json
1.3 csv

Archived::PetitionsController#search_params

Total Score: 4.1

Score Operator
1.1 assignment
1.5 params
1.3 permit
1.1 merge

Archived::PetitionsController#parliament_id

Total Score: 3.9

Score Operator
1.5 params
1.3 []
1.1 to_i

Archived::PetitionsController#petition_id

Total Score: 3.9

Score Operator
1.5 params
1.3 []
1.1 to_i

Archived::PetitionsController#state_present?

Total Score: 3.9

Score Operator
1.5 params
1.3 []
1.1 present?

Archived::PetitionsController#show

Total Score: 3.9

Score Operator
1.1 branch
1.1 respond_to
1.3 html
1.3 json

Archived::PetitionsController#fetch_petitions

Total Score: 3.9

Score Operator
1.1 assignment
1.3 petitions
1.3 params
1.1 search

Archived::PetitionsController#set_content_disposition

Total Score: 3.7

Score Operator
1.1 assignment
1.3 response
1.1 headers
1.1 csv_filename

Archived::PetitionsController#csv_filename

Total Score: 2.2

Score Operator
1.1 scope
1.1 period

Archived::PetitionsController#archived_petition_facets

Total Score: 1.1

Score Operator
1.1 t

TrendingDomain#none

Total Score: 10.3

Score Operator
1.0 belongs_to
0.3 lit_fixnum
3.0 validates
1.0 attr_readonly
5.0 sclass

TrendingDomain#window

Total Score: 3.6

Score Operator
1.4 starts_at
1.2 getutc
1.0 iso8601

TrendingDomain#ends_at

Total Score: 2.5

Score Operator
1.2 starts_at
0.3 lit_fixnum
1.0 advance

app/mailers/sponsor_mailer.rb

SponsorMailer#sponsor_signed_email_below_threshold

Total Score: 10.2

Score Operator
4.0 assignment
1.0 petition
1.4 sponsors
1.2 validated
1.0 count
1.2 name
1.4 creator
1.2 email
1.0 mail

SponsorMailer#sponsor_signed_email_on_threshold

Total Score: 9.1

Score Operator
4.0 assignment
1.0 petition
1.4 sponsors
1.2 validated
1.0 count
1.4 creator
1.2 email
1.0 mail

SponsorMailer#petition_and_email_confirmation_for_sponsor

Total Score: 4.4

Score Operator
3.0 assignment
1.0 petition
1.2 email
1.0 mail

app/models/signature.rb

Signature::invalidate!

Total Score: 10.1

Score Operator
4.8 assignment
1.6 current
1.6 find
3.3 branch
1.6 transaction
1.7 each
1.8 invalidate!

app/helpers/social_meta_helper.rb

SocialMetaHelper#open_graph_tag

Total Score: 10.1

Score Operator
1.0 assignment
2.1 branch
1.0 ===
1.5 merge
1.3 t
3.5 tag
1.1 ==
1.4 url_to_image

SocialMetaHelper#twitter_card_tag

Total Score: 10.1

Score Operator
1.0 assignment
2.1 branch
1.0 ===
1.5 merge
1.3 t
3.5 tag
1.1 ==
1.4 url_to_image

app/controllers/concerns/authentication.rb

Authentication#none

Total Score: 10.0

Score Operator
2.0 extend
1.0 branch
1.0 included
4.8 before_action
1.2 helper_method
1.0 private

Authentication#redirect_to_target_or_default

Total Score: 6.3

Score Operator
1.2 branch
2.5 session
1.3 []
1.3 admin_root_url
1.0 redirect_to
1.0 assignment

Authentication#logout_stale_session

Total Score: 6.2

Score Operator
2.0 branch
3.7 current_session
1.1 stale?
1.1 destroy

Authentication#check_for_password_change

Total Score: 6.2

Score Operator
1.0 branch
2.7 current_user
1.0 has_to_change_password?
1.3 edit_admin_profile_url
1.1 redirect_to

Authentication#require_sysadmin

Total Score: 4.7

Score Operator
1.0 branch
1.2 current_user
1.0 is_a_sysadmin?
1.3 admin_root_url
1.1 redirect_to

Authentication#current_user

Total Score: 4.2

Score Operator
2.0 branch
1.0 assignment
2.4 current_session
1.1 record

Authentication#require_admin

Total Score: 3.5

Score Operator
1.0 branch
1.0 current_user
1.3 admin_login_url
1.1 redirect_to

Authentication#store_target_location

Total Score: 3.4

Score Operator
1.0 assignment
1.0 session
1.2 request
1.0 fullpath

Authentication#current_session

Total Score: 1.7

Score Operator
1.0 branch
1.0 assignment
1.0 find

Authentication#set_login_timeout

Total Score: 1.4

Score Operator
1.0 assignment
1.0 login_timeout

Authentication#logged_in?

Total Score: 1.0

Score Operator
1.0 current_user

app/jobs/concerns/email_all_petition_signatories.rb

EmailAllPetitionSignatories#none

Total Score: 10.0

Score Operator
2.0 extend
1.0 branch
1.0 included
1.2 before_perform
2.4 class_attribute
1.2 attr_reader
1.2 queue_as
1.0 private

EmailAllPetitionSignatories#petition_has_been_updated?

Total Score: 8.9

Score Operator
1.6 petition_timestamp
1.8 requested_at
1.6 in_time_zone
1.4 -
1.2 abs
0.3 lit_fixnum
1.0 >

EmailAllPetitionSignatories#enqueue_send_email_jobs

Total Score: 7.7

Score Operator
2.1 branch
1.0 without_instrumentation
1.3 signatures_to_email
1.1 find_each
1.4 email_delivery_job_class
1.4 mailer_arguments
1.2 perform_later

EmailAllPetitionSignatories#perform

Total Score: 5.2

Score Operator
3.0 assignment
2.0 []
1.0 branch
1.0 petition_has_been_updated?
1.1 enqueue_send_email_jobs

EmailAllPetitionSignatories#signatures_to_email

Total Score: 3.4

Score Operator
1.2 petition
1.2 timestamp_name
1.0 signatures_to_email_for

EmailAllPetitionSignatories#petition_timestamp

Total Score: 3.4

Score Operator
1.2 petition
1.2 timestamp_name
1.0 get_email_requested_at_for

EmailAllPetitionSignatories#mailer_arguments

Total Score: 3.0

Score Operator
1.0 timestamp_name
1.0 petition
1.0 requested_at

EmailAllPetitionSignatories#set_appsignal_namespace

Total Score: 1.0

Score Operator
1.0 set_namespace

TrendingIp::before_validation#on

Total Score: 10.0

Score Operator
1.0 before_validation
1.1 assignment
1.3 geoip_db
1.5 ip_address
1.3 to_s
1.1 lookup
1.1 branch
1.1 found?
1.4 country
1.2 iso_code

app/controllers/admin/admin_users_controller.rb

Admin::AdminUsersController#none

Total Score: 10.0

Score Operator
2.0 before_filter
2.0 branch
2.0 rescue_from
2.6 admin_admin_users_url
2.2 redirect_to
1.0 protected

Admin::AdminUsersController#destroy

Total Score: 7.1

Score Operator
1.0 branch
1.2 current_user
1.0 destroy
2.6 admin_admin_users_url
2.2 redirect_to

Admin::AdminUsersController#create

Total Score: 6.8

Score Operator
1.0 assignment
1.2 admin_user_params
1.0 new
1.0 branch
1.0 save
1.3 admin_admin_users_url
1.1 redirect_to
1.1 render

Admin::AdminUsersController#update

Total Score: 5.8

Score Operator
1.0 branch
1.2 admin_user_params
1.0 update
1.3 admin_admin_users_url
1.1 redirect_to
1.1 render

Admin::AdminUsersController#index

Total Score: 5.2

Score Operator
1.0 assignment
1.2 by_name
1.4 params
1.2 []
0.3 lit_fixnum
1.0 paginate

Admin::AdminUsersController#find_user

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::AdminUsersController#admin_user_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::AdminUsersController#new

Total Score: 1.4

Score Operator
1.0 assignment
1.0 new

app/models/task.rb

Task::run

Total Score: 9.9

Score Operator
1.5 assignment
0.4 lit_fixnum
1.5 hours
1.7 task_for
1.7 block_pass
4.5 send

app/models/domain.rb

Domain::normalize

Total Score: 9.9

Score Operator
3.2 branch
1.7 is_a?
1.8 assignment
1.8 new
2.1 domain
1.9 rule
1.7 normalize

app/controllers/admin/statistics_controller.rb

Admin::StatisticsController#csv_filename

Total Score: 9.9

Score Operator
1.1 branch
1.3 params
1.1 key?
2.4 action_name
1.4 parliament
3.6 period

Admin::StatisticsController#parliament

Total Score: 6.7

Score Operator
1.1 branch
2.9 params
1.1 key?
1.4 []
1.2 find

Admin::StatisticsController#moderation

Total Score: 6.2

Score Operator
1.1 assignment
1.3 period
1.3 parliament
1.1 moderation
1.1 branch
1.1 respond_to
1.2 csv

Admin::StatisticsController#set_content_disposition

Total Score: 3.7

Score Operator
1.1 assignment
1.3 response
1.1 headers
1.1 csv_filename

Admin::StatisticsController#index

Total Score: 2.5

Score Operator
1.1 branch
1.1 respond_to
1.2 html

Admin::StatisticsController#period

Total Score: 2.4

Score Operator
1.3 params
1.1 []

Admin::StatisticsController#none

Total Score: 2.2

Score Operator
1.1 after_action
1.1 private

app/jobs/stop_petitions_early_job.rb

StopPetitionsEarlyJob#perform

Total Score: 9.8

Score Operator
2.0 assignment
1.0 in_time_zone
1.0 notification_cutoff_at
2.2 branch
1.2 in_need_of_stopping
1.0 find_each
1.4 created_at
1.2 >=
1.3 send_notification
1.2 stop!

StopPetitionsEarlyJob#send_notification

Total Score: 8.9

Score Operator
4.5 branch
1.0 special_consideration?
1.1 state
3.0 creator
2.6 perform_later

StopPetitionsEarlyJob#none

Total Score: 7.0

Score Operator
1.0 queue_as
5.0 sclass
1.0 private

app/jobs/email_job.rb

EmailJob#none

Total Score: 9.7

Score Operator
1.0 before_perform
1.0 class_attribute
1.0 queue_as
2.0 branch
2.0 rescue_from
2.3 log_exception
1.2 retry_job
1.0 private

EmailJob#perform

Total Score: 7.4

Score Operator
1.4 mailer
1.4 email
3.6 send
1.0 deliver_now

EmailJob#log_message

Total Score: 4.4

Score Operator
2.4 class
2.0 name

EmailJob#log_exception

Total Score: 3.4

Score Operator
1.2 logger
1.2 log_message
1.0 info

EmailJob#set_appsignal_namespace

Total Score: 1.0

Score Operator
1.0 set_namespace

app/jobs/notify_everyone_of_moderation_decision_job.rb

NotifyEveryoneOfModerationDecisionJob#perform

Total Score: 9.7

Score Operator
2.0 assignment
1.0 creator
1.2 sponsors
1.0 validated
3.2 branch
1.0 published?
1.1 notify_everyone_of_publication
1.2 rejected?
1.2 hidden?
1.2 notify_everyone_of_rejection

NotifyEveryoneOfModerationDecisionJob#notify_everyone_of_rejection

Total Score: 3.3

Score Operator
2.1 perform_later
1.0 branch
1.0 each

NotifyEveryoneOfModerationDecisionJob#none

Total Score: 3.3

Score Operator
1.0 branch
1.0 rescue_from
1.1 send_exception
1.0 private

NotifyEveryoneOfModerationDecisionJob#notify_everyone_of_publication

Total Score: 3.3

Score Operator
2.1 perform_later
1.0 branch
1.0 each

app/controllers/archived/signatures_controller.rb

Archived::SignaturesController#retrieve_signature

Total Score: 9.6

Score Operator
2.0 assignment
1.4 params
1.2 []
1.0 find
1.0 petition
2.0 branch
1.1 invalidated?
1.1 fraudulent?
1.3 signature_id
1.1 raise

Archived::SignaturesController#verify_unsubscribe_token

Total Score: 7.4

Score Operator
1.0 branch
1.2 unsubscribe_token
2.7 token_param
1.0 ==
1.3 inspect
1.1 raise

Archived::SignaturesController#token_param

Total Score: 5.3

Score Operator
1.0 assignment
1.6 params
1.4 []
1.2 to_s
1.0 encode

Archived::SignaturesController#unsubscribe

Total Score: 4.4

Score Operator
1.2 token_param
1.0 unsubscribe!
1.0 branch
1.0 respond_to
1.1 html

Archived::SignaturesController#none

Total Score: 4.0

Score Operator
3.0 before_action
1.0 private

Archived::SignaturesController#signature_id

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 Integer

app/jobs/email_duplicate_signatures_email_job.rb

EmailDuplicateSignaturesEmailJob#perform

Total Score: 9.6

Score Operator
1.4 mailer
1.4 email
3.6 send
1.0 deliver_now
1.2 id
1.0 increment_counter

EmailDuplicateSignaturesEmailJob#none

Total Score: 3.8

Score Operator
2.0 assignment
1.0 branch
1.0 rescue_from
1.1 send_exception
1.0 private

EmailDuplicateSignaturesEmailJob#rate_limit

Total Score: 1.4

Score Operator
1.0 assignment
1.0 first_or_create!

app/models/petition.rb

Petition::threshold

Total Score: 9.6

Score Operator
2.2 arel_table
2.0 []
2.0 threshold_for_debate
1.8 gteq
1.6 where

app/models/signature.rb

Signature::validated_count

Total Score: 9.6

Score Operator
2.0 validated
2.2 count_star
2.0 to_sql
1.8 pluck
1.6 first

app/models/signature.rb

Signature::validated?

Total Score: 9.6

Score Operator
3.8 where
2.2 validated_at
2.0 not_eq
1.6 exists?

app/controllers/local_petitions_controller.rb

LocalPetitionsController#redirect_to_constituency

Total Score: 9.6

Score Operator
1.1 branch
1.1 dissolved?
3.2 slug
1.4 all_local_petition_url
2.4 redirect_to
1.4 local_petition_url

LocalPetitionsController#none

Total Score: 8.8

Score Operator
6.6 before_action
1.1 after_action
1.1 private

LocalPetitionsController#show

Total Score: 5.1

Score Operator
1.1 branch
1.1 respond_to
1.3 html
1.3 json
1.3 csv

LocalPetitionsController#all

Total Score: 5.1

Score Operator
1.1 branch
1.1 respond_to
1.3 html
1.3 json
1.3 csv

LocalPetitionsController#csv_filename

Total Score: 4.9

Score Operator
1.1 branch
1.3 action_name
1.1 ==
2.4 slug

LocalPetitionsController#sanitize_postcode

Total Score: 4.1

Score Operator
1.1 assignment
1.5 params
1.3 []
1.1 call

LocalPetitionsController#find_by_slug

Total Score: 4.1

Score Operator
1.1 assignment
1.5 params
1.3 []
1.1 find_by_slug!

LocalPetitionsController#set_content_disposition

Total Score: 3.7

Score Operator
1.1 assignment
1.3 response
1.1 headers
1.1 csv_filename

LocalPetitionsController#find_petitions

Total Score: 2.9

Score Operator
1.1 assignment
1.3 external_id
0.3 lit_fixnum
1.1 popular_in_constituency

LocalPetitionsController#find_all_petitions

Total Score: 2.9

Score Operator
1.1 assignment
1.3 external_id
0.3 lit_fixnum
1.1 all_popular_in_constituency

LocalPetitionsController#index

Total Score: 2.5

Score Operator
1.1 branch
1.1 respond_to
1.2 html

LocalPetitionsController#find_by_postcode

Total Score: 1.6

Score Operator
1.1 assignment
1.1 find_by_postcode

LocalPetitionsController#postcode?

Total Score: 1.1

Score Operator
1.1 present?

LocalPetitionsController#constituency?

Total Score: 1.1

Score Operator
1.1 present?

lib/tasks/epets.rake

namespace(epets)::namespace#site

Total Score: 9.5

Score Operator
1.1 namespace
8.4 desc

namespace(epets)::namespace#petitions

Total Score: 6.5

Score Operator
1.0 namespace
5.5 desc

namespace(epets)::namespace#constituencies

Total Score: 4.3

Score Operator
1.0 namespace
3.3 desc

namespace(epets)::namespace#whenever

Total Score: 3.5

Score Operator
1.1 namespace
2.4 desc

namespace(epets)::namespace#jobs

Total Score: 2.3

Score Operator
1.1 namespace
1.2 desc

namespace(epets)::namespace#cache

Total Score: 2.3

Score Operator
1.1 namespace
1.2 desc

namespace(epets)::namespace#countries

Total Score: 2.1

Score Operator
1.0 namespace
1.1 desc

namespace(epets)::namespace#signatures

Total Score: 2.1

Score Operator
1.0 namespace
1.1 desc

app/models/signature.rb

Signature::validate!

Total Score: 9.5

Score Operator
3.2 assignment
1.6 current
1.6 find
3.3 branch
1.6 transaction
1.7 each
1.8 validate!

app/models/concerns/browseable.rb

Browseable::Facets#facet_count_query

Total Score: 9.3

Score Operator
2.2 branch
1.0 lambda
1.4 facet_definitions
1.2 key?
1.5 inspect
1.3 raise
1.2 assignment
1.4 facet_scope
1.2 count

Browseable::Facets#facet_scope

Total Score: 7.2

Score Operator
1.2 klass
1.2 block_pass
1.2 to_proc_normal
1.4 facet_definitions
1.2 fetch
1.0 instance_exec

Browseable::Facets#none

Total Score: 6.0

Score Operator
2.0 include
1.0 attr_reader
2.0 delegate
1.0 private

Browseable::Facets#facet_counts

Total Score: 4.7

Score Operator
1.0 assignment
1.2 block_pass
1.2 to_proc_normal
1.2 facet_count_query
1.0 new

Browseable::Facets#each

Total Score: 4.5

Score Operator
1.0 branch
1.2 keys
1.0 each
1.1 yield
1.1 []

Browseable::Facets#slice

Total Score: 4.1

Score Operator
2.1 branch
1.0 each_with_object
1.1 has_key?
1.2 assignment
1.2 []

Browseable::Facets#[]

Total Score: 2.2

Score Operator
1.2 facet_counts
1.0 []

Browseable::Facets#initialize

Total Score: 1.0

Score Operator
1.0 assignment

app/models/task.rb

Task#retry_lock

Total Score: 9.3

Score Operator
3.4 assignment
3.2 branch
1.1 with_lock
1.2 yield
1.2 raise
1.7 class
1.5 connection
1.3 clear_cache!

Task#none

Total Score: 8.8

Score Operator
0.3 lit_fixnum
1.0 validates
2.5 private
5.0 sclass

Task#pending?

Total Score: 7.5

Score Operator
1.0 branch
1.3 created_at
2.6 updated_at
1.1 ==
1.3 ago
1.1 <

Task#run

Total Score: 6.4

Score Operator
1.0 assignment
0.3 lit_fixnum
1.0 hours
2.1 branch
1.0 retry_lock
1.1 pending?
1.3 call
1.3 touch

app/models/signature.rb

Signature::validated_count_by_location_code

Total Score: 9.2

Score Operator
2.0 validated
1.8 group
2.0 count_star
1.8 to_sql
1.6 pluck

app/models/signature.rb

Signature::validated_count_by_constituency_id

Total Score: 9.2

Score Operator
2.0 validated
1.8 group
2.0 count_star
1.8 to_sql
1.6 pluck

app/controllers/admin/archived/government_response_controller.rb

Admin::Archived::GovernmentResponseController#update

Total Score: 9.2

Score Operator
2.2 branch
1.2 government_response_params
1.0 update
1.2 send_email_to_petitioners?
1.4 run_later_tonight
2.7 assignment
1.4 admin_archived_petition_url
1.2 redirect_to
1.1 render

Admin::Archived::GovernmentResponseController#none

Total Score: 6.8

Score Operator
2.0 before_action
2.1 branch
1.0 rescue_from
1.2 assignment
1.2 government_response
1.2 update
1.0 private

Admin::Archived::GovernmentResponseController#fetch_petition

Total Score: 4.9

Score Operator
1.0 assignment
1.2 moderated
1.4 params
1.2 []
1.0 find

Admin::Archived::GovernmentResponseController#government_response_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::Archived::GovernmentResponseController#fetch_government_response

Total Score: 2.6

Score Operator
1.0 assignment
1.0 branch
1.1 government_response
1.1 build_government_response

Admin::Archived::GovernmentResponseController#send_email_to_petitioners?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::Archived::GovernmentResponseController#show

Total Score: 1.0

Score Operator
1.0 render

app/controllers/admin/archived/schedule_debate_controller.rb

Admin::Archived::ScheduleDebateController#update

Total Score: 9.2

Score Operator
2.2 branch
1.2 params_for_update
1.0 update_attributes
1.2 send_email_to_petitioners?
1.4 run_later_tonight
2.7 assignment
1.4 admin_archived_petition_url
1.2 redirect_to
1.1 render

Admin::Archived::ScheduleDebateController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::Archived::ScheduleDebateController#params_for_update

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::Archived::ScheduleDebateController#send_email_to_petitioners?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::Archived::ScheduleDebateController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

Admin::Archived::ScheduleDebateController#show

Total Score: 1.0

Score Operator
1.0 render

app/controllers/admin/archived/debate_outcomes_controller.rb

Admin::Archived::DebateOutcomesController#update

Total Score: 9.2

Score Operator
2.2 branch
1.2 debate_outcome_params
1.0 update
1.2 send_email_to_petitioners?
1.4 run_later_tonight
2.7 assignment
1.4 admin_archived_petition_url
1.2 redirect_to
1.1 render

Admin::Archived::DebateOutcomesController#none

Total Score: 6.8

Score Operator
2.0 before_action
2.1 branch
1.0 rescue_from
1.2 assignment
1.2 debate_outcome
1.2 update
1.0 private

Admin::Archived::DebateOutcomesController#fetch_petition

Total Score: 4.9

Score Operator
1.0 assignment
1.2 debateable
1.4 params
1.2 []
1.0 find

Admin::Archived::DebateOutcomesController#debate_outcome_params

Total Score: 4.8

Score Operator
1.4 params
1.2 require
1.2 debate_outcome_attributes
1.0 permit

Admin::Archived::DebateOutcomesController#fetch_debate_outcome

Total Score: 2.6

Score Operator
1.0 assignment
1.0 branch
1.1 debate_outcome
1.1 build_debate_outcome

Admin::Archived::DebateOutcomesController#send_email_to_petitioners?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::Archived::DebateOutcomesController#show

Total Score: 1.0

Score Operator
1.0 render

app/models/archived/petition.rb

Archived::Petition::in_need_of_marking_as_debated

Total Score: 9.1

Score Operator
1.6 assignment
1.6 current
2.0 scheduled_debate_state
2.0 debate_date_in_the_past
1.8 and
1.6 where

app/models/petition.rb

Petition::in_need_of_marking_as_debated

Total Score: 9.1

Score Operator
1.6 assignment
1.6 current
2.0 scheduled_debate_state
2.0 debate_date_in_the_past
1.8 and
1.6 where

app/helpers/debate_outcome_helper.rb

DebateOutcomeHelper#debate_outcome_links

Total Score: 9.1

Score Operator
2.7 branch
1.3 map
3.1 public_send
1.7 t
1.5 new
1.1 compact

DebateOutcomeHelper#debate_outcome_image

Total Score: 9.0

Score Operator
1.1 assignment
1.1 branch
1.1 map
2.9 commons_image
2.5 url
1.3 join
1.1 image_tag

DebateOutcomeHelper#debate_outcome_links?

Total Score: 2.5

Score Operator
1.1 branch
1.1 any?
1.2 public_send

Location#none

Total Score: 9.1

Score Operator
0.6 lit_fixnum
2.0 validates
1.5 private
5.0 sclass

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::increment_signature_counts_for

Total Score: 9.1

Score Operator
3.2 branch
1.7 signature_counts
1.5 each
1.7 blank?
1.9 for
1.7 increment_signature_count

app/models/country_petition_journal.rb

CountryPetitionJournal::increment_signature_counts_for

Total Score: 9.1

Score Operator
3.2 branch
1.7 signature_counts
1.5 each
1.7 blank?
1.9 for
1.7 increment_signature_count

app/jobs/notify_creator_of_validated_petition_being_stopped_job.rb

NotifyCreatorOfValidatedPetitionBeingStoppedJob#perform

Total Score: 9.1

Score Operator
1.0 branch
1.0 dissolved?
1.5 mailer
1.5 email
3.9 send
1.1 deliver_now

NotifyCreatorOfValidatedPetitionBeingStoppedJob#none

Total Score: 2.2

Score Operator
2.0 assignment
1.0 queue_as

app/jobs/notify_creator_of_sponsored_petition_being_stopped_job.rb

NotifyCreatorOfSponsoredPetitionBeingStoppedJob#perform

Total Score: 9.1

Score Operator
1.0 branch
1.0 dissolved?
1.5 mailer
1.5 email
3.9 send
1.1 deliver_now

NotifyCreatorOfSponsoredPetitionBeingStoppedJob#none

Total Score: 2.2

Score Operator
2.0 assignment
1.0 queue_as

app/jobs/notify_creator_that_parliament_is_dissolving_job.rb

NotifyCreatorThatParliamentIsDissolvingJob#perform

Total Score: 9.1

Score Operator
1.0 branch
1.0 dissolution_announced?
1.5 mailer
1.5 email
3.9 send
1.1 deliver_now

NotifyCreatorThatParliamentIsDissolvingJob#none

Total Score: 2.2

Score Operator
2.0 assignment
1.0 queue_as

app/controllers/feedback_controller.rb

FeedbackController#create

Total Score: 9.0

Score Operator
3.3 branch
1.0 save
1.2 perform_later
1.4 thanks_feedback_url
1.2 redirect_to
1.1 respond_to
1.2 html
1.3 render

FeedbackController#feedback_params

Total Score: 7.8

Score Operator
1.6 params
1.4 require
1.4 feedback_attributes
1.2 permit
1.2 user_agent
1.0 merge

FeedbackController#build_feedback

Total Score: 5.1

Score Operator
1.0 assignment
1.2 branch
1.4 params
1.2 key?
1.3 feedback_params
1.0 new

FeedbackController#new

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

FeedbackController#thanks

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

FeedbackController#user_agent

Total Score: 2.2

Score Operator
1.2 request
1.0 user_agent

FeedbackController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

app/models/domain.rb

Domain::rule

Total Score: 8.9

Score Operator
3.2 branch
1.7 rules
1.7 lambda
1.8 default_domain
1.5 detect
1.6 present?

app/helpers/admin_hub_helper.rb

AdminHubHelper::ActionCountsDecorator#generate_counts

Total Score: 8.9

Score Operator
1.0 assignment
1.6 visible
1.4 awaiting_response
2.4 count
2.0 <<
1.4 in_debate_queue

AdminHubHelper::ActionCountsDecorator#none

Total Score: 2.0

Score Operator
1.0 delegate
1.0 private

AdminHubHelper::ActionCountsDecorator#counts

Total Score: 1.4

Score Operator
1.0 assignment
1.0 generate_counts

app/controllers/admin/domains_controller.rb

Admin::DomainsController#update

Total Score: 8.8

Score Operator
3.3 branch
1.2 domain_params
1.0 update
1.3 admin_domains_url
1.1 redirect_to
1.1 respond_to
1.2 html
1.3 render

Admin::DomainsController#create

Total Score: 7.7

Score Operator
3.3 branch
1.0 save
1.3 admin_domains_url
1.1 redirect_to
1.1 respond_to
1.2 html
1.3 render

Admin::DomainsController#domain_params

Total Score: 7.5

Score Operator
1.0 branch
2.7 params
1.0 key?
1.3 require
1.3 domain_attributes
1.1 permit

Admin::DomainsController#destroy

Total Score: 5.9

Score Operator
1.0 branch
1.0 destroy
2.6 admin_domains_url
2.2 redirect_to

Admin::DomainsController#fetch_domains

Total Score: 5.2

Score Operator
1.0 assignment
1.2 by_name
1.4 params
1.2 []
0.3 lit_fixnum
1.0 paginate

Admin::DomainsController#none

Total Score: 5.0

Score Operator
4.0 before_action
1.0 private

Admin::DomainsController#find_domain

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::DomainsController#build_domain

Total Score: 2.4

Score Operator
1.0 assignment
1.2 domain_params
1.0 new

Admin::DomainsController#edit

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::DomainsController#new

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::DomainsController#index

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

app/controllers/admin/holidays_controller.rb

Admin::HolidaysController#update

Total Score: 8.8

Score Operator
3.3 branch
1.2 holiday_params
1.0 update
1.3 edit_admin_site_url
1.1 redirect_to
1.1 respond_to
1.2 html
1.3 render

Admin::HolidaysController#holiday_params

Total Score: 4.8

Score Operator
1.4 params
1.2 require
1.2 holiday_attributes
1.0 permit

Admin::HolidaysController#none

Total Score: 3.0

Score Operator
2.0 before_action
1.0 private

Admin::HolidaysController#edit

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::HolidaysController#fetch_holiday

Total Score: 1.4

Score Operator
1.0 assignment
1.0 instance

app/presenters/petition_csv_presenter.rb

PetitionCSVPresenter::fields

Total Score: 8.8

Score Operator
1.7 urls
1.7 attributes
3.9 +
1.5 timestamps

app/lib/quiet_logger.rb

QuietLogger#call

Total Score: 8.7

Score Operator
2.1 branch
1.0 silence_request?
1.3 logger
1.1 silence
2.7 app
2.3 call

QuietLogger#silence_request?

Total Score: 4.7

Score Operator
1.0 branch
1.2 paths
1.0 any?
1.3 []
1.1 ===

QuietLogger#initialize

Total Score: 4.6

Score Operator
4.0 assignment
1.2 []
1.0 Array

QuietLogger#none

Total Score: 2.0

Score Operator
1.0 attr_reader
1.0 private

QuietLogger#logger

Total Score: 1.0

Score Operator
1.0 logger

app/models/domain.rb

Domain::validate#if

Total Score: 8.6

Score Operator
1.0 validate
2.0 branch
1.1 aliased_domain?
1.5 canonical_domain
1.3 present?
1.1 !
1.3 errors
1.1 add

lib/tasks/constituencies.rake

namespace#epets

Total Score: 8.3

Score Operator
5.0 namespace
3.3 desc

namespace#deploy

Total Score: 7.1

Score Operator
1.1 namespace
6.0 desc

namespace#errors

Total Score: 2.3

Score Operator
1.1 namespace
1.2 desc

namespace#bundle

Total Score: 2.1

Score Operator
1.0 namespace
1.1 desc

namespace#data

Total Score: 2.1

Score Operator
1.0 namespace
1.1 desc

namespace#brakeman

Total Score: 2.1

Score Operator
1.0 namespace
1.1 desc

app/jobs/archive_petitions_job.rb

ArchivePetitionsJob#perform

Total Score: 8.2

Score Operator
3.4 branch
1.0 without_instrumentation
1.1 find_each
1.3 archived?
1.3 perform_later
1.5 current
1.3 update_column

ArchivePetitionsJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

lib/tasks/epets.rake

namespace(epets)::task#add_sysadmin_user

Total Score: 8.1

Score Operator
1.1 task
1.1 branch
1.3 find_by
1.1 nil?
5.2 assignment
1.3 new
1.3 save!

namespace(epets)::task#threshold_email_reminder

Total Score: 3.6

Score Operator
1.1 task
1.1 branch
1.1 run
1.2 perform_later

namespace(epets)::task#special_resend_of_signature_email_validation

Total Score: 2.2

Score Operator
1.1 task
1.1 special_resend_of_signature_email_validation

app/controllers/admin/admin_controller.rb

Admin::AdminController#none

Total Score: 8.0

Score Operator
2.0 include
2.0 skip_before_action
2.0 before_action
1.0 layout
1.0 private

Admin::AdminController#set_appsignal_namespace

Total Score: 1.0

Score Operator
1.0 set_namespace

app/validators/postcode_validator.rb

PostcodeValidator#validate_each

Total Score: 7.9

Score Operator
2.3 branch
1.2 to_s
1.0 =~
1.3 errors
1.6 options
1.4 []
1.1 add

app/controllers/admin/schedule_debate_controller.rb

Admin::ScheduleDebateController#update

Total Score: 7.9

Score Operator
2.2 branch
1.2 params_for_update
1.0 update_attributes
1.2 send_email_to_petitioners?
1.4 run_later_tonight
2.7 assignment
1.2 redirect_to
1.1 render

Admin::ScheduleDebateController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::ScheduleDebateController#params_for_update

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::ScheduleDebateController#send_email_to_petitioners?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::ScheduleDebateController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

Admin::ScheduleDebateController#show

Total Score: 1.0

Score Operator
1.0 render

app/controllers/admin/government_response_controller.rb

Admin::GovernmentResponseController#update

Total Score: 7.9

Score Operator
2.2 branch
1.2 government_response_params
1.0 update
1.2 send_email_to_petitioners?
1.4 run_later_tonight
2.7 assignment
1.2 redirect_to
1.1 render

Admin::GovernmentResponseController#none

Total Score: 6.8

Score Operator
2.0 before_action
2.1 branch
1.0 rescue_from
1.2 assignment
1.2 government_response
1.2 update
1.0 private

Admin::GovernmentResponseController#fetch_petition

Total Score: 4.9

Score Operator
1.0 assignment
1.2 moderated
1.4 params
1.2 []
1.0 find

Admin::GovernmentResponseController#government_response_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::GovernmentResponseController#fetch_government_response

Total Score: 2.6

Score Operator
1.0 assignment
1.0 branch
1.1 government_response
1.1 build_government_response

Admin::GovernmentResponseController#send_email_to_petitioners?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::GovernmentResponseController#show

Total Score: 1.0

Score Operator
1.0 render

app/controllers/admin/debate_outcomes_controller.rb

Admin::DebateOutcomesController#update

Total Score: 7.9

Score Operator
2.2 branch
1.2 debate_outcome_params
1.0 update
1.2 send_email_to_petitioners?
1.4 run_later_tonight
2.7 assignment
1.2 redirect_to
1.1 render

Admin::DebateOutcomesController#none

Total Score: 6.8

Score Operator
2.0 before_action
2.1 branch
1.0 rescue_from
1.2 assignment
1.2 debate_outcome
1.2 update
1.0 private

Admin::DebateOutcomesController#fetch_petition

Total Score: 4.9

Score Operator
1.0 assignment
1.2 debateable
1.4 params
1.2 []
1.0 find

Admin::DebateOutcomesController#debate_outcome_params

Total Score: 4.8

Score Operator
1.4 params
1.2 require
1.2 debate_outcome_attributes
1.0 permit

Admin::DebateOutcomesController#fetch_debate_outcome

Total Score: 2.6

Score Operator
1.0 assignment
1.0 branch
1.1 debate_outcome
1.1 build_debate_outcome

Admin::DebateOutcomesController#send_email_to_petitioners?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::DebateOutcomesController#show

Total Score: 1.0

Score Operator
1.0 render

app/models/petition.rb

Petition::in_need_of_stopping

Total Score: 7.8

Score Operator
3.2 assignment
1.6 preload
1.6 branch
3.6 stoppable
1.7 created_after

app/models/parliament.rb

Parliament::current_or_create

Total Score: 7.8

Score Operator
1.8 current
0.6 lit_fixnum
2.0 weeks
1.8 ago
1.6 first_or_create

app/models/domain.rb

Domain::candidates

Total Score: 7.7

Score Operator
3.5 branch
1.7 tap
1.8 scan
1.9 <<
1.5 +

ApplicationMailer#none

Total Score: 7.7

Score Operator
1.0 assignment
1.0 default_url_options
1.0 email_protocol
1.2 branch
1.2 lambda
1.3 email_from
1.0 default
1.0 helper
1.0 layout

app/controllers/admin/tags_controller.rb

Admin::TagsController#update

Total Score: 7.6

Score Operator
3.3 branch
1.2 tag_params
1.0 update
1.1 redirect_to_index_url
1.1 respond_to
1.2 html
1.3 render

Admin::TagsController#create

Total Score: 6.6

Score Operator
3.3 branch
1.0 save
1.1 redirect_to_index_url
1.1 respond_to
1.2 html
1.3 render

Admin::TagsController#tag_params

Total Score: 6.2

Score Operator
1.0 branch
2.7 params
1.0 key?
1.3 require
1.1 permit

Admin::TagsController#none

Total Score: 6.0

Score Operator
5.0 before_action
1.0 private

Admin::TagsController#find_tag

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::TagsController#index_url

Total Score: 3.6

Score Operator
1.4 params
1.2 slice
1.0 admin_tags_url

Admin::TagsController#redirect_to_index_url

Total Score: 2.4

Score Operator
1.0 assignment
1.2 index_url
1.0 redirect_to

Admin::TagsController#build_tag

Total Score: 2.4

Score Operator
1.0 assignment
1.2 tag_params
1.0 new

Admin::TagsController#find_tags

Total Score: 2.4

Score Operator
1.0 assignment
1.2 params
1.0 search

Admin::TagsController#new

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::TagsController#edit

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::TagsController#index

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::TagsController#destroy

Total Score: 1.0

Score Operator
1.0 redirect_to_index_url

Admin::TagsController#destroy_tag

Total Score: 1.0

Score Operator
1.0 destroy

app/models/archived/signature.rb

Archived::Signature::subscribe!

Total Score: 7.6

Score Operator
1.6 assignment
1.6 find
3.3 branch
1.6 transaction
1.7 each
1.8 update!

app/models/archived/signature.rb

Archived::Signature::destroy!

Total Score: 7.6

Score Operator
1.6 assignment
1.6 find
3.3 branch
1.6 transaction
1.7 each
1.8 destroy!

app/models/signature.rb

Signature::subscribe!

Total Score: 7.6

Score Operator
1.6 assignment
1.6 find
3.3 branch
1.6 transaction
1.7 each
1.8 update!

app/models/signature.rb

Signature::destroy!

Total Score: 7.6

Score Operator
1.6 assignment
1.6 find
3.3 branch
1.6 transaction
1.7 each
1.8 destroy!

app/models/archived/signature.rb

Archived::Signature::creator

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 eq
1.6 where

app/models/archived/signature.rb

Archived::Signature::sponsors

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 eq
1.6 where

app/models/petition.rb

Petition::signed_since

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 gt
1.6 where

app/models/petition.rb

Petition::created_after

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 gteq
1.6 where

app/models/invalidation.rb

Invalidation::not_completed

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 eq
1.6 where

app/models/site.rb

Site::default_enabled

Total Score: 7.6

Score Operator
2.2 fetch
2.0 to_i
1.8 zero?
1.6 !

app/models/invalidation.rb

Invalidation::started

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 not_eq
1.6 where

app/models/invalidation.rb

Invalidation::cancelled

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 not_eq
1.6 where

app/models/site.rb

Site::default_protected

Total Score: 7.6

Score Operator
2.2 fetch
2.0 to_i
1.8 zero?
1.6 !

app/models/invalidation.rb

Invalidation::completed

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 not_eq
1.6 where

app/models/signature.rb

Signature::max_validated_at

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 maximum
1.6 to_sql

app/models/signature.rb

Signature::creator

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 eq
1.6 where

app/models/signature.rb

Signature::sponsors

Total Score: 7.6

Score Operator
2.2 arel_table
2.0 []
1.8 eq
1.6 where

app/models/holiday.rb

Holiday#none

Total Score: 7.5

Score Operator
2.5 private
5.0 sclass

Holiday#easter?

Total Score: 3.4

Score Operator
1.0 assignment
1.0 current
1.2 easter
1.0 cover?

Holiday#christmas?

Total Score: 3.4

Score Operator
1.0 assignment
1.0 current
1.2 christmas
1.0 cover?

Holiday#christmas

Total Score: 2.0

Score Operator
1.0 christmas_start
1.0 christmas_end

Holiday#easter

Total Score: 2.0

Score Operator
1.0 easter_start
1.0 easter_end

Admin::TrendingDomainsController#fetch_trending_domains

Total Score: 7.5

Score Operator
1.0 assignment
1.2 trending_domains
2.8 params
2.4 []
1.0 search

Admin::TrendingDomainsController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::TrendingDomainsController#none

Total Score: 3.0

Score Operator
2.0 before_action
1.0 private

Admin::TrendingDomainsController#index

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

Admin::TrendingIpsController#fetch_trending_ips

Total Score: 7.5

Score Operator
1.0 assignment
1.2 trending_ips
2.8 params
2.4 []
1.0 search

Admin::TrendingIpsController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::TrendingIpsController#none

Total Score: 3.0

Score Operator
2.0 before_action
1.0 private

Admin::TrendingIpsController#index

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

app/jobs/feedback_email_job.rb

FeedbackEmailJob#reschedule_job

Total Score: 7.4

Score Operator
1.0 assignment
0.4 lit_fixnum
1.2 hour
1.0 from_now
1.4 class
1.2 set
1.2 arguments
1.0 perform_later

FeedbackEmailJob#none

Total Score: 3.8

Score Operator
2.0 assignment
1.0 branch
1.0 rescue_from
1.1 reschedule_job
1.0 private

FeedbackEmailJob#feedback_sending_disabled?

Total Score: 1.0

Score Operator
1.0 disable_feedback_sending?

app/jobs/notify_creator_that_moderation_is_delayed_job.rb

NotifyCreatorThatModerationIsDelayedJob#perform

Total Score: 7.4

Score Operator
1.4 mailer
1.4 email
3.6 send
1.0 deliver_now

NotifyCreatorThatModerationIsDelayedJob#none

Total Score: 2.2

Score Operator
2.0 assignment
1.0 queue_as

app/models/archived/petition.rb

Archived::Petition::in_debate_queue

Total Score: 7.4

Score Operator
2.0 threshold_for_debate_reached
2.0 scheduled_for_debate
1.8 or
1.6 where

app/models/petition.rb

Petition::in_debate_queue

Total Score: 7.4

Score Operator
2.0 threshold_for_debate_reached
2.0 scheduled_for_debate
1.8 or
1.6 where

app/models/signature.rb

Signature::count_star

Total Score: 7.4

Score Operator
2.0 arel_table
2.0 star
1.8 []
1.6 count

app/helpers/cache_helper.rb

CacheHelper::CacheKey::Dependencies#for

Total Score: 7.4

Score Operator
1.5 branch
3.3 dependencies_for
1.5 map
1.3 flatten
1.1 uniq

CacheHelper::CacheKey::Dependencies#dependencies_for

Total Score: 3.9

Score Operator
1.5 fragments
2.4 fetch

CacheHelper::CacheKey::Dependencies#none

Total Score: 2.2

Score Operator
1.1 attr_reader
1.1 private

CacheHelper::CacheKey::Dependencies#initialize

Total Score: 1.1

Score Operator
1.1 assignment

app/lib/admin/task_runner.rb

Admin::TaskRunner::run

Total Score: 7.3

Score Operator
1.5 branch
2.0 new
1.8 run
1.6 any?
1.6 assignment
1.6 send_exception

app/jobs/petition_count_job.rb

PetitionCountJob#perform

Total Score: 7.3

Score Operator
1.0 assignment
1.0 current_time
3.1 branch
1.0 disable_invalid_signature_count_check?
1.2 petitions
1.0 find_each
1.1 valid_signature_count!
1.2 perform_later

PetitionCountJob#none

Total Score: 4.0

Score Operator
2.0 delegate
1.0 queue_as
1.0 private

PetitionCountJob#current_time

Total Score: 3.6

Score Operator
1.4 current
1.2 change
1.0 iso8601

PetitionCountJob#petitions

Total Score: 1.0

Score Operator
1.0 in_need_of_validating

app/controllers/admin/tasks_controller.rb

Admin::TasksController#create

Total Score: 7.2

Score Operator
1.0 branch
1.2 params
1.0 run
2.2 assignment
1.3 selected_tasks
1.1 size
1.2 edit_admin_site_path
1.0 redirect_to

Admin::TasksController#selected_tasks

Total Score: 3.6

Score Operator
1.4 params
1.2 []
1.0 Array

Admin::TasksController#none

Total Score: 3.0

Score Operator
2.0 before_action
1.0 private

Admin::TasksController#redirect_to_tasks_tab

Total Score: 2.2

Score Operator
1.2 edit_admin_site_path
1.0 redirect_to

Admin::TasksController#missing_tasks?

Total Score: 2.2

Score Operator
1.2 selected_tasks
1.0 empty?

app/controllers/admin/take_down_controller.rb

Admin::TakeDownController#update

Total Score: 7.2

Score Operator
1.0 branch
1.4 rejection_params
1.2 []
1.0 reject
1.2 send_notifications
1.2 redirect_to
1.1 render

Admin::TakeDownController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::TakeDownController#rejection_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::TakeDownController#send_notifications

Total Score: 2.3

Score Operator
1.0 branch
1.0 send_email_to_creator_and_sponsors?
1.1 perform_later

Admin::TakeDownController#send_email_to_creator_and_sponsors?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::TakeDownController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

Admin::TakeDownController#show

Total Score: 1.0

Score Operator
1.0 render

lib/tasks/constituencies.rake

namespace(epets)::namespace(constituencies)::task#refresh

Total Score: 7.1

Score Operator
2.2 task
2.2 branch
2.2 run
2.4 perform_later

namespace(epets)::namespace(constituencies)::task#import

Total Score: 3.6

Score Operator
1.1 task
1.1 branch
1.1 run
1.2 perform_later

app/models/archived/petition.rb

Archived::Petition::with_options#allow_nil

Total Score: 7.1

Score Operator
1.1 with_options
6.0 delegate

app/models/petition.rb

Petition::with_options#allow_nil

Total Score: 7.1

Score Operator
1.1 with_options
6.0 delegate

app/models/site.rb

Site::constraints_for_moderation

Total Score: 7.1

Score Operator
1.6 branch
1.6 table_exists?
1.9 instance
1.7 constraints_for_moderation
1.7 default_constraints_for_moderation

app/models/site.rb

Site::constraints_for_public

Total Score: 7.1

Score Operator
1.6 branch
1.6 table_exists?
1.9 instance
1.7 constraints_for_public
1.7 default_constraints_for_public

app/models/petition.rb

Petition::close_petitions!

Total Score: 7.1

Score Operator
1.6 assignment
1.6 current
1.6 branch
1.8 in_need_of_closing
1.6 find_each
1.7 close!

app/models/petition.rb

Petition::stop_petitions_early!

Total Score: 7.1

Score Operator
1.6 assignment
1.6 dissolution_at
1.6 branch
1.8 in_need_of_stopping
1.6 find_each
1.7 stop!

app/models/petition.rb

Petition::close_petitions_early!

Total Score: 7.1

Score Operator
1.6 assignment
1.6 dissolution_at
1.6 branch
1.8 open_at_dissolution
1.6 find_each
1.7 close!

app/controllers/trackers_controller.rb

TrackersController#none

Total Score: 7.0

Score Operator
2.0 include
4.0 before_action
1.0 private

TrackersController#show

Total Score: 6.5

Score Operator
1.0 assignment
1.2 cookies
1.0 encrypted
1.0 form_token
1.0 current_time
1.0 branch
1.0 respond_to
1.1 gif

TrackersController#verify_form_token

Total Score: 6.0

Score Operator
1.0 branch
1.2 form_token
1.4 params
1.2 []
1.0 ==
1.1 raise

TrackersController#petition_id

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 Integer

TrackersController#fetch_petition

Total Score: 3.5

Score Operator
1.0 assignment
1.2 visible
1.2 petition_id
1.0 find

TrackersController#verify_petition

Total Score: 2.3

Score Operator
1.0 branch
1.0 closed_for_signing?
1.1 raise

app/controllers/admin/profile_controller.rb

Admin::ProfileController#update

Total Score: 7.0

Score Operator
1.0 branch
1.2 current_user
1.2 admin_user_params
1.0 update_with_password
1.3 admin_root_url
1.1 redirect_to
1.1 render

Admin::ProfileController#admin_user_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::ProfileController#none

Total Score: 1.0

Score Operator
1.0 skip_before_filter

app/models/constituency/api_client.rb

Constituency::ApiClient#call

Total Score: 6.9

Score Operator
1.1 branch
1.3 faraday
1.3 path
1.1 get
2.6 assignment
2.6 options

Constituency::ApiClient#faraday

Total Score: 5.2

Score Operator
1.1 assignment
1.1 branch
1.1 new
2.6 response
1.3 adapter

Constituency::ApiClient#path

Total Score: 2.4

Score Operator
1.3 escape_path
1.1 %

Constituency::ApiClient#escape_path

Total Score: 2.4

Score Operator
1.3 sanitize
1.1 escape_path

Constituency::ApiClient#none

Total Score: 1.4

Score Operator
0.3 lit_fixnum
1.1 private

Constituency::ApiClient#sanitize

Total Score: 1.1

Score Operator
1.1 call

app/models/domain.rb

Domain::rules

Total Score: 6.9

Score Operator
1.5 branch
1.9 candidates
1.7 lazy
1.5 map
1.6 find_by

app/controllers/admin/archived/notes_controller.rb

Admin::Archived::NotesController#none

Total Score: 6.8

Score Operator
2.0 before_action
2.1 branch
1.0 rescue_from
1.2 assignment
1.2 note
1.2 update
1.0 private

Admin::Archived::NotesController#update

Total Score: 5.8

Score Operator
1.0 branch
1.2 note_params
1.0 update
1.3 admin_archived_petition_url
1.1 redirect_to
1.1 render

Admin::Archived::NotesController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::Archived::NotesController#note_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::Archived::NotesController#fetch_note

Total Score: 2.6

Score Operator
1.0 assignment
1.0 branch
1.1 note
1.1 build_note

Admin::Archived::NotesController#show

Total Score: 1.0

Score Operator
1.0 render

app/controllers/admin/notes_controller.rb

Admin::NotesController#none

Total Score: 6.8

Score Operator
2.0 before_action
2.1 branch
1.0 rescue_from
1.2 assignment
1.2 note
1.2 update
1.0 private

Admin::NotesController#update

Total Score: 4.5

Score Operator
1.0 branch
1.2 note_params
1.0 update
1.1 redirect_to
1.1 render

Admin::NotesController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::NotesController#note_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::NotesController#fetch_note

Total Score: 2.6

Score Operator
1.0 assignment
1.0 branch
1.1 note
1.1 build_note

Admin::NotesController#show

Total Score: 1.0

Score Operator
1.0 render

app/models/location.rb

Location::current

Total Score: 6.8

Score Operator
1.5 assignment
1.5 current
1.9 not_pending
1.7 not_expired
1.5 by_name

lib/tasks/signatures.rake

namespace(epets)::namespace(signatures)::task#backfill_uuids

Total Score: 6.7

Score Operator
1.1 task
1.2 assignment
1.4 where
1.2 first
1.2 branch
1.5 id
1.3 perform_later

Statistics#none

Total Score: 6.5

Score Operator
1.5 private
5.0 sclass

app/jobs/email_petitioners_job.rb

EmailPetitionersJob#none

Total Score: 6.5

Score Operator
2.0 include
2.0 assignment
1.0 attr_reader
1.0 branch
1.0 rescue_from
1.1 log_exception
1.0 private

EmailPetitionersJob#log_message

Total Score: 4.4

Score Operator
2.4 class
2.0 name

EmailPetitionersJob#log_exception

Total Score: 3.4

Score Operator
1.2 logger
1.2 log_message
1.0 info

EmailPetitionersJob#mailer_arguments

Total Score: 2.2

Score Operator
1.2 email
1.0 merge

EmailPetitionersJob#perform

Total Score: 1.4

Score Operator
1.0 assignment
1.0 []

app/jobs/archived/email_petitioners_job.rb

Archived::EmailPetitionersJob#none

Total Score: 6.5

Score Operator
2.0 include
2.0 assignment
1.0 attr_reader
1.0 branch
1.0 rescue_from
1.1 log_exception
1.0 private

Archived::EmailPetitionersJob#log_message

Total Score: 4.4

Score Operator
2.4 class
2.0 name

Archived::EmailPetitionersJob#log_exception

Total Score: 3.4

Score Operator
1.2 logger
1.2 log_message
1.0 info

Archived::EmailPetitionersJob#mailer_arguments

Total Score: 2.2

Score Operator
1.2 email
1.0 merge

Archived::EmailPetitionersJob#perform

Total Score: 1.4

Score Operator
1.0 assignment
1.0 []

app/helpers/cache_helper.rb

CacheHelper::CacheKey::Fragment#initialize

Total Score: 6.5

Score Operator
4.4 assignment
4.4 fetch
0.3 lit_fixnum

CacheHelper::CacheKey::Fragment#none

Total Score: 1.1

Score Operator
1.1 attr_reader

app/controllers/concerns/form_tracking.rb

FormTracking#form_request

Total Score: 6.4

Score Operator
2.2 form_requests
2.2 form_request_id
1.0 build_form_request
1.0 []

FormTracking#image_loaded_at

Total Score: 4.8

Score Operator
1.4 cookies
1.2 encrypted
1.2 form_token
1.0 []

FormTracking#form_requests

Total Score: 3.2

Score Operator
2.2 session
1.0 []

FormTracking#none

Total Score: 3.0

Score Operator
2.0 extend
1.0 private

FormTracking#form_request_id

Total Score: 2.2

Score Operator
1.2 petition_id
1.0 to_s

FormTracking#form_token

Total Score: 2.2

Score Operator
1.2 form_request
1.0 []

FormTracking#form_requested_at

Total Score: 2.2

Score Operator
1.2 form_request
1.0 []

FormTracking#build_form_request

Total Score: 2.0

Score Operator
1.0 generate_form_token
1.0 current_time

FormTracking#generate_form_token

Total Score: 1.0

Score Operator
1.0 friendly_token

app/jobs/enqueue_petition_statistics_updates_job.rb

EnqueuePetitionStatisticsUpdatesJob#perform

Total Score: 6.0

Score Operator
2.0 branch
1.0 disable_daily_update_statistics_job?
1.4 in_time_zone
1.2 signed_since
1.0 find_each
1.1 perform_later

EnqueuePetitionStatisticsUpdatesJob#none

Total Score: 2.0

Score Operator
1.0 queue_as
1.0 delegate

app/jobs/close_petitions_early_job.rb

ClosePetitionsEarlyJob#none

Total Score: 6.0

Score Operator
1.0 queue_as
5.0 sclass

ClosePetitionsEarlyJob#perform

Total Score: 2.2

Score Operator
1.2 in_time_zone
1.0 close_petitions_early!

Browseable#none

Total Score: 6.0

Score Operator
2.0 extend
1.0 branch
1.0 included
2.4 class_attribute
2.4 assignment

app/lib/audit_logger.rb

AuditLogger#error

Total Score: 5.9

Score Operator
2.2 assignment
1.0 branch
1.0 nil?
1.2 new
1.2 set_backtrace
1.0 send_exception
1.0 add

AuditLogger#initialize

Total Score: 5.4

Score Operator
4.0 assignment
0.3 lit_fixnum
1.0 super
1.0 branch
1.2 env
1.0 include?

AuditLogger#format_message

Total Score: 4.4

Score Operator
1.0 branch
1.2 level
1.0 ==
1.1 puts
1.0 to_formatted_s

app/models/concerns/geoip_lookup.rb

GeoipLookup#ip_location

Total Score: 5.8

Score Operator
2.0 branch
1.0 ip_address?
1.0 assignment
3.4 ip_address
1.0 iso_code_for

GeoipLookup#iso_code_for

Total Score: 2.2

Score Operator
1.2 class
1.0 iso_code_for

GeoipLookup#country_name_for

Total Score: 2.2

Score Operator
1.2 class
1.0 country_name_for

GeoipLookup#geoip_lookup

Total Score: 2.2

Score Operator
1.2 class
1.0 geoip_lookup

GeoipLookup#none

Total Score: 2.0

Score Operator
2.0 extend

app/models/signature.rb

Signature::column_name_for

Total Score: 5.8

Score Operator
1.6 branch
1.7 fetch
1.7 assignment
1.9 inspect
1.7 raise

app/controllers/admin/archived/petition_details_controller.rb

Admin::Archived::PetitionDetailsController#update

Total Score: 5.8

Score Operator
1.0 branch
1.2 petition_params
1.0 update_attributes
1.3 admin_archived_petition_url
1.1 redirect_to
1.1 render

Admin::Archived::PetitionDetailsController#petition_params

Total Score: 4.8

Score Operator
1.4 params
1.2 require
1.2 petition_attributes
1.0 permit

Admin::Archived::PetitionDetailsController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::Archived::PetitionDetailsController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

app/controllers/admin/archived/petition_tags_controller.rb

Admin::Archived::PetitionTagsController#update

Total Score: 5.8

Score Operator
1.0 branch
1.2 petition_params
1.0 update
1.3 admin_archived_petition_url
1.1 redirect_to
1.1 render

Admin::Archived::PetitionTagsController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::Archived::PetitionTagsController#petition_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::Archived::PetitionTagsController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

Admin::Archived::PetitionTagsController#show

Total Score: 1.0

Score Operator
1.0 render

app/controllers/admin/moderation_controller.rb

Admin::ModerationController#update

Total Score: 5.8

Score Operator
1.0 branch
1.2 moderation_params
1.0 moderate
1.2 send_notifications
1.2 redirect_to
1.1 render

Admin::ModerationController#fetch_petition

Total Score: 4.9

Score Operator
1.0 assignment
1.2 todo_list
1.4 params
1.2 []
1.0 find

Admin::ModerationController#moderation_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::ModerationController#send_notifications

Total Score: 2.3

Score Operator
1.0 branch
1.0 send_email_to_creator_and_sponsors?
1.1 perform_later

Admin::ModerationController#send_email_to_creator_and_sponsors?

Total Score: 2.2

Score Operator
1.2 params
1.0 key?

Admin::ModerationController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

app/jobs/delete_petitions_job.rb

DeletePetitionsJob#perform

Total Score: 5.8

Score Operator
2.0 branch
1.2 unarchived
1.0 exists?
1.1 raise
1.0 find_each
1.1 perform_later

DeletePetitionsJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

app/helpers/markdown_helper.rb

MarkdownHelper#markdown_to_html

Total Score: 5.7

Score Operator
1.1 assignment
1.7 html_renderer
1.5 markdown_parser
1.3 render
1.1 html_safe

MarkdownHelper#markdown_to_text

Total Score: 5.7

Score Operator
1.1 assignment
1.7 text_renderer
1.5 markdown_parser
1.3 render
1.1 html_safe

MarkdownHelper#options_for_parser

Total Score: 3.9

Score Operator
1.5 keys
1.3 slice
1.1 merge

MarkdownHelper#options_for_renderer

Total Score: 3.9

Score Operator
1.5 keys
1.3 slice
1.1 merge

MarkdownHelper#html_renderer

Total Score: 2.4

Score Operator
1.3 options_for_renderer
1.1 new

MarkdownHelper#markdown_parser

Total Score: 2.4

Score Operator
1.3 options_for_parser
1.1 new

MarkdownHelper#none

Total Score: 1.1

Score Operator
1.1 private

MarkdownHelper#text_renderer

Total Score: 1.1

Score Operator
1.1 new

app/models/constituency.rb

Constituency::example_postcodes

Total Score: 5.6

Score Operator
1.6 assignment
2.0 root
1.8 join
1.6 load_file

app/models/moderation_delay.rb

ModerationDelay#none

Total Score: 5.6

Score Operator
2.0 include
1.0 attr_accessor
0.6 lit_fixnum
2.0 validates

ModerationDelay#attributes=

Total Score: 4.9

Score Operator
1.0 assignment
1.0 stringify_keys
2.1 branch
1.0 each
1.1 respond_to?
1.2 public_send

ModerationDelay#attributes

Total Score: 2.0

Score Operator
1.0 subject
1.0 body

app/models/archived/signature.rb

Archived::Signature::column_name_for

Total Score: 5.5

Score Operator
1.6 branch
1.7 fetch
1.9 inspect
1.7 raise

app/controllers/admin/logs_controller.rb

Admin::LogsController#none

Total Score: 5.5

Score Operator
3.3 before_action
1.1 after_action
1.1 private

Admin::LogsController#fetch_logs

Total Score: 4.1

Score Operator
1.1 assignment
1.5 params
1.3 []
1.1 find

Admin::LogsController#show

Total Score: 3.9

Score Operator
1.1 branch
1.1 respond_to
1.3 html
1.3 csv

Admin::LogsController#set_content_disposition

Total Score: 3.7

Score Operator
1.1 assignment
1.3 response
1.1 headers
1.1 csv_filename

Admin::LogsController#fetch_signature

Total Score: 1.6

Score Operator
1.1 assignment
1.1 signature

Admin::LogsController#fetch_petition

Total Score: 1.6

Score Operator
1.1 assignment
1.1 petition

Admin::LogsController#csv_filename

Total Score: 1.1

Score Operator
1.1 id

app/models/site.rb

Site::table_exists?

Total Score: 5.4

Score Operator
1.6 assignment
1.8 connection
1.8 table_name
1.6 table_exists?

app/helpers/cache_helper.rb

CacheHelper::CacheKey::load_yaml

Total Score: 5.4

Score Operator
2.0 root
1.8 join
1.6 load_file

app/models/archived/petition.rb

Archived::Petition::threshold_for_debate_reached

Total Score: 5.4

Score Operator
2.0 arel_table
1.8 []
1.6 not_eq

app/models/archived/petition.rb

Archived::Petition::scheduled_for_debate

Total Score: 5.4

Score Operator
2.0 arel_table
1.8 []
1.6 not_eq

app/models/archived/signature.rb

Archived::Signature::for_sector

Total Score: 5.4

Score Operator
2.0 call
1.8 []
1.6 where

app/models/archived/petition.rb

Archived::Petition::with_response

Total Score: 5.4

Score Operator
2.0 where
1.8 not
1.6 preload

app/models/archived/signature.rb

Archived::Signature::need_emailing_for

Total Score: 5.4

Score Operator
2.0 validated
1.8 subscribed
1.6 for_timestamp

app/models/archived/petition.rb

Archived::Petition::debate_date_in_the_past

Total Score: 5.4

Score Operator
2.0 arel_table
1.8 []
1.6 lt

app/models/archived/petition.rb

Archived::Petition::scheduled_debate_state

Total Score: 5.4

Score Operator
2.0 arel_table
1.8 []
1.6 eq

app/models/archived/petition.rb

Archived::Petition::with_debated_outcome

Total Score: 5.4

Score Operator
2.0 debated
1.8 where
1.6 not

app/models/archived/signature.rb

Archived::Signature::normalize_domain

Total Score: 5.4

Score Operator
2.0 split
1.8 last
1.6 downcase

app/models/petition.rb

Petition::debate_date_in_the_past

Total Score: 5.4

Score Operator
2.0 arel_table
1.8 []
1.6 lt

app/models/petition.rb

Petition::threshold_for_debate_reached

Total Score: 5.4

Score Operator
2.0 arel_table
1.8 []
1.6 not_eq

app/models/petition.rb

Petition::scheduled_for_debate

Total Score: 5.4

Score Operator
2.0 arel_table
1.8 []
1.6 not_eq

app/models/petition.rb

Petition::awaiting_debate_state

Total Score: 5.4

Score Operator
2.0 arel_table
1.8 []
1.6 eq

app/models/petition.rb

Petition::scheduled_debate_state

Total Score: 5.4

Score Operator
2.0 arel_table
1.8 []
1.6 eq

app/models/petition.rb

Petition::with_debated_outcome

Total Score: 5.4

Score Operator
2.0 debated
1.8 where
1.6 not

app/models/petition.rb

Petition::with_response

Total Score: 5.4

Score Operator
2.0 where
1.8 not
1.6 preload

app/models/signature.rb

Signature::normalize_domain

Total Score: 5.4

Score Operator
2.0 split
1.8 last
1.6 downcase

app/models/signature.rb

Signature::petition_ids_signed_since

Total Score: 5.4

Score Operator
2.0 validated
1.8 distinct
1.6 pluck

app/models/signature.rb

Signature::need_emailing_for

Total Score: 5.4

Score Operator
2.0 validated
1.8 subscribed
1.6 for_timestamp

app/models/signature.rb

Signature::for_sector

Total Score: 5.4

Score Operator
2.0 call
1.8 []
1.6 where

app/models/signature.rb

Signature::similar

Total Score: 5.4

Score Operator
3.8 where
1.6 not

lib/health_check_middleware.rb

HealthCheckMiddleware#call

Total Score: 5.3

Score Operator
1.1 branch
1.1 []
0.3 lit_fixnum
1.4 checkup
1.2 to_json
1.2 call

HealthCheckMiddleware#initialize

Total Score: 1.1

Score Operator
1.1 assignment

app/models/archived/petition.rb

Archived::Petition::mark_petitions_as_debated!

Total Score: 5.2

Score Operator
1.6 assignment
1.6 current
1.8 in_need_of_marking_as_debated
1.6 update_all

app/models/petition.rb

Petition::mark_petitions_as_debated!

Total Score: 5.2

Score Operator
1.6 assignment
1.6 current
1.8 in_need_of_marking_as_debated
1.6 update_all

app/models/site.rb

Site::signature_count_updated_at!

Total Score: 5.2

Score Operator
1.6 assignment
1.6 current
1.8 instance
1.6 update_all

app/models/parliament.rb

Parliament::dissolved?

Total Score: 5.2

Score Operator
1.6 assignment
1.6 current
1.8 instance
1.6 dissolved?

app/models/site.rb

Site::closed_at_for_opening

Total Score: 5.2

Score Operator
1.6 assignment
1.6 current
1.8 instance
1.6 closed_at_for_opening

app/models/site.rb

Site::last_checked_at!

Total Score: 5.2

Score Operator
1.6 assignment
1.6 current
1.8 instance
1.6 update_all

app/models/parliament.rb

Parliament::opened?

Total Score: 5.2

Score Operator
1.6 assignment
1.6 current
1.8 instance
1.6 opened?

app/models/site.rb

Site::opened_at_for_closing

Total Score: 5.2

Score Operator
1.6 assignment
1.6 current
1.8 instance
1.6 opened_at_for_closing

app/models/site.rb

Site::last_petition_created_at!

Total Score: 5.2

Score Operator
1.6 assignment
1.6 current
1.8 instance
1.6 update_all

app/models/concerns/geoip_lookup.rb

GeoipLookup::ClassMethods#iso_code_for

Total Score: 5.2

Score Operator
2.1 branch
1.0 assignment
1.0 geoip_lookup
1.1 found?
1.4 country
1.2 iso_code

GeoipLookup::ClassMethods#country_name_for

Total Score: 5.2

Score Operator
2.1 branch
1.0 assignment
1.0 geoip_lookup
1.1 found?
1.4 country
1.2 name

GeoipLookup::ClassMethods#geoip_db

Total Score: 3.2

Score Operator
1.0 current
1.2 fetch
1.0 new

GeoipLookup::ClassMethods#geoip_lookup

Total Score: 2.8

Score Operator
1.0 branch
1.3 geoip_db
1.1 lookup
1.1 assignment

GeoipLookup::ClassMethods#none

Total Score: 1.0

Score Operator
1.0 private

app/models/petition.rb

Petition::nearly_overdue_in_moderation

Total Score: 5.2

Score Operator
1.8 moderation_overdue_at
1.8 moderation_near_overdue_at
1.6 in_moderation

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::signature_counts

Total Score: 5.1

Score Operator
1.5 assignment
1.7 signatures
1.7 last_signed_at
1.5 validated_count_by_constituency_id

app/models/country_petition_journal.rb

CountryPetitionJournal::signature_counts

Total Score: 5.1

Score Operator
1.5 assignment
1.7 signatures
1.7 last_signed_at
1.5 validated_count_by_location_code

lib/tasks/petitions.rake

namespace(epets)::namespace(petitions)::task::default_scope

Total Score: 5.1

Score Operator
3.6 where
1.5 not

app/mailers/admin_mailer.rb

AdminMailer#threshold_email_reminder

Total Score: 5.1

Score Operator
1.0 assignment
1.4 block_pass
1.4 to_proc_normal
1.2 map
1.0 mail

AdminMailer#none

Total Score: 3.7

Score Operator
1.2 branch
1.2 lambda
1.3 email_from
1.0 default

app/helpers/admin_hub_helper.rb

AdminHubHelper#summary_class_name_for_in_moderation

Total Score: 5.1

Score Operator
2.1 branch
1.2 overdue_in_moderation_count
2.1 >
1.3 nearly_overdue_in_moderation_count

AdminHubHelper#nearly_overdue_in_moderation_untagged_count

Total Score: 3.7

Score Operator
1.0 assignment
1.4 untagged
1.2 nearly_overdue_in_moderation
1.0 count

AdminHubHelper#recently_in_moderation_untagged_count

Total Score: 3.7

Score Operator
1.0 assignment
1.4 untagged
1.2 recently_in_moderation
1.0 count

AdminHubHelper#overdue_in_moderation_untagged_count

Total Score: 3.7

Score Operator
1.0 assignment
1.4 untagged
1.2 overdue_in_moderation
1.0 count

AdminHubHelper#petition_total_count

Total Score: 2.4

Score Operator
1.0 assignment
1.2 all
1.0 count

AdminHubHelper#archived_petition_total_count

Total Score: 2.4

Score Operator
1.0 assignment
1.2 all
1.0 count

AdminHubHelper#in_moderation_count

Total Score: 2.4

Score Operator
1.0 assignment
1.2 in_moderation
1.0 count

AdminHubHelper#recently_in_moderation_count

Total Score: 2.4

Score Operator
1.0 assignment
1.2 recently_in_moderation
1.0 count

AdminHubHelper#nearly_overdue_in_moderation_count

Total Score: 2.4

Score Operator
1.0 assignment
1.2 nearly_overdue_in_moderation
1.0 count

AdminHubHelper#overdue_in_moderation_count

Total Score: 2.4

Score Operator
1.0 assignment
1.2 overdue_in_moderation
1.0 count

AdminHubHelper#tagged_in_moderation_count

Total Score: 2.4

Score Operator
1.0 assignment
1.2 tagged_in_moderation
1.0 count

AdminHubHelper#untagged_in_moderation_count

Total Score: 2.4

Score Operator
1.0 assignment
1.2 untagged_in_moderation
1.0 count

AdminHubHelper#action_counts

Total Score: 2.2

Score Operator
1.0 assignment
1.0 new
1.0 yield

AdminHubHelper#action_count

Total Score: 2.2

Score Operator
1.2 number_with_delimiter
1.0 t

app/helpers/rejection_helper.rb

RejectionHelper#rejection_reasons

Total Score: 5.1

Score Operator
2.1 branch
1.2 t
1.0 map
1.3 to_s
1.1 in?

RejectionHelper#rejection_description

Total Score: 3.5

Score Operator
1.0 branch
1.0 blank?
1.3 t
1.1 html_safe

RejectionHelper#rejection_reason

Total Score: 2.3

Score Operator
1.0 branch
1.0 blank?
1.1 t

RejectionHelper#rejection_descriptions

Total Score: 1.0

Score Operator
1.0 t

Archived::Petition::Email#none

Total Score: 5.1

Score Operator
1.1 belongs_to
3.3 validates
0.7 lit_fixnum

Archived#none

Total Score: 5.0

Score Operator
5.0 sclass

app/models/site.rb

Site::instance

Total Score: 5.0

Score Operator
1.6 current
1.8 defaults
1.6 first_or_create

app/lib/email_reminder.rb

EmailReminder::logger

Total Score: 4.9

Score Operator
1.0 branch
2.4 assignment
1.6 root
1.4 join
1.2 new

app/models/holiday.rb

Holiday::easter?

Total Score: 4.9

Score Operator
1.5 assignment
1.5 current
1.7 instance
1.5 easter?

app/models/holiday.rb

Holiday::christmas?

Total Score: 4.9

Score Operator
1.5 assignment
1.5 current
1.7 instance
1.5 christmas?

app/models/site.rb

Site::validate#if

Total Score: 4.9

Score Operator
1.1 validate
1.1 branch
1.1 password_digest?
1.4 errors
1.2 add

app/models/constituency.rb

Constituency::before_validation#unless

Total Score: 4.9

Score Operator
1.1 before_validation
1.1 assignment
1.3 example_postcodes
1.3 ons_code
1.1 []

Constituency::before_validation#if

Total Score: 3.7

Score Operator
1.1 before_validation
1.1 assignment
1.3 name
1.1 parameterize

app/controllers/admin/petition_statistics_controller.rb

Admin::PetitionStatisticsController#fetch_petition

Total Score: 4.9

Score Operator
1.0 assignment
1.2 moderated
1.4 params
1.2 []
1.0 find

Admin::PetitionStatisticsController#update

Total Score: 3.2

Score Operator
1.0 perform_later
1.2 admin_petition_url
1.0 redirect_to

Admin::PetitionStatisticsController#none

Total Score: 3.0

Score Operator
2.0 before_action
1.0 private

app/jobs/stop_petitions_early_job.rb

StopPetitionsEarlyJob::schedule_for

Total Score: 4.9

Score Operator
1.7 set
1.7 iso8601
1.5 perform_later

app/jobs/close_petitions_early_job.rb

ClosePetitionsEarlyJob::schedule_for

Total Score: 4.9

Score Operator
1.7 set
1.7 iso8601
1.5 perform_later

app/helpers/moderation_helper.rb

ModerationHelper#moderation_delay?

Total Score: 4.8

Score Operator
1.4 in_moderation
1.2 count
1.2 threshold_for_moderation_delay
1.0 >=

app/models/site.rb

Site::default_constraints_for_public

Total Score: 4.8

Score Operator
1.6 default_protocol
1.6 default_host
1.6 default_port

app/models/site.rb

Site::default_constraints_for_moderation

Total Score: 4.8

Score Operator
1.6 default_protocol
1.6 default_moderate_host
1.6 default_port

app/controllers/pages_controller.rb

PagesController#manifest

Total Score: 4.8

Score Operator
0.4 lit_fixnum
1.2 hour
1.0 expires_in
1.0 branch
1.0 respond_to
1.1 json

PagesController#browserconfig

Total Score: 4.8

Score Operator
0.4 lit_fixnum
1.2 hour
1.0 expires_in
1.0 branch
1.0 respond_to
1.1 xml

PagesController#index

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

PagesController#help

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

PagesController#privacy

Total Score: 2.3

Score Operator
1.0 branch
1.0 respond_to
1.1 html

app/jobs/notify_creators_that_parliament_is_dissolving_job.rb

NotifyCreatorsThatParliamentIsDissolvingJob#perform

Total Score: 4.7

Score Operator
1.0 branch
1.2 petitions
1.0 find_each
1.3 creator
1.1 perform_later

NotifyCreatorsThatParliamentIsDissolvingJob#none

Total Score: 2.0

Score Operator
1.0 queue_as
1.0 private

NotifyCreatorsThatParliamentIsDissolvingJob#petitions

Total Score: 1.0

Score Operator
1.0 open_at_dissolution

app/jobs/notify_creators_that_moderation_is_delayed_job.rb

NotifyCreatorsThatModerationIsDelayedJob#perform

Total Score: 4.7

Score Operator
1.0 branch
1.2 petitions
1.0 find_each
1.3 creator
1.1 perform_later

NotifyCreatorsThatModerationIsDelayedJob#none

Total Score: 2.0

Score Operator
1.0 queue_as
1.0 private

NotifyCreatorsThatModerationIsDelayedJob#petitions

Total Score: 1.0

Score Operator
1.0 overdue_in_moderation

app/models/holiday.rb

Holiday::instance

Total Score: 4.7

Score Operator
1.5 current
1.7 defaults
1.5 first_or_create

app/lib/cloud_front_remote_ip.rb

CloudFrontRemoteIp::CloudFrontGetIp#filter_proxies

Total Score: 4.6

Score Operator
1.0 branch
1.0 key?
2.4 super
1.1 []

CloudFrontRemoteIp::CloudFrontGetIp#none

Total Score: 1.0

Score Operator
1.0 protected

Petition::Email#none

Total Score: 4.6

Score Operator
1.0 belongs_to
3.0 validates
0.6 lit_fixnum

app/controllers/admin/petition_tags_controller.rb

Admin::PetitionTagsController#update

Total Score: 4.5

Score Operator
1.0 branch
1.2 petition_params
1.0 update
1.1 redirect_to
1.1 render

Admin::PetitionTagsController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::PetitionTagsController#petition_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::PetitionTagsController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

Admin::PetitionTagsController#show

Total Score: 1.0

Score Operator
1.0 render

app/controllers/admin/petition_details_controller.rb

Admin::PetitionDetailsController#update

Total Score: 4.5

Score Operator
1.0 branch
1.2 petition_params
1.0 update_attributes
1.1 redirect_to
1.1 render

Admin::PetitionDetailsController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::PetitionDetailsController#petition_params

Total Score: 3.6

Score Operator
1.4 params
1.2 require
1.0 permit

Admin::PetitionDetailsController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

app/models/petition/statistics.rb

Petition::Statistics#refresh!

Total Score: 4.5

Score Operator
1.0 assignment
1.0 current
1.2 refresh_duplicate_emails
1.2 refresh_pending_rate
1.0 update!

Petition::Statistics#refresh_duplicate_emails

Total Score: 3.6

Score Operator
1.4 petition
1.2 signatures
1.0 duplicate_emails

Petition::Statistics#refresh_pending_rate

Total Score: 3.6

Score Operator
1.4 petition
1.2 signatures
1.0 pending_rate

Petition::Statistics#none

Total Score: 2.0

Score Operator
1.0 belongs_to
1.0 private

Petition::Statistics#refreshed?

Total Score: 1.0

Score Operator
1.0 refreshed_at?

app/controllers/admin/archived/locks_controller.rb

Admin::Archived::LocksController#show

Total Score: 4.4

Score Operator
1.2 current_user
1.0 update_lock!
1.0 branch
1.0 respond_to
1.1 json

Admin::Archived::LocksController#create

Total Score: 4.4

Score Operator
1.2 current_user
1.0 checkout!
1.0 branch
1.0 respond_to
1.1 json

Admin::Archived::LocksController#update

Total Score: 4.4

Score Operator
1.2 current_user
1.0 force_checkout!
1.0 branch
1.0 respond_to
1.1 json

Admin::Archived::LocksController#destroy

Total Score: 4.4

Score Operator
1.2 current_user
1.0 release!
1.0 branch
1.0 respond_to
1.1 json

Admin::Archived::LocksController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::Archived::LocksController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

app/controllers/admin/locks_controller.rb

Admin::LocksController#destroy

Total Score: 4.4

Score Operator
1.2 current_user
1.0 release!
1.0 branch
1.0 respond_to
1.1 json

Admin::LocksController#update

Total Score: 4.4

Score Operator
1.2 current_user
1.0 force_checkout!
1.0 branch
1.0 respond_to
1.1 json

Admin::LocksController#create

Total Score: 4.4

Score Operator
1.2 current_user
1.0 checkout!
1.0 branch
1.0 respond_to
1.1 json

Admin::LocksController#show

Total Score: 4.4

Score Operator
1.2 current_user
1.0 update_lock!
1.0 branch
1.0 respond_to
1.1 json

Admin::LocksController#fetch_petition

Total Score: 3.7

Score Operator
1.0 assignment
1.4 params
1.2 []
1.0 find

Admin::LocksController#none

Total Score: 2.0

Score Operator
1.0 before_action
1.0 private

app/jobs/debated_petitions_job.rb

DebatedPetitionsJob#perform

Total Score: 4.4

Score Operator
2.4 to_date
2.0 mark_petitions_as_debated!

DebatedPetitionsJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

app/jobs/reset_petition_signature_count_job.rb

ResetPetitionSignatureCountJob#perform

Total Score: 4.3

Score Operator
1.0 assignment
1.0 current_time
1.2 in_time_zone
1.0 reset_signature_count!
1.0 send_notification

ResetPetitionSignatureCountJob#current_time

Total Score: 3.6

Score Operator
1.4 current
1.2 change
1.0 iso8601

ResetPetitionSignatureCountJob#error_message

Total Score: 3.6

Score Operator
1.4 id
1.2 to_s
1.0 t

ResetPetitionSignatureCountJob#exception

Total Score: 2.2

Score Operator
1.2 error_message
1.0 new

ResetPetitionSignatureCountJob#send_notification

Total Score: 2.2

Score Operator
1.2 exception
1.0 send_exception

ResetPetitionSignatureCountJob#none

Total Score: 2.0

Score Operator
1.0 queue_as
1.0 private

app/models/petition.rb

Petition::popular_in_constituency

Total Score: 4.1

Score Operator
1.6 assignment
0.4 lit_fixnum
1.8 popular_in
1.6 for_state

app/models/petition.rb

Petition::all_popular_in_constituency

Total Score: 4.1

Score Operator
1.6 assignment
0.4 lit_fixnum
1.8 popular_in
1.6 for_state

app/models/site.rb

Site::default_domain

Total Score: 4.1

Score Operator
1.6 assignment
0.4 lit_fixnum
1.8 default_host
1.6 extract_domain

app/models/email_requested_receipt.rb

EmailRequestedReceipt#none

Total Score: 4.0

Score Operator
1.0 belongs_to
2.0 validates
1.0 private

EmailRequestedReceipt#possible_timestamps

Total Score: 3.7

Score Operator
1.0 assignment
1.4 attributes
1.2 keys
1.0 -

EmailRequestedReceipt#set

Total Score: 3.3

Score Operator
1.0 branch
1.0 valid_timestamp?
1.1 raise
1.0 update_column

EmailRequestedReceipt#get

Total Score: 3.3

Score Operator
1.0 branch
1.0 valid_timestamp?
1.1 raise
1.0 []

EmailRequestedReceipt#valid_timestamp?

Total Score: 2.2

Score Operator
1.2 possible_timestamps
1.0 include?

app/models/domain.rb

Domain::before_validation#if

Total Score: 3.9

Score Operator
1.0 before_validation
3.3 assignment
1.1 find_canonical_domain

Domain::before_validation#unless

Total Score: 1.4

Score Operator
1.0 before_validation
1.0 assignment

lib/tasks/bundle.rake

namespace(bundle)::task#audit

Total Score: 3.9

Score Operator
1.1 task
1.1 branch
1.1 system
0.4 lit_fixnum
1.2 exit

lib/tasks/brakeman.rake

namespace(brakeman)::task#check

Total Score: 3.9

Score Operator
1.1 task
1.1 branch
1.1 system
0.4 lit_fixnum
1.2 exit

app/models/feedback.rb

Feedback#none

Total Score: 3.9

Score Operator
0.9 lit_fixnum
3.0 validates

Feedback#petition_link?

Total Score: 3.2

Score Operator
1.2 url
1.0 escape
1.0 petition_link_or_title

app/models/concerns/perishable_token_generator.rb

PerishableTokenGenerator#has_perishable_token

Total Score: 3.9

Score Operator
1.1 branch
1.1 before_create
1.4 friendly_token
1.2 write_attribute

PerishableTokenGenerator#none

Total Score: 3.2

Score Operator
2.0 extend
1.0 branch
1.0 class_methods

lib/tasks/epets.rake

namespace(epets)::namespace(cache)::task#clear

Total Score: 3.8

Score Operator
1.2 task
1.4 cache
1.2 clear

lib/package_builder.rb

PackageBuilder::build!

Total Score: 3.8

Score Operator
1.6 assignment
1.8 new
1.6 build!

app/helpers/cache_helper.rb

CacheHelper::CacheKey::fragments

Total Score: 3.8

Score Operator
1.6 assignment
1.8 load_yaml
1.6 deep_symbolize_keys

app/helpers/signature_helper.rb

SignatureHelper#signature_count

Total Score: 3.7

Score Operator
1.0 assignment
1.4 number_with_delimiter
1.2 siganture_count_options
1.0 t

SignatureHelper#siganture_count_options

Total Score: 1.0

Score Operator
1.0 reverse_merge

SignatureHelper#none

Total Score: 1.0

Score Operator
1.0 private

AutoLinkHelper::AutoLinker::generate

Total Score: 3.7

Score Operator
1.0 assignment
1.4 block_pass
1.2 new
1.0 generate

app/models/constituency.rb

Constituency::refresh!

Total Score: 3.7

Score Operator
1.6 branch
1.6 find_each
1.7 refresh!

lib/postcode_sanitizer.rb

PostcodeSanitizer::call

Total Score: 3.6

Score Operator
1.4 to_s
1.2 gsub
1.0 upcase

lib/tasks/countries.rake

namespace(epets)::namespace(countries)::task#fetch

Total Score: 3.6

Score Operator
1.1 task
1.1 branch
1.1 run
1.2 perform_later

app/models/site.rb

Site::before_save#if

Total Score: 3.6

Score Operator
1.1 before_save
1.1 branch
1.1 update_signature_counts
1.2 perform_later

app/helpers/sharing_helper.rb

SharingHelper#share_via_facebook

Total Score: 3.5

Score Operator
1.0 assignment
1.2 share_button
1.2 share_via_facebook_url
1.0 link_to

SharingHelper#share_via_email

Total Score: 3.5

Score Operator
1.0 assignment
1.2 share_button
1.2 share_via_email_url
1.0 link_to

SharingHelper#share_via_twitter

Total Score: 3.5

Score Operator
1.0 assignment
1.2 share_button
1.2 share_via_twitter_url
1.0 link_to

SharingHelper#share_via_whatsapp

Total Score: 3.5

Score Operator
1.0 assignment
1.2 share_button
1.2 share_via_whatsapp_url
1.0 link_to

SharingHelper#share_via_whatsapp_params

Total Score: 3.4

Score Operator
1.2 share_title
1.2 petition_url
1.0 share_params

SharingHelper#share_via_twitter_params

Total Score: 3.4

Score Operator
1.2 share_title
1.2 petition_url
1.0 share_params

SharingHelper#share_via_email_params

Total Score: 3.4

Score Operator
1.2 share_title
1.2 petition_url
1.0 share_params

SharingHelper#share_title

Total Score: 2.2

Score Operator
1.2 action
1.0 t

SharingHelper#share_via_facebook_params

Total Score: 2.2

Score Operator
1.2 petition_url
1.0 share_params

SharingHelper#share_params

Total Score: 2.2

Score Operator
1.2 to_query
1.0 gsub

SharingHelper#share_via_whatsapp_url

Total Score: 1.0

Score Operator
1.0 share_via_whatsapp_params

SharingHelper#share_via_facebook_url

Total Score: 1.0

Score Operator
1.0 share_via_facebook_params

SharingHelper#none

Total Score: 1.0

Score Operator
1.0 private

SharingHelper#share_via_twitter_url

Total Score: 1.0

Score Operator
1.0 share_via_twitter_params

SharingHelper#share_via_email_url

Total Score: 1.0

Score Operator
1.0 share_via_email_params

SharingHelper#share_button

Total Score: 1.0

Score Operator
1.0 t

app/mailers/feedback_mailer.rb

FeedbackMailer#send_feedback

Total Score: 3.5

Score Operator
1.0 assignment
1.2 feedback_email
1.2 email
1.0 mail

app/controllers/constituencies_controller.rb

ConstituenciesController#index

Total Score: 3.4

Score Operator
1.0 assignment
1.0 by_ons_code
1.0 branch
1.0 respond_to
1.1 json

ConstituenciesController#none

Total Score: 1.0

Score Operator
1.0 before_action

app/lib/job_logger.rb

JobLogger#info

Total Score: 3.4

Score Operator
1.2 logger
1.2 job_class_name
1.0 info

JobLogger#error

Total Score: 3.4

Score Operator
1.2 logger
1.2 job_class_name
1.0 error

JobLogger#warn

Total Score: 3.4

Score Operator
1.2 logger
1.2 job_class_name
1.0 warn

JobLogger#debug

Total Score: 3.4

Score Operator
1.2 logger
1.2 job_class_name
1.0 debug

JobLogger#initialize

Total Score: 3.0

Score Operator
3.0 assignment

JobLogger#none

Total Score: 2.0

Score Operator
1.0 private
1.0 attr_reader

JobLogger#logger

Total Score: 1.4

Score Operator
1.0 assignment
1.0 logger

app/models/concerns/browseable.rb

Browseable::Filters#to_hash

Total Score: 3.4

Score Operator
1.2 params
1.2 filter_definitions
1.0 slice

Browseable::Filters#initialize

Total Score: 3.0

Score Operator
3.0 assignment

Browseable::Filters#none

Total Score: 2.0

Score Operator
1.0 attr_reader
1.0 delegate

app/helpers/cache_helper.rb

CacheHelper::CacheKey::build

Total Score: 3.4

Score Operator
1.8 new
1.6 build

lib/package_builder.rb

PackageBuilder::deploy!

Total Score: 3.4

Score Operator
1.8 new
1.6 deploy!

app/models/archived/signature.rb

Archived::Signature::postcode_search?

Total Score: 3.4

Score Operator
1.8 call
1.6 =~

app/models/archived/signature.rb

Archived::Signature::for_email

Total Score: 3.4

Score Operator
1.8 normalize_email
1.6 where

app/models/archived/signature.rb

Archived::Signature::for_postcode

Total Score: 3.4

Score Operator
1.8 call
1.6 where

app/models/archived/petition.rb

Archived::Petition::awaiting_response

Total Score: 3.4

Score Operator
1.8 response_threshold_reached
1.6 not_responded

app/models/archived/petition.rb

Archived::Petition::with_debate_outcome

Total Score: 3.4

Score Operator
1.8 where
1.6 not

app/models/archived/petition.rb

Archived::Petition::awaiting_debate_date

Total Score: 3.4

Score Operator
1.8 debate_threshold_reached
1.6 not_scheduled

app/models/archived/petition.rb

Archived::Petition::debate_scheduled

Total Score: 3.4

Score Operator
1.8 where
1.6 not

app/models/archived/petition.rb

Archived::Petition::response_threshold_reached

Total Score: 3.4

Score Operator
1.8 where
1.6 not

app/models/archived/petition.rb

Archived::Petition::debated

Total Score: 3.4

Score Operator
1.8 where
1.6 preload

app/models/archived/petition.rb

Archived::Petition::debate_threshold_reached

Total Score: 3.4

Score Operator
1.8 where
1.6 not

app/models/archived/signature.rb

Archived::Signature::for_domain

Total Score: 3.4

Score Operator
1.8 []
1.6 where

app/models/petition.rb

Petition::signature_count_validated_at

Total Score: 3.4

Score Operator
1.8 arel_table
1.6 []

app/models/petition.rb

Petition::moderation_near_overdue_at

Total Score: 3.4

Score Operator
1.8 moderation_near_overdue_in_days
1.6 ago

app/models/petition.rb

Petition::untagged_in_moderation

Total Score: 3.4

Score Operator
1.8 untagged
1.6 in_moderation

app/models/petition.rb

Petition::overdue_in_moderation

Total Score: 3.4

Score Operator
1.8 moderation_overdue_at
1.6 in_moderation

app/models/petition.rb

Petition::recently_in_moderation

Total Score: 3.4

Score Operator
1.8 moderation_near_overdue_at
1.6 in_moderation

app/models/petition.rb

Petition::moderation_threshold_reached_at

Total Score: 3.4

Score Operator
1.8 arel_table
1.6 []

app/models/petition.rb

Petition::tagged_in_moderation

Total Score: 3.4

Score Operator
1.8 tagged
1.6 in_moderation

app/models/petition.rb

Petition::last_signed_at

Total Score: 3.4

Score Operator
1.8 arel_table
1.6 []

app/models/petition.rb

Petition::moderation_overdue_at

Total Score: 3.4

Score Operator
1.8 moderation_overdue_in_days
1.6 ago

app/models/petition.rb

Petition::not_hidden

Total Score: 3.4

Score Operator
1.8 where
1.6 not

app/models/petition.rb

Petition::with_debate_outcome

Total Score: 3.4

Score Operator
1.8 where
1.6 not

app/models/petition.rb

Petition::response_threshold_reached

Total Score: 3.4

Score Operator
1.8 where
1.6 not

app/models/site.rb

Site::default_petition_duration

Total Score: 3.4

Score Operator
1.8 fetch
1.6 to_i

app/models/petition.rb

Petition::awaiting_debate_date

Total Score: 3.4

Score Operator
1.8 debate_threshold_reached
1.6 not_scheduled

app/models/parliament.rb

Parliament::government

Total Score: 3.4

Score Operator
1.8 instance
1.6 government

app/models/site.rb

Site::enabled?

Total Score: 3.4

Score Operator
1.8 instance
1.6 enabled?

app/models/site.rb

Site::default_login_timeout

Total Score: 3.4

Score Operator
1.8 fetch
1.6 to_i

app/models/site.rb

Site::default_password

Total Score: 3.4

Score Operator
1.8 fetch
1.6 presence

app/models/site.rb

Site::default_minimum_number_of_sponsors

Total Score: 3.4

Score Operator
1.8 fetch
1.6 to_i

app/models/site.rb

Site::default_username

Total Score: 3.4

Score Operator
1.8 fetch
1.6 presence

app/models/parliament.rb

Parliament::dissolution_faq_url

Total Score: 3.4

Score Operator
1.8 instance
1.6 dissolution_faq_url

app/models/site.rb

Site::default_feedback_email

Total Score: 3.4

Score Operator
1.8 default_domain
1.6 fetch

app/models/site.rb

Site::default_email_from

Total Score: 3.4

Score Operator
1.8 default_host
1.6 fetch

app/models/site.rb

Site::default_port

Total Score: 3.4

Score Operator
1.8 fetch
1.6 to_i

app/models/site.rb

Site::default_maximum_number_of_sponsors

Total Score: 3.4

Score Operator
1.8 fetch
1.6 to_i

app/models/parliament.rb

Parliament::dissolution_faq_url?

Total Score: 3.4

Score Operator
1.8 instance
1.6 dissolution_faq_url?

app/models/parliament.rb

Parliament::dissolution_heading

Total Score: 3.4

Score Operator
1.8 instance
1.6 dissolution_heading

app/models/petition.rb

Petition::debated

Total Score: 3.4

Score Operator
1.8 where
1.6 preload

app/models/invalidation.rb

Invalidation::running

Total Score: 3.4

Score Operator
1.8 started
1.6 not_completed

app/models/site.rb

Site::default_threshold_for_moderation

Total Score: 3.4

Score Operator
1.8 fetch
1.6 to_i

app/models/site.rb

Site::enable_signature_counts!

Total Score: 3.4

Score Operator
1.8 instance
1.6 update!

app/models/site.rb

Site::disable_signature_counts!

Total Score: 3.4

Score Operator
1.8 instance
1.6 update!

app/models/site.rb

Site::touch

Total Score: 3.4

Score Operator
1.8 instance
1.6 touch

app/models/site.rb

Site::login_timeout

Total Score: 3.4

Score Operator
1.8 instance
1.6 login_timeout

app/models/site.rb

Site::default_threshold_for_moderation_delay

Total Score: 3.4

Score Operator
1.8 fetch
1.6 to_i

app/models/site.rb

Site::protected?

Total Score: 3.4

Score Operator
1.8 instance
1.6 protected?

app/models/site.rb

Site::port

Total Score: 3.4

Score Operator
1.8 instance
1.6 port

app/models/site.rb

Site::moderate_host_with_port

Total Score: 3.4

Score Operator
1.8 instance
1.6 moderate_host_with_port

app/models/site.rb

Site::moderate_host

Total Score: 3.4

Score Operator
1.8 instance
1.6 moderate_host

app/models/site.rb

Site::host_with_port

Total Score: 3.4

Score Operator
1.8 instance
1.6 host_with_port

app/models/site.rb

Site::default_threshold_for_response

Total Score: 3.4

Score Operator
1.8 fetch
1.6 to_i

app/models/site.rb

Site::host

Total Score: 3.4

Score Operator
1.8 instance
1.6 host

app/models/site.rb

Site::formatted_threshold_for_debate

Total Score: 3.4

Score Operator
1.8 instance
1.6 formatted_threshold_for_debate

app/models/parliament.rb

Parliament::dissolution_message

Total Score: 3.4

Score Operator
1.8 instance
1.6 dissolution_message

app/models/site.rb

Site::email_protocol

Total Score: 3.4

Score Operator
1.8 instance
1.6 email_protocol

app/models/site.rb

Site::authenticate

Total Score: 3.4

Score Operator
1.8 instance
1.6 authenticate

app/models/parliament.rb

Parliament::dissolution_announced?

Total Score: 3.4

Score Operator
1.8 instance
1.6 dissolution_announced?

app/models/parliament.rb

Parliament::dissolved_message

Total Score: 3.4

Score Operator
1.8 instance
1.6 dissolved_message

app/models/parliament.rb

Parliament::registration_closed?

Total Score: 3.4

Score Operator
1.8 instance
1.6 registration_closed?

app/models/parliament.rb

Parliament::notification_cutoff_at

Total Score: 3.4

Score Operator
1.8 instance
1.6 notification_cutoff_at

app/models/parliament.rb

Parliament::dissolution_at

Total Score: 3.4

Score Operator
1.8 instance
1.6 dissolution_at

app/models/parliament.rb

Parliament::dissolved_heading

Total Score: 3.4

Score Operator
1.8 instance
1.6 dissolved_heading

app/models/petition.rb

Petition::debate_threshold_reached

Total Score: 3.4

Score Operator
1.8 where
1.6 not

app/models/parliament.rb

Parliament::opening_at

Total Score: 3.4

Score Operator
1.8 instance
1.6 opening_at

app/models/petition.rb

Petition::awaiting_response

Total Score: 3.4

Score Operator
1.8 response_threshold_reached
1.6 not_responded

app/models/site.rb

Site::formatted_threshold_for_moderation

Total Score: 3.4

Score Operator
1.8 instance
1.6 formatted_threshold_for_moderation

app/models/site.rb

Site::default_threshold_for_debate

Total Score: 3.4

Score Operator
1.8 fetch
1.6 to_i

app/models/petition.rb

Petition::current

Total Score: 3.4

Score Operator
1.8 open_state
1.6 by_most_recent

app/models/parliament.rb

Parliament::current

Total Score: 3.4

Score Operator
1.8 where
1.6 order

app/models/site.rb

Site::formatted_threshold_for_response

Total Score: 3.4

Score Operator
1.8 instance
1.6 formatted_threshold_for_response

app/models/signature.rb

Signature::validated_at

Total Score: 3.4

Score Operator
1.8 arel_table
1.6 []

app/models/signature.rb

Signature::postcode_search?

Total Score: 3.4

Score Operator
1.8 call
1.6 =~

app/models/signature.rb

Signature::for_domain

Total Score: 3.4

Score Operator
1.8 []
1.6 where

app/models/signature.rb

Signature::for_postcode

Total Score: 3.4

Score Operator
1.8 call
1.6 where

app/models/signature.rb

Signature::for_email

Total Score: 3.4

Score Operator
1.8 normalize_email
1.6 where

app/jobs/invalidate_signatures_job.rb

InvalidateSignaturesJob#none

Total Score: 3.3

Score Operator
1.0 queue_as
1.0 branch
1.0 rescue_from
1.1 send_exception

InvalidateSignaturesJob#perform

Total Score: 1.0

Score Operator
1.0 invalidate!

app/models/petition/statistics.rb

Petition::Statistics::after_commit#on

Total Score: 3.2

Score Operator
1.0 after_commit
1.2 petition
1.0 perform_later

app/helpers/page_title_helper.rb

PageTitleHelper::PageTitleBuilder::build

Total Score: 3.2

Score Operator
1.7 new
1.5 build

app/models/domain.rb

Domain::with_options#class_name

Total Score: 3.2

Score Operator
1.0 with_options
1.1 belongs_to
1.1 has_many

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::last_signed_at

Total Score: 3.2

Score Operator
1.7 arel_table
1.5 []

app/models/archived/signature.rb

Archived::Signature::normalize_email

Total Score: 3.2

Score Operator
1.6 normalize_user
1.6 normalize_domain

app/models/site.rb

Site::default_moderate_url_components

Total Score: 3.2

Score Operator
1.6 default_moderate_host
1.6 default_port

app/models/site.rb

Site::default_url_components

Total Score: 3.2

Score Operator
1.6 default_host
1.6 default_port

app/models/parliament.rb

Parliament::instance

Total Score: 3.2

Score Operator
1.6 current
1.6 current_or_create

app/models/country_petition_journal.rb

CountryPetitionJournal::last_signed_at

Total Score: 3.2

Score Operator
1.7 arel_table
1.5 []

app/models/location.rb

Location::start_date

Total Score: 3.2

Score Operator
1.7 arel_table
1.5 []

app/models/location.rb

Location::end_date

Total Score: 3.2

Score Operator
1.7 arel_table
1.5 []

app/models/location.rb

Location::menu

Total Score: 3.2

Score Operator
1.7 current
1.5 pluck

app/models/signature.rb

Signature::normalize_email

Total Score: 3.2

Score Operator
1.6 normalize_user
1.6 normalize_domain

app/models/statistics.rb

Statistics::select_rows

Total Score: 3.2

Score Operator
1.7 connection
1.5 select_rows

app/models/admin_user.rb

AdminUser::before_update#if

Total Score: 3.0

Score Operator
1.0 before_update
2.2 assignment
1.1 current

app/jobs/application_job.rb

ApplicationJob#none

Total Score: 3.0

Score Operator
2.0 before_perform
1.0 private

ApplicationJob#reload_parliament

Total Score: 1.0

Score Operator
1.0 reload

ApplicationJob#reload_site

Total Score: 1.0

Score Operator
1.0 reload

app/models/archived/signature.rb

Archived::Signature::ip_search?

Total Score: 2.9

Score Operator
1.6 branch
1.7 new
1.7 assignment

app/models/signature.rb

Signature::ip_search?

Total Score: 2.9

Score Operator
1.6 branch
1.7 new
1.7 assignment

Archived::EmailThresholdResponseJob#none

Total Score: 2.8

Score Operator
2.0 include
2.0 assignment

Archived::EmailDebateOutcomesJob#none

Total Score: 2.8

Score Operator
2.0 include
2.0 assignment

EmailDebateOutcomesJob#none

Total Score: 2.8

Score Operator
2.0 include
2.0 assignment

Archived::EmailDebateScheduledJob#none

Total Score: 2.8

Score Operator
2.0 include
2.0 assignment

PetitionAndEmailConfirmationForSponsorEmailJob#none

Total Score: 2.8

Score Operator
2.0 assignment
2.0 include

EmailDebateScheduledJob#none

Total Score: 2.8

Score Operator
2.0 include
2.0 assignment

EmailThresholdResponseJob#none

Total Score: 2.8

Score Operator
2.0 include
2.0 assignment

EmailConfirmationForSignerEmailJob#none

Total Score: 2.8

Score Operator
2.0 assignment
2.0 include

app/models/task.rb

Task::task_for

Total Score: 2.7

Score Operator
1.5 branch
1.6 find_or_create_by!
1.6 assignment

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::for

Total Score: 2.7

Score Operator
1.5 branch
1.6 find_or_create_by
1.6 assignment

app/models/domain.rb

Domain::default_domain

Total Score: 2.7

Score Operator
1.5 branch
1.6 find_or_create_by
1.6 assignment

app/models/country_petition_journal.rb

CountryPetitionJournal::for

Total Score: 2.7

Score Operator
1.5 branch
1.6 find_or_create_by
1.6 assignment

AutoLinkHelper#auto_link

Total Score: 2.4

Score Operator
1.0 assignment
1.2 block_pass
1.0 generate

lib/tasks/deploy.rake

namespace(deploy)::task#preview

Total Score: 2.4

Score Operator
1.2 task
1.2 deploy!

namespace(deploy)::task#production

Total Score: 2.4

Score Operator
1.2 task
1.2 deploy!

namespace(deploy)::task#staging

Total Score: 2.4

Score Operator
1.2 task
1.2 deploy!

namespace(deploy)::task#dev

Total Score: 2.4

Score Operator
1.2 task
1.2 deploy!

namespace(deploy)::task#build

Total Score: 2.4

Score Operator
1.2 task
1.2 build!

lib/tasks/epets.rake

namespace(epets)::namespace(jobs)::task#unlock_all

Total Score: 2.4

Score Operator
1.2 task
1.2 update_all

lib/tasks/epets.rake

namespace(epets)::namespace(whenever)::task#update_crontab_primary

Total Score: 2.4

Score Operator
1.2 task
1.2 execute

namespace(epets)::namespace(whenever)::task#update_crontab_all

Total Score: 2.4

Score Operator
1.2 task
1.2 execute

app/models/site.rb

Site::reload

Total Score: 2.3

Score Operator
1.6 assignment
1.6 current

app/models/site.rb

Site::before_remove_const

Total Score: 2.3

Score Operator
1.6 assignment
1.6 current

app/models/parliament.rb

Parliament::reload

Total Score: 2.3

Score Operator
1.6 assignment
1.6 current

app/models/parliament.rb

Parliament::before_remove_const

Total Score: 2.3

Score Operator
1.6 assignment
1.6 current

app/lib/cloud_front_remote_ip.rb

CloudFrontRemoteIp#call

Total Score: 2.2

Score Operator
1.0 assignment
1.0 new
1.0 call

CloudFrontRemoteIp#none

Total Score: 2.0

Score Operator
2.0 freeze

lib/health_check.rb

HealthCheck::checkup

Total Score: 2.2

Score Operator
1.2 new
1.0 checkup

lib/arel_extensions.rb

Arel::Predications#contained

Total Score: 2.2

Score Operator
1.2 quoted_node
1.0 new

Arel::Predications#contains

Total Score: 2.2

Score Operator
1.2 quoted_node
1.0 new

Arel::Predications#overlaps

Total Score: 2.2

Score Operator
1.2 quoted_node
1.0 new

app/jobs/close_petitions_job.rb

ClosePetitionsJob#perform

Total Score: 2.2

Score Operator
1.2 in_time_zone
1.0 close_petitions!

ClosePetitionsJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

app/jobs/update_petition_statistics_job.rb

UpdatePetitionStatisticsJob#perform

Total Score: 2.2

Score Operator
1.2 statistics
1.0 refresh!

UpdatePetitionStatisticsJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

app/models/concerns/browseable.rb

Browseable::ClassMethods#search

Total Score: 2.2

Score Operator
1.2 all
1.0 new

Browseable::ClassMethods#filter

Total Score: 2.2

Score Operator
1.2 filter_definitions
1.0 <<

Browseable::ClassMethods#facet

Total Score: 1.4

Score Operator
1.0 assignment
1.0 facet_definitions

Archived::Note#none

Total Score: 2.2

Score Operator
1.1 belongs_to
1.1 validates

app/models/holiday.rb

Holiday::before_remove_const

Total Score: 2.1

Score Operator
1.5 assignment
1.5 current

app/models/site.rb

Site::moderation_overdue_in_days

Total Score: 2.1

Score Operator
0.5 lit_fixnum
1.6 days

app/models/site.rb

Site::moderation_near_overdue_in_days

Total Score: 2.1

Score Operator
0.5 lit_fixnum
1.6 days

app/controllers/ping_controller.rb

PingController#none

Total Score: 2.0

Score Operator
2.0 skip_before_action

PingController#ping

Total Score: 1.0

Score Operator
1.0 render

app/jobs/sponsor_signed_email_on_threshold_email_job.rb

SponsorSignedEmailOnThresholdEmailJob#none

Total Score: 2.0

Score Operator
2.0 assignment

SponsorSignedEmailOnThresholdEmailJob#perform

Total Score: 1.4

Score Operator
1.0 branch
1.0 validated?

app/jobs/sponsor_signed_email_below_threshold_email_job.rb

SponsorSignedEmailBelowThresholdEmailJob#none

Total Score: 2.0

Score Operator
2.0 assignment

SponsorSignedEmailBelowThresholdEmailJob#perform

Total Score: 1.4

Score Operator
1.0 branch
1.0 validated?

GatherSponsorsForPetitionEmailJob#none

Total Score: 2.0

Score Operator
2.0 assignment

app/jobs/feedback_email_job.rb

FeedbackEmailJob::before_perform#if

Total Score: 2.0

Score Operator
1.0 before_perform
1.0 raise

NotifySponsorThatPetitionWasRejectedEmailJob#none

Total Score: 2.0

Score Operator
2.0 assignment

NotifyCreatorThatPetitionIsPublishedEmailJob#none

Total Score: 2.0

Score Operator
2.0 assignment

NotifySponsorThatPetitionIsPublishedEmailJob#none

Total Score: 2.0

Score Operator
2.0 assignment

NotifyCreatorThatPetitionWasRejectedEmailJob#none

Total Score: 2.0

Score Operator
2.0 assignment

Note#none

Total Score: 2.0

Score Operator
1.0 belongs_to
1.0 validates

app/helpers/cache_helper.rb

CacheHelper::CacheKey::reset_fragments

Total Score: 1.6

Score Operator
1.6 assignment

app/models/archived/signature.rb

Archived::Signature::for_petition

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/signature.rb

Archived::Signature::for_ip

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/signature.rb

Archived::Signature::subscribed

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/signature.rb

Archived::Signature::validated

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/signature.rb

Archived::Signature::domain_search?

Total Score: 1.6

Score Operator
1.6 starts_with?

app/models/archived/signature.rb

Archived::Signature::email_search?

Total Score: 1.6

Score Operator
1.6 include?

app/models/archived/petition.rb

Archived::Petition::for_state

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::by_created_at

Total Score: 1.6

Score Operator
1.6 reorder

app/models/archived/petition.rb

Archived::Petition::by_most_recent_debate_outcome

Total Score: 1.6

Score Operator
1.6 reorder

app/models/archived/petition.rb

Archived::Petition::by_waiting_for_debate_longest

Total Score: 1.6

Score Operator
1.6 reorder

app/models/archived/petition.rb

Archived::Petition::by_most_recent

Total Score: 1.6

Score Operator
1.6 reorder

app/models/archived/petition.rb

Archived::Petition::by_most_signatures

Total Score: 1.6

Score Operator
1.6 reorder

app/models/archived/petition.rb

Archived::Petition::by_waiting_for_response_longest

Total Score: 1.6

Score Operator
1.6 reorder

app/models/archived/petition.rb

Archived::Petition::not_responded

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::published

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::moderated

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::stopped

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::closed

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::rejected

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::hidden

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::debateable

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::not_debated

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::not_scheduled

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/petition.rb

Archived::Petition::visible

Total Score: 1.6

Score Operator
1.6 where

app/models/archived/signature.rb

Archived::Signature::sector_search?

Total Score: 1.6

Score Operator
1.6 call

app/models/archived/signature.rb

Archived::Signature::by_most_recent

Total Score: 1.6

Score Operator
1.6 order

app/models/petition.rb

Petition::unarchived

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::sanitized_tag

Total Score: 1.6

Score Operator
1.6 gsub

app/models/petition.rb

Petition::grouping

Total Score: 1.6

Score Operator
1.6 new

app/models/petition.rb

Petition::selectable

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::not_scheduled

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::respondable

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::not_responded

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::visible

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::show

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::stoppable

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::todo_list

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::moderated

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::not_debated

Total Score: 1.6

Score Operator
1.6 where

app/models/site.rb

Site::default_host

Total Score: 1.6

Score Operator
1.6 fetch

app/models/petition.rb

Petition::hidden_state

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::closed_state

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::open_state

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::by_waiting_for_response_longest

Total Score: 1.6

Score Operator
1.6 reorder

app/models/petition.rb

Petition::by_waiting_for_debate_longest

Total Score: 1.6

Score Operator
1.6 reorder

app/models/petition.rb

Petition::by_oldest

Total Score: 1.6

Score Operator
1.6 reorder

app/models/petition.rb

Petition::by_most_relevant_debate_date

Total Score: 1.6

Score Operator
1.6 reorder

app/models/petition.rb

Petition::by_most_recent_response

Total Score: 1.6

Score Operator
1.6 reorder

app/models/petition.rb

Petition::by_most_recent_moderation_threshold_reached

Total Score: 1.6

Score Operator
1.6 reorder

app/models/petition.rb

Petition::by_most_recent_debate_outcome

Total Score: 1.6

Score Operator
1.6 reorder

app/models/petition.rb

Petition::by_most_recent

Total Score: 1.6

Score Operator
1.6 reorder

app/models/site.rb

Site::default_moderate_host

Total Score: 1.6

Score Operator
1.6 fetch

app/models/invalidation.rb

Invalidation::pending

Total Score: 1.6

Score Operator
1.6 where

app/models/signature_logs.rb

SignatureLogs::find

Total Score: 1.6

Score Operator
1.6 new

app/models/site.rb

Site::default_title

Total Score: 1.6

Score Operator
1.6 fetch

app/models/petition.rb

Petition::for_state

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::debateable

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::collecting_sponsors

Total Score: 1.6

Score Operator
1.6 where

app/models/site.rb

Site::default_scheme

Total Score: 1.6

Score Operator
1.6 fetch

app/models/petition.rb

Petition::awaiting_debate

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::stopped_state

Total Score: 1.6

Score Operator
1.6 where

app/models/site.rb

Site::default_protocol

Total Score: 1.6

Score Operator
1.6 default_scheme

app/models/petition.rb

Petition::sponsored_state

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::rejected_state

Total Score: 1.6

Score Operator
1.6 where

app/models/petition.rb

Petition::by_most_popular

Total Score: 1.6

Score Operator
1.6 reorder

app/models/invalidation.rb

Invalidation::by_most_recent

Total Score: 1.6

Score Operator
1.6 reorder

app/models/invalidation.rb

Invalidation::by_longest_running

Total Score: 1.6

Score Operator
1.6 reorder

app/models/constituency.rb

Constituency::query

Total Score: 1.6

Score Operator
1.6 new

app/models/constituency.rb

Constituency::by_ons_code

Total Score: 1.6

Score Operator
1.6 order

app/models/signature.rb

Signature::domain_search?

Total Score: 1.6

Score Operator
1.6 starts_with?

app/models/signature.rb

Signature::email_search?

Total Score: 1.6

Score Operator
1.6 include?

app/models/signature.rb

Signature::sector_search?

Total Score: 1.6

Score Operator
1.6 call

app/models/signature.rb

Signature::total

Total Score: 1.6

Score Operator
1.6 where

app/models/signature.rb

Signature::uk

Total Score: 1.6

Score Operator
1.6 where

app/models/signature.rb

Signature::unarchived

Total Score: 1.6

Score Operator
1.6 where

app/models/signature.rb

Signature::pending

Total Score: 1.6

Score Operator
1.6 where

app/models/signature.rb

Signature::subscribed

Total Score: 1.6

Score Operator
1.6 where

app/models/signature.rb

Signature::invalidated

Total Score: 1.6

Score Operator
1.6 where

app/models/signature.rb

Signature::for_ip

Total Score: 1.6

Score Operator
1.6 where

app/models/signature.rb

Signature::fraudulent

Total Score: 1.6

Score Operator
1.6 where

app/models/signature.rb

Signature::for_petition

Total Score: 1.6

Score Operator
1.6 where

app/models/signature.rb

Signature::for_invalidating

Total Score: 1.6

Score Operator
1.6 where

app/models/tag.rb

Tag::by_name

Total Score: 1.6

Score Operator
1.6 order

app/models/signature.rb

Signature::by_most_recent

Total Score: 1.6

Score Operator
1.6 order

app/models/constituency/api_query.rb

Constituency::ApiQuery::before_remove_const

Total Score: 1.6

Score Operator
1.1 assignment
1.1 current

app/models/constituency_petition_journal.rb

ConstituencyPetitionJournal::ordered

Total Score: 1.5

Score Operator
1.5 order

app/models/domain.rb

Domain::default_scope

Total Score: 1.5

Score Operator
1.5 preload

app/models/domain.rb

Domain::by_name

Total Score: 1.5

Score Operator
1.5 order

app/models/location.rb

Location::by_name

Total Score: 1.5

Score Operator
1.5 order

TrendingDomain::default_scope

Total Score: 1.5

Score Operator
1.5 order

TrendingDomain::log!

Total Score: 1.5

Score Operator
1.5 create!

app/models/statistics.rb

Statistics::connection

Total Score: 1.5

Score Operator
1.5 connection

TrendingIp::default_scope

Total Score: 1.5

Score Operator
1.5 order

TrendingIp::log!

Total Score: 1.5

Score Operator
1.5 create!

app/helpers/page_title_helper.rb

PageTitleHelper#page_title

Total Score: 1.0

Score Operator
1.0 build

lib/arel_extensions.rb

Arel::Visitors::PostgreSQL#none

Total Score: 1.0

Score Operator
1.0 private

Arel::Visitors::PostgreSQL#visit_Arel_Nodes_Contained

Total Score: 1.0

Score Operator
1.0 infix_value

Arel::Visitors::PostgreSQL#visit_Arel_Nodes_Contains

Total Score: 1.0

Score Operator
1.0 infix_value

Arel::Visitors::PostgreSQL#visit_Arel_Nodes_Overlaps

Total Score: 1.0

Score Operator
1.0 infix_value

app/jobs/email_threshold_reminder_job.rb

EmailThresholdReminderJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

EmailThresholdReminderJob#perform

Total Score: 1.0

Score Operator
1.0 threshold_email_reminder

app/jobs/refresh_constituencies_job.rb

RefreshConstituenciesJob#perform

Total Score: 1.0

Score Operator
1.0 refresh!

RefreshConstituenciesJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

app/jobs/delete_petition_job.rb

DeletePetitionJob#none

Total Score: 1.0

Score Operator
1.0 queue_as

DeletePetitionJob#perform

Total Score: 1.0

Score Operator
1.0 destroy

Generated on 2019-09-22 14:30:40 -0400