suss lobsters

RailsRuby and TypeScript

lobsters

161Calls not followed
  • in 102 functions

Worth knowing

  1. Finding GET/comments/:id 404 unhandledProviderCase · warning · both sides read 1caller

    Provider produces status 404 but no consumer branch handles it

    Served byapp/controllers/comments_controller.rb:72
    70def show71  if !(comment = find_comment)72    return render plain: "can't find comment", status: 40473  end74  if !comment.is_editable_by_user?(@user)75    return redirect_to Routes.comment_target_path(comment, true)76  end77 78  render partial: "comment",79    layout: false,80    content_type: "text/html",81    locals: {82      comment: comment,83      show_tree_lines: params[:show_tree_lines]84    }85end
    Called fromapp/javascript/user.js:920
    920on('click', 'button.comment-cancel', (event) => {921  const comment = (parentSelector(event.target, '.reply_form_temporary'));922  const commentId = comment.getAttribute('data-shortid');923  if (commentId !== null && commentId !== '') {924    fetch('/comments/' + commentId + '?show_tree_lines=true')925      .then(response => {926        response.text().then(text => replace(comment, text));927      });928  } else {929    comment.remove();930  }931});
    check
  2. Most tables written GET/stories/:id writes 10 tables Moderation, SuggestedTagging, SuggestedTitle, ModMail, ModMailMessage, Message, Link, Origin, ModNote, Keystore 10tables
    • writes
      m.save!
      app/models/story.rb:846via @story.as_jsonsend, which may run log_moderation
    • writes
      suggested_taggings.where(user_id: user.id).delete_all
      app/models/story.rb:902via @story.as_jsonsend, which may run save_suggested_tags_for_user!
    • writes
      st.save!
      app/models/story.rb:951via @story.as_jsonsend, which may run save_suggested_title_for_user!
    • writes
      ModMail.create! recipients: [user, inviter], subject: "New user story submission"
      app/models/mod_mail.rb:41via @story.as_jsonsend, which may run check_not_brigadingModMail.create_inviter_discussion!
    • writes
      mail.mod_mail_messages.create! user: User.system_user, message: message
      app/models/mod_mail.rb:42via @story.as_jsonsend, which may run check_not_brigadingModMail.create_inviter_discussion!
    • writes
      m.save!
      app/models/moderation.rb:125via @story.as_jsonsend, which may run log_moderationsend_message_to_moderated
    • writes
      Link.where(from_story_id: s.id).delete_all
      app/models/link.rb:68via @story.as_jsonsend, which may run recreate_linksLink.recreate_from_story!
    • writes
      origins.find_or_create_by(identifier: identifier)
      app/models/domain.rb:78via @story.as_jsonsend, which may run set_domain_and_origindomain.find_or_create_origin
    • writes
      ModNote.create!(attrs)
      app/models/mod_note.rb:199via @story.as_jsonsend, which may run check_not_brigadingModNote.tattle_on_brigading!create_without_dupe!
    • writes
      Keystore.upsert({key: key, value: amount}, on_duplicate: Arel.sql("value = value + 1"))
      app/models/keystore.rb:38via @story.as_jsonsend, which may run mark_submitterKeystore.increment_value_forincremented_value_for
    ask
  3. GET routes that write 15 GET routes write a table /c/:id.json, /comments/:id/reply, /comments, and 12 more 15routes
    ask
  4. Most-written table Message written by 44 routes 8 places write it 44routes
    ask
  5. Shared early return 63 routes return 302 from require_logged_in_user when !(@user) 63routes

    and 39 more

    inspect

Browse

Filters

The list needs JavaScript.

Coverage

Read

ReadFunctionsPacksFound
suss extract --lang ruby -f activerecord=suss.activerecord.json -f activejob -f rails=suss.rails.json -f net-http661activerecord activejob rails net-http200 routes
suss extract --lang typescript -f fetch -f node15fetch node3 HTTP calls

Checkcheck

  • 15pairs checked
  • 1of 200 routes with a caller here
  • 3HTTP calls, 1 paired with a route here

Findings

  • 1unhandledProviderCase warning

Not followed

  • 161calls not followed
  • 102of 676 functions make one
  • 200routes reach one
  • 4functions with an outcome not read

Most often