RailsRuby and TypeScript
lobsters
Worth knowing
-
Finding GET/comments/:id 404 1caller
Provider produces status 404 but no consumer branch handles it
Served byapp/controllers/comments_controller.rb:72 70
def show71if !(comment = find_comment)72return render plain: "can't find comment", status: 40473end74if !comment.is_editable_by_user?(@user)75return redirect_to Routes.comment_target_path(comment, true)76end7778render partial: "comment",79layout: false,80content_type: "text/html",81locals: {82comment: comment,83show_tree_lines: params[:show_tree_lines]84}85endCalled fromapp/javascript/user.js:920 920
on('click', 'button.comment-cancel', (event) => {921const comment = (parentSelector(event.target, '.reply_form_temporary'));922const commentId = comment.getAttribute('data-shortid');923if (commentId !== null && commentId !== '') {924fetch('/comments/' + commentId + '?show_tree_lines=true')925.then(response => {926response.text().then(text => replace(comment, text));927});928} else {929comment.remove();930}931});check -
Most tables written GET/stories/:id writes 10 tables 10tables
- writes
m.save! - writes
suggested_taggings.where(user_id: user.id).delete_all - writes
st.save! - writes
ModMail.create! recipients: [user, inviter], subject: "New user story submission" - writes
mail.mod_mail_messages.create! user: User.system_user, message: message - writes
m.save! - writes
Link.where(from_story_id: s.id).delete_all - writes
origins.find_or_create_by(identifier: identifier) - writes
ModNote.create!(attrs) - writes
Keystore.upsert({key: key, value: amount}, on_duplicate: Arel.sql("value = value + 1"))
ask -
GET routes that write 15 GET routes write a table 15routes
- writes
m.save! - writes
ModNote.create!(attrs) - writes
@user&.touch(:last_read_newest_comment) - writes
@user&.touch(:last_read_newest_comment) - writes
@user&.touch(:last_read_newest_story) - writes
@user&.touch(:last_read_newest_story)
ask -
Most-written table Message written by 44 routes 44routes
- Moderation.send_message_to_moderated36 routes
m.save! - User.delete!2 routes
sent_messages.update_all(deleted_by_author: true) - HatRequest.approve_by_user_for_reason!1 route
m.save! - HatRequest.reject_by_user_for_reason!1 route
m.save! - MessagesController.create1 route
@new_message.save - MessagesController.destroy1 route
@message.save!
ask -
Shared early return 63 routes return 302 from
require_logged_in_user63routesand 39 more
inspect
Browse
Filters
The list needs JavaScript.
Coverage
Read
| Read | Functions | Packs | Found |
|---|---|---|---|
suss extract --lang ruby -f activerecord=suss.activerecord.json -f activejob -f rails=suss.rails.json -f net-http | 661 | activerecord activejob rails net-http | 200 routes |
suss extract --lang typescript -f fetch -f node | 15 | fetch node | 3 HTTP calls |
Checkcheck
- 15pairs checked
- 1of 200 routes with a caller here
- 3HTTP calls, 1 paired with a route here
Findings
- 1
unhandledProviderCasewarning
Not followed
- 161calls not followed
- 102of 676 functions make one
- 200routes reach one
- 4functions with an outcome not read
Most often
- 17
filtered_tags.mapin CommentsController.index - 3
filtered_tags.index_byin FiltersController.index - 2
@search.results.mapin SearchController.index - 2
app.errors.full_messages.joinin SettingsController.mastodon_auth - 2
comment_query .limit(COMMENTS_PER_PAGE).offsetin CommentsController.upvoted