b310-digital / mindwendel

Create a challenge. Ready? Brainstorm. mindwendel helps you to easily brainstorm and upvote ideas and thoughts within your team.
https://www.mindwendel.com
GNU Affero General Public License v3.0
79 stars 13 forks source link

Tobi mega issue #351

Open PragTob opened 1 month ago

PragTob commented 1 month ago

Aight here is an overview issue, high level I haven't looked at the code in more detail yet:

Overview

image

Phoenix HTML style/dependency upgrade

(gave this one its own section due to its importance imo)

This relates to #310 but is more than this. The HTML usage is kind of old. There is a new "style" with heex to write components in that we don't seem to be using that seems to have been [introduced in 0.16[(https://hexdocs.pm/phoenix_live_view/bindings.html#rate-limiting-events-with-debounce-and-throttle) (we're on 0.18.18):

i.e. instead of:

<%= f = form_for @changeset, "#" %>
  <%= input f, :foo %>
</form>

what's done is:

<.form :let={f} for={@changeset}>
  <%= input f, :foo %>
</.form>

(and I think these days you also use a function component for input so <.input ... >).

Most notably phoenix now generates some core components (see f.ex. here - not sure when it was introduced) which is really nice and useful imo. (future Tobi: seems to have been added in 1.7 along with tailwind)

Might be nice to start the migration soon (unless there are deadlines), as otherwise it'll always become more code to change. I think it can be done step by step. Maybe after #344 ?

Performance

[info] Sent 200 in 16ms
[info] CONNECTED TO Phoenix.LiveView.Socket in 44µs
  Transport: :websocket
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "SgtKFFQ5Iwp7DXEaQTRsCCUkVAgRMDswxzx-1AtH8O8o0_9RGSloxURJ", "_live_referer" => "undefined", "_mounts" => "0", "_track_static" => %{"0" => "http://localhost:4000/assets/app.css", "1" => "http://localhost:4000/assets/app.js"}, "vsn" => "2.0.0"}
[debug] MOUNT MindwendelWeb.BrainstormingLive.Show
  Parameters: %{"id" => "83e5c67e-800e-40ca-86be-8fd02a15289e"}
  Session: %{"_csrf_token" => "2q29exWBCBIuqkUZbw8gieiz", "current_user_id" => "cd21937f-d428-4deb-96e5-bf7e7559817b"}
[debug] QUERY OK source="brainstormings" db=0.3ms idle=130.9ms
SELECT b0."id", b0."name", b0."option_show_link_to_settings", b0."option_allow_manual_ordering", b0."admin_url_id", b0."last_accessed_at", b0."creating_user_id", b0."inserted_at", b0."updated_at" FROM "brainstormings" AS b0 WHERE (b0."id" = $1) ["83e5c67e-800e-40ca-86be-8fd02a15289e"]
[debug] QUERY OK source="users" db=0.3ms idle=131.3ms
SELECT u0."id", u0."username", u0."inserted_at", u0."updated_at", b1."brainstorming_id"::uuid FROM "users" AS u0 INNER JOIN "brainstorming_users" AS b1 ON u0."id" = b1."user_id" WHERE (b1."brainstorming_id" = ANY($1)) ORDER BY b1."brainstorming_id"::uuid [["83e5c67e-800e-40ca-86be-8fd02a15289e"]]
[debug] QUERY OK source="ideas" db=0.3ms idle=131.1ms
SELECT i0."id", i0."body", i0."position_order", i0."username", i0."label", i0."user_id", i0."brainstorming_id", i0."label_id", i0."inserted_at", i0."updated_at", i0."brainstorming_id" FROM "ideas" AS i0 WHERE (i0."brainstorming_id" = $1) ORDER BY i0."brainstorming_id" ["83e5c67e-800e-40ca-86be-8fd02a15289e"]
[debug] QUERY OK source="users" db=0.6ms idle=131.1ms
SELECT u0."id", u0."username", u0."inserted_at", u0."updated_at", b1."brainstorming_id"::uuid FROM "users" AS u0 INNER JOIN "brainstorming_moderating_users" AS b1 ON u0."id" = b1."user_id" WHERE (b1."brainstorming_id" = ANY($1)) ORDER BY b1."brainstorming_id"::uuid [["83e5c67e-800e-40ca-86be-8fd02a15289e"]]
[debug] QUERY OK source="idea_labels" db=0.6ms idle=130.9ms
SELECT i0."id", i0."name", i0."color", i0."position_order", i0."brainstorming_id", i0."inserted_at", i0."updated_at", i0."brainstorming_id" FROM "idea_labels" AS i0 WHERE (i0."brainstorming_id" = $1) ORDER BY i0."brainstorming_id", i0."position_order" ["83e5c67e-800e-40ca-86be-8fd02a15289e"]
[debug] QUERY OK source="likes" db=0.3ms idle=131.7ms
SELECT l0."id", l0."idea_id", l0."user_id", l0."inserted_at", l0."updated_at", l0."idea_id" FROM "likes" AS l0 WHERE (l0."idea_id" = ANY($1)) ORDER BY l0."idea_id" [["65c32039-8ae3-4486-b1b0-b90bcf8b4d0f", "d129ae49-fd23-462d-b16c-75d8e5e230e0", "d6200337-8f10-4c15-90ce-b990c7a2335c", "73cff1b7-570c-477d-8a94-1063ba529c78", "d8ca932e-c069-4d42-91a7-719c146c47a5", "7a1e6312-e0e0-45ad-ade7-c5d8298fd28d", "fb7fff0b-a0e6-45f0-bfed-99bb58eb9d03", "967b1d37-fce1-4071-82c2-332e463a431c", "e5f01ac1-6763-40e5-b5e4-c52ed0f3749b", "408c9f14-33ba-4a7b-bf7a-a2ddacfb7ab9", "3028f9a1-1f4a-457e-b548-026500979d4f", "c2d13754-b5b9-467d-bbb4-1f26b9dd6f86", "ad3f93fc-54bd-4e2a-8e2d-f818375cc353", "5edcf1a3-9d73-437f-8b86-b60875757b01", "6af93d2a-879d-4ac4-9078-a8659f84b38f", "ced4588c-b8ee-4c05-b910-134365649301"]]
[debug] QUERY OK source="idea_labels" db=0.4ms idle=131.6ms
SELECT i0."id", i0."name", i0."color", i0."position_order", i0."brainstorming_id", i0."inserted_at", i0."updated_at", i1."idea_id"::uuid FROM "idea_labels" AS i0 INNER JOIN "idea_idea_labels" AS i1 ON i0."id" = i1."idea_label_id" WHERE (i1."idea_id" = ANY($1)) ORDER BY i1."idea_id"::uuid [["65c32039-8ae3-4486-b1b0-b90bcf8b4d0f", "d129ae49-fd23-462d-b16c-75d8e5e230e0", "d6200337-8f10-4c15-90ce-b990c7a2335c", "73cff1b7-570c-477d-8a94-1063ba529c78", "d8ca932e-c069-4d42-91a7-719c146c47a5", "7a1e6312-e0e0-45ad-ade7-c5d8298fd28d", "fb7fff0b-a0e6-45f0-bfed-99bb58eb9d03", "967b1d37-fce1-4071-82c2-332e463a431c", "e5f01ac1-6763-40e5-b5e4-c52ed0f3749b", "408c9f14-33ba-4a7b-bf7a-a2ddacfb7ab9", "3028f9a1-1f4a-457e-b548-026500979d4f", "c2d13754-b5b9-467d-bbb4-1f26b9dd6f86", "ad3f93fc-54bd-4e2a-8e2d-f818375cc353", "5edcf1a3-9d73-437f-8b86-b60875757b01", "6af93d2a-879d-4ac4-9078-a8659f84b38f", "ced4588c-b8ee-4c05-b910-134365649301"]]
[debug] QUERY OK source="links" db=0.5ms idle=131.5ms
SELECT l0."id", l0."url", l0."title", l0."description", l0."img_preview_url", l0."idea_id", l0."inserted_at", l0."updated_at", l0."idea_id" FROM "links" AS l0 WHERE (l0."idea_id" = ANY($1)) [["65c32039-8ae3-4486-b1b0-b90bcf8b4d0f", "d129ae49-fd23-462d-b16c-75d8e5e230e0", "d6200337-8f10-4c15-90ce-b990c7a2335c", "73cff1b7-570c-477d-8a94-1063ba529c78", "d8ca932e-c069-4d42-91a7-719c146c47a5", "7a1e6312-e0e0-45ad-ade7-c5d8298fd28d", "fb7fff0b-a0e6-45f0-bfed-99bb58eb9d03", "967b1d37-fce1-4071-82c2-332e463a431c", "e5f01ac1-6763-40e5-b5e4-c52ed0f3749b", "408c9f14-33ba-4a7b-bf7a-a2ddacfb7ab9", "3028f9a1-1f4a-457e-b548-026500979d4f", "c2d13754-b5b9-467d-bbb4-1f26b9dd6f86", "ad3f93fc-54bd-4e2a-8e2d-f818375cc353", "5edcf1a3-9d73-437f-8b86-b60875757b01", "6af93d2a-879d-4ac4-9078-a8659f84b38f", "ced4588c-b8ee-4c05-b910-134365649301"]]
[debug] QUERY OK source="users" db=0.3ms idle=129.5ms
SELECT u0."id", u0."username", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) ["cd21937f-d428-4deb-96e5-bf7e7559817b"]
[debug] QUERY OK source="users" db=0.2ms idle=129.5ms
SELECT u0."id", u0."username", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) ["cd21937f-d428-4deb-96e5-bf7e7559817b"]
[debug] QUERY OK source="brainstormings" db=0.4ms idle=3.7ms
SELECT b0."id", b0."name", b0."option_show_link_to_settings", b0."option_allow_manual_ordering", b0."admin_url_id", b0."last_accessed_at", b0."creating_user_id", b0."inserted_at", b0."updated_at", b1."user_id"::uuid FROM "brainstormings" AS b0 INNER JOIN "brainstorming_users" AS b1 ON b0."id" = b1."brainstorming_id" WHERE (b1."user_id" = ANY($1)) ORDER BY b1."user_id"::uuid [["cd21937f-d428-4deb-96e5-bf7e7559817b"]]
[debug] QUERY OK source="inspirations" db=0.1ms idle=3.7ms
SELECT i0."id", i0."title", i0."type", i0."language", i0."inserted_at", i0."updated_at" FROM "inspirations" AS i0 ORDER BY RANDOM() LIMIT 1 []
[debug] Replied in 5ms
[debug] HANDLE PARAMS in MindwendelWeb.BrainstormingLive.Show
  Parameters: %{"id" => "83e5c67e-800e-40ca-86be-8fd02a15289e"}
[debug] QUERY OK source="ideas" db=0.3ms idle=4.3ms
SELECT i0."id", i0."body", i0."position_order", i0."username", i0."label", i0."user_id", i0."brainstorming_id", i0."label_id", i0."inserted_at", i0."updated_at" FROM "ideas" AS i0 LEFT OUTER JOIN (SELECT sl0."idea_id" AS "idea_id", count(1) AS "like_count" FROM "likes" AS sl0 GROUP BY sl0."idea_id") AS s1 ON s1."idea_id" = i0."id" WHERE (i0."brainstorming_id" = $1) ORDER BY i0."position_order" ASC NULLS LAST, i0."updated_at" DESC ["83e5c67e-800e-40ca-86be-8fd02a15289e"]
[debug] QUERY OK source="likes" db=0.2ms idle=5.0ms
SELECT l0."id", l0."idea_id", l0."user_id", l0."inserted_at", l0."updated_at", l0."idea_id" FROM "likes" AS l0 WHERE (l0."idea_id" = ANY($1)) ORDER BY l0."idea_id" [["5edcf1a3-9d73-437f-8b86-b60875757b01", "6af93d2a-879d-4ac4-9078-a8659f84b38f", "ced4588c-b8ee-4c05-b910-134365649301", "ad3f93fc-54bd-4e2a-8e2d-f818375cc353", "c2d13754-b5b9-467d-bbb4-1f26b9dd6f86", "3028f9a1-1f4a-457e-b548-026500979d4f", "408c9f14-33ba-4a7b-bf7a-a2ddacfb7ab9", "e5f01ac1-6763-40e5-b5e4-c52ed0f3749b", "967b1d37-fce1-4071-82c2-332e463a431c", "d8ca932e-c069-4d42-91a7-719c146c47a5", "fb7fff0b-a0e6-45f0-bfed-99bb58eb9d03", "73cff1b7-570c-477d-8a94-1063ba529c78", "d6200337-8f10-4c15-90ce-b990c7a2335c", "d129ae49-fd23-462d-b16c-75d8e5e230e0", "7a1e6312-e0e0-45ad-ade7-c5d8298fd28d", "65c32039-8ae3-4486-b1b0-b90bcf8b4d0f"]]
[debug] QUERY OK source="links" db=0.2ms idle=4.3ms
SELECT l0."id", l0."url", l0."title", l0."description", l0."img_preview_url", l0."idea_id", l0."inserted_at", l0."updated_at", l0."idea_id" FROM "links" AS l0 WHERE (l0."idea_id" = ANY($1)) [["5edcf1a3-9d73-437f-8b86-b60875757b01", "6af93d2a-879d-4ac4-9078-a8659f84b38f", "ced4588c-b8ee-4c05-b910-134365649301", "ad3f93fc-54bd-4e2a-8e2d-f818375cc353", "c2d13754-b5b9-467d-bbb4-1f26b9dd6f86", "3028f9a1-1f4a-457e-b548-026500979d4f", "408c9f14-33ba-4a7b-bf7a-a2ddacfb7ab9", "e5f01ac1-6763-40e5-b5e4-c52ed0f3749b", "967b1d37-fce1-4071-82c2-332e463a431c", "d8ca932e-c069-4d42-91a7-719c146c47a5", "fb7fff0b-a0e6-45f0-bfed-99bb58eb9d03", "73cff1b7-570c-477d-8a94-1063ba529c78", "d6200337-8f10-4c15-90ce-b990c7a2335c", "d129ae49-fd23-462d-b16c-75d8e5e230e0", "7a1e6312-e0e0-45ad-ade7-c5d8298fd28d", "65c32039-8ae3-4486-b1b0-b90bcf8b4d0f"]]
[debug] QUERY OK source="idea_labels" db=0.3ms idle=4.9ms
SELECT i0."id", i0."name", i0."color", i0."position_order", i0."brainstorming_id", i0."inserted_at", i0."updated_at", i1."idea_id"::uuid FROM "idea_labels" AS i0 INNER JOIN "idea_idea_labels" AS i1 ON i0."id" = i1."idea_label_id" WHERE (i1."idea_id" = ANY($1)) ORDER BY i1."idea_id"::uuid [["5edcf1a3-9d73-437f-8b86-b60875757b01", "6af93d2a-879d-4ac4-9078-a8659f84b38f", "ced4588c-b8ee-4c05-b910-134365649301", "ad3f93fc-54bd-4e2a-8e2d-f818375cc353", "c2d13754-b5b9-467d-bbb4-1f26b9dd6f86", "3028f9a1-1f4a-457e-b548-026500979d4f", "408c9f14-33ba-4a7b-bf7a-a2ddacfb7ab9", "e5f01ac1-6763-40e5-b5e4-c52ed0f3749b", "967b1d37-fce1-4071-82c2-332e463a431c", "d8ca932e-c069-4d42-91a7-719c146c47a5", "fb7fff0b-a0e6-45f0-bfed-99bb58eb9d03", "73cff1b7-570c-477d-8a94-1063ba529c78", "d6200337-8f10-4c15-90ce-b990c7a2335c", "d129ae49-fd23-462d-b16c-75d8e5e230e0", "7a1e6312-e0e0-45ad-ade7-c5d8298fd28d", "65c32039-8ae3-4486-b1b0-b90bcf8b4d0f"]]
[debug] Replied in 2ms
[debug] QUERY OK source="likes" db=0.2ms idle=5.4ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "65c32039-8ae3-4486-b1b0-b90bcf8b4d0f"]
[debug] QUERY OK source="likes" db=0.2ms idle=5.8ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "7a1e6312-e0e0-45ad-ade7-c5d8298fd28d"]
[debug] QUERY OK source="likes" db=0.1ms idle=5.6ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "d129ae49-fd23-462d-b16c-75d8e5e230e0"]
[debug] QUERY OK source="likes" db=0.1ms idle=5.5ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "d6200337-8f10-4c15-90ce-b990c7a2335c"]
[debug] QUERY OK source="likes" db=0.1ms idle=5.3ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "73cff1b7-570c-477d-8a94-1063ba529c78"]
[debug] QUERY OK source="likes" db=0.1ms idle=5.3ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "fb7fff0b-a0e6-45f0-bfed-99bb58eb9d03"]
[debug] QUERY OK source="likes" db=0.1ms idle=4.9ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "d8ca932e-c069-4d42-91a7-719c146c47a5"]
[debug] QUERY OK source="likes" db=0.2ms idle=4.7ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "967b1d37-fce1-4071-82c2-332e463a431c"]
[debug] QUERY OK source="likes" db=0.2ms idle=5.1ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "e5f01ac1-6763-40e5-b5e4-c52ed0f3749b"]
[debug] QUERY OK source="likes" db=0.1ms idle=5.5ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "408c9f14-33ba-4a7b-bf7a-a2ddacfb7ab9"]
[debug] QUERY OK source="likes" db=0.1ms idle=4.6ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "3028f9a1-1f4a-457e-b548-026500979d4f"]
[debug] QUERY OK source="likes" db=0.1ms idle=4.4ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "c2d13754-b5b9-467d-bbb4-1f26b9dd6f86"]
[debug] QUERY OK source="likes" db=0.1ms idle=4.4ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "ad3f93fc-54bd-4e2a-8e2d-f818375cc353"]
[debug] QUERY OK source="likes" db=0.1ms idle=4.4ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "ced4588c-b8ee-4c05-b910-134365649301"]
[debug] QUERY OK source="likes" db=0.1ms idle=4.4ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "6af93d2a-879d-4ac4-9078-a8659f84b38f"]
[debug] QUERY OK source="likes" db=0.1ms idle=4.3ms
SELECT TRUE FROM "likes" AS l0 WHERE ((l0."user_id" = $1) AND (l0."idea_id" = $2)) LIMIT 1 ["cd21937f-d428-4deb-96e5-bf7e7559817b", "5edcf1a3-9d73-437f-8b86-b60875757b01"]

software design

Code Style

Strict mode credo output ``` # mix credo --strict Checking 82 source files (this might take a while) ... Software Design ┃ ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ lib/mindwendel_web/live/brainstorming_live/show.ex:13:23 #(MindwendelWeb.BrainstormingLive.Show.mount) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ lib/mindwendel_web/plugs/set_session_device_id.ex:11:9 #(Mindwendel.Plugs.SetSessionUserId.call) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ lib/mindwendel_web/plugs/set_session_device_id.ex:9:10 #(Mindwendel.Plugs.SetSessionUserId.call) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ lib/mindwendel_web/controllers/static_page_controller.ex:11:10 #(MindwendelWeb.StaticPageController.home) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ lib/mindwendel_web/controllers/brainstorming_controller.ex:8:7 #(MindwendelWeb.BrainstormingController.create) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ lib/mindwendel_web/controllers/admin/brainstorming_controller.ex:37:23 #(MindwendelWeb.Admin.BrainstormingController.fetch_user) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ test/support/data_case.ex:34:7 #(Mindwendel.DataCase) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ test/support/data_case.ex:31:11 #(Mindwendel.DataCase) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ test/support/conn_case.ex:38:7 #(MindwendelWeb.ConnCase) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ test/support/conn_case.ex:35:11 #(MindwendelWeb.ConnCase) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ test/support/channel_case.ex:35:7 #(MindwendelWeb.ChannelCase) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ test/support/channel_case.ex:32:11 #(MindwendelWeb.ChannelCase) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ test/mindwendel_web/controllers/static_page_controller_test.exs:53:11 #(MindwendelWeb.StaticPageControllerTest) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ test/mindwendel_web/controllers/static_page_controller_test.exs:38:11 #(MindwendelWeb.StaticPageControllerTest) ┃ [D] ↘ Nested modules could be aliased at the top of the invoking module. ┃ test/mindwendel_web/controllers/static_page_controller_test.exs:15:14 #(MindwendelWeb.StaticPageControllerTest) Code Readability ┃ ┃ [R] ↘ Do not use parentheses when defining a function which has no arguments. ┃ lib/mindwendel_web/plugs/set_response_header_content_security_policy.ex:78:7 #(Mindwendel.Plugs.SetResponseHeaderContentSecurityPolicy.get_websocket_scheme) ┃ [R] ↘ Line is too long (max is 120, was 123). ┃ lib/mindwendel_web/live/brainstorming_live/show.ex:86:121 #(MindwendelWeb.BrainstormingLive.Show.handle_info) ┃ [R] ↘ Line is too long (max is 120, was 135). ┃ lib/mindwendel_web/live/brainstorming_live/show.ex:63:121 #(MindwendelWeb.BrainstormingLive.Show.handle_info) ┃ [R] ↘ Line is too long (max is 120, was 128). ┃ lib/mindwendel/accounts.ex:152:121 #(Mindwendel.Accounts.user_has_active_brainstormings) ┃ [R] ↘ Line is too long (max is 120, was 204). ┃ lib/mindwendel/accounts.ex:133:121 #(Mindwendel.Accounts.delete_inactive_users) ┃ [R] ↘ The alias `Mindwendel.Repo` is not alphabetically ordered among its group. ┃ test/support/factory.ex:2:9 #(Mindwendel.Factory) ┃ [R] ↘ The alias `Mindwendel.Factory` is not alphabetically ordered among its group. ┃ test/mindwendel_web/live/brainstorming_live_test.exs:6:9 #(MindwendelWeb.BrainstormingLiveTest) ┃ [R] ↘ Do not use parentheses when defining a function which has no arguments. ┃ lib/mindwendel_web/plugs/set_response_header_content_security_policy.ex:71:7 #(Mindwendel.Plugs.SetResponseHeaderContentSecurityPolicy.get_port) ┃ [R] ↘ Do not use parentheses when defining a function which has no arguments. ┃ lib/mindwendel_web/plugs/set_response_header_content_security_policy.ex:64:7 #(Mindwendel.Plugs.SetResponseHeaderContentSecurityPolicy.get_scheme) ┃ [R] ↘ Do not use parentheses when defining a function which has no arguments. ┃ lib/mindwendel_web/plugs/set_response_header_content_security_policy.ex:58:7 #(Mindwendel.Plugs.SetResponseHeaderContentSecurityPolicy.get_style_src) ┃ [R] ↘ Do not use parentheses when defining a function which has no arguments. ┃ lib/mindwendel_web/plugs/set_response_header_content_security_policy.ex:52:7 #(Mindwendel.Plugs.SetResponseHeaderContentSecurityPolicy.get_script_src) ┃ [R] ↘ Do not use parentheses when defining a function which has no arguments. ┃ lib/mindwendel_web/plugs/set_response_header_content_security_policy.ex:45:7 #(Mindwendel.Plugs.SetResponseHeaderContentSecurityPolicy.get_host) ┃ [R] ↘ Line is too long (max is 120, was 149). ┃ lib/mindwendel_web/plugs/set_response_header_content_security_policy.ex:28:121 #(Mindwendel.Plugs.SetResponseHeaderContentSecurityPolicy.content_security_policy_directives) ┃ [R] ↘ Do not use parentheses when defining a function which has no arguments. ┃ lib/mindwendel_web/plugs/set_response_header_content_security_policy.ex:18:7 #(Mindwendel.Plugs.SetResponseHeaderContentSecurityPolicy.content_security_policy_directives) ┃ [R] ↘ The alias `Mindwendel.Ideas` is not alphabetically ordered among its group. ┃ lib/mindwendel_web/live/idea_live/index_component.ex:5:9 #(MindwendelWeb.IdeaLive.IndexComponent) ┃ [R] ↘ The alias `Mindwendel.Ideas` is not alphabetically ordered among its group. ┃ lib/mindwendel_web/live/brainstorming_live/show.ex:6:9 #(MindwendelWeb.BrainstormingLive.Show) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.IdeaLabelFactory` is not alphabetically ordered among its group. ┃ lib/mindwendel_web/live/admin/brainstorming_live/edit.ex:4:9 #(MindwendelWeb.Admin.BrainstormingLive.Edit) ┃ [R] ↘ Line is too long (max is 120, was 122). ┃ lib/mindwendel/likes.ex:59:121 #(Mindwendel.Likes.delete_like) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.Like` is not alphabetically ordered among its group. ┃ lib/mindwendel/ideas.ex:10:9 #(Mindwendel.Ideas) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.IdeaLabel` is not alphabetically ordered among its group. ┃ lib/mindwendel/brainstormings/idea.ex:6:9 #(Mindwendel.Brainstormings.Idea) ┃ [R] ↘ Line is too long (max is 120, was 125). ┃ lib/mindwendel/brainstormings/brainstorming.ex:18:121 #(Mindwendel.Brainstormings.Brainstorming) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.IdeaLabel` is not alphabetically ordered among its group. ┃ lib/mindwendel/brainstormings/brainstorming.ex:7:9 #(Mindwendel.Brainstormings.Brainstorming) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.Idea` is not alphabetically ordered among its group. ┃ lib/mindwendel/brainstormings.ex:9:9 #(Mindwendel.Brainstormings) ┃ [R] ↘ The alias `Mindwendel.Repo` is not alphabetically ordered among its group. ┃ lib/mindwendel/accounts.ex:3:9 #(Mindwendel.Accounts) ┃ [R] ↘ The alias `Mindwendel.Repo` is not alphabetically ordered among its group. ┃ test/repo/data_migrations/migrate_idea_labels_to_idea_idea_labels_test.exs:7:9 #(Mindwendel.Repo.DataMigrations.MigrateIdeaLabelsToIdeaIdeaLabelsTest) ┃ [R] ↘ The alias `Mindwendel.Repo` is not alphabetically ordered among its group. ┃ test/repo/data_migrations/migrate_idea_labels_test.exs:6:9 #(Mindwendel.Repo.DataMigrations.MigrateIdealLabelsTest) ┃ [R] ↘ The alias `Mindwendel.Brainstormings` is not alphabetically ordered among its group. ┃ test/mindwendel_web/live/brainstorming_live/show_idea_edit_test.exs:4:9 #(MindwendelWeb.BrainstormingLive.ShowIdeaEditTest) ┃ [R] ↘ The alias `Mindwendel.Repo` is not alphabetically ordered among its group. ┃ test/mindwendel_web/controllers/brainstorming_controller_test.exs:6:9 #(MindwendelWeb.BrainstormingControllerTest) ┃ [R] ↘ The alias `Mindwendel.Factory` is not alphabetically ordered among its group. ┃ test/mindwendel_web/channels/brainstorming_channel_test.exs:4:9 #(MindwendelWeb.BrainstormingChannelTest) ┃ [R] ↘ The alias `Mindwendel.Ideas` is not alphabetically ordered among its group. ┃ test/mindwendel/ideas_test.exs:5:9 #(Mindwendel.IdeasTest) ┃ [R] ↘ The alias `Mindwendel.Ideas` is not alphabetically ordered among its group. ┃ test/mindwendel/idea_test.exs:5:9 #(Mindwendel.IdeaTest) ┃ [R] ↘ The alias `Mindwendel.Ideas` is not alphabetically ordered among its group. ┃ test/mindwendel/idea_labels_test.exs:5:9 #(Mindwendel.IdeaLabelsTest) ┃ [R] ↘ The alias `Mindwendel.Factory` is not alphabetically ordered among its group. ┃ test/mindwendel/csv_formatter_test.exs:3:9 #(MindwendelServices.CSVFormatter) ┃ [R] ↘ The alias `Mindwendel.Factory` is not alphabetically ordered among its group. ┃ test/mindwendel/brainstormings_users_test.exs:3:9 #(Mindwendel.AccountsMergeBrainstormingUserTest) ┃ [R] ↘ The alias `Mindwendel.IdeaLabels` is not alphabetically ordered among its group. ┃ test/mindwendel/brainstormings_test.exs:8:9 #(Mindwendel.BrainstormingsTest) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.IdeaLabel` is not alphabetically ordered among its group. ┃ test/mindwendel/brainstormings/create_brainstorming_test.exs:9:9 #(Mindwendel.Brainstormings.CreateBrainstormingTest) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.BrainstormingModeratingUser` is not alphabetically ordered among its group. ┃ test/mindwendel/brainstormings/create_brainstorming_test.exs:3:9 #(Mindwendel.Brainstormings.CreateBrainstormingTest) ┃ [R] ↘ Line is too long (max is 120, was 138). ┃ test/mindwendel/accounts_test.exs:127:121 #(Mindwendel.AccountsTest) ┃ [R] ↘ Line is too long (max is 120, was 138). ┃ test/mindwendel/accounts_test.exs:109:121 #(Mindwendel.AccountsTest) ┃ [R] ↘ Line is too long (max is 120, was 138). ┃ test/mindwendel/accounts_test.exs:91:121 #(Mindwendel.AccountsTest) ┃ [R] ↘ The alias `Mindwendel.Factory` is not alphabetically ordered among its group. ┃ test/mindwendel/accounts_test.exs:3:9 #(Mindwendel.AccountsTest) ┃ [R] ↘ Do not use parentheses when defining a function which has no arguments. ┃ lib/mindwendel_web/views/static_page.ex:9:7 #(MindwendelWeb.StaticPageView.brainstormings_available_until) ┃ [R] ↘ Line is too long (max is 120, was 124). ┃ lib/mindwendel_web/router.ex:25:121 #(MindwendelWeb.Router) ┃ [R] ↘ Line is too long (max is 120, was 122). ┃ lib/mindwendel_web/router.ex:23:121 #(MindwendelWeb.Router) ┃ [R] ↘ Line is too long (max is 120, was 127). ┃ lib/mindwendel_web/router.ex:21:121 #(MindwendelWeb.Router) ┃ [R] ↘ Line is too long (max is 120, was 162). ┃ lib/mindwendel_web/router.ex:20:121 #(MindwendelWeb.Router) ┃ [R] ↘ The alias `Mindwendel.Brainstormings` is not alphabetically ordered among its group. ┃ lib/mindwendel_web/controllers/brainstorming_controller.ex:3:9 #(MindwendelWeb.BrainstormingController) ┃ [R] ↘ The alias `Mindwendel.Ideas` is not alphabetically ordered among its group. ┃ lib/mindwendel_web/controllers/admin/brainstorming_controller.ex:4:9 #(MindwendelWeb.Admin.BrainstormingController) ┃ [R] ↘ The alias `Mindwendel.Brainstormings` is not alphabetically ordered among its group. ┃ lib/mindwendel/worker/remove_brainstormings_and_users_after_period_worker.ex:3:9 #(Mindwendel.Worker.RemoveBrainstormingsAndUsersAfterPeriodWorker) ┃ [R] ↘ The alias `Mindwendel.Ideas` is not alphabetically ordered among its group. ┃ lib/mindwendel/likes.ex:10:9 #(Mindwendel.Likes) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.Idea` is not alphabetically ordered among its group. ┃ lib/mindwendel/idea_labels.ex:9:9 #(Mindwendel.IdeaLabels) ┃ [R] ↘ The alias `Mindwendel.Repo` is not alphabetically ordered among its group. ┃ lib/mindwendel/help.ex:7:9 #(Mindwendel.Help) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.Idea` is not alphabetically ordered among its group. ┃ lib/mindwendel/brainstormings/like.ex:5:9 #(Mindwendel.Brainstormings.Like) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.Brainstorming` is not alphabetically ordered among its group. ┃ lib/mindwendel/brainstormings/brainstorming_moderating_user.ex:3:9 #(Mindwendel.Brainstormings.BrainstormingModeratingUser) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.Idea` is not alphabetically ordered among its group. ┃ lib/mindwendel/accounts/user.ex:7:9 #(Mindwendel.Accounts.User) ┃ [R] ↘ The alias `Mindwendel.Brainstormings.Brainstorming` is not alphabetically ordered among its group. ┃ lib/mindwendel/accounts/brainstorming_user.ex:3:9 #(Mindwendel.Accounts.BrainstormingUser) ```

Feature Ideas

Dependencies

Switching libraries

Switching libraries usually has little benefit but I still wanted to mention some

Tests

One of my todos to look at. First look we don't seem to have a full integration test?

CI

JannikStreek commented 1 month ago

Thanks, great compilation of our screw ups haha 😄

Some answers to your questions / feedback

As it's a lot of feedback (and good one), maybe you can add a small time/complexity assessment, in regards to which are the low hanging fruits. E.g. refactoring the views I would propose to do after my open lane PR. But solving a couple of N+1 would be a good and small improvement. What do you think?

Might be nice to start the migration soon (unless there are deadlines), as otherwise it'll always become more code to change. I think it can be done step by step. Maybe after https://github.com/b310-digital/mindwendel/pull/344 ?

yes, same thought. But we should not defer it much later.

JannikStreek commented 1 month ago

Submitting ideas via a key combination like + would be awesome

So you mean after hitting hotkey "I" entering some data, you want "+" to submit the idea? or maybe control + enter?

JannikStreek commented 1 month ago

Btw: I just used the live generator for the lanes which also generated the core_components which you mentioned, see https://github.com/b310-digital/mindwendel/pull/344/commits/47c616f3a851859bc2c9c0c5a4f80a358770cf42

PragTob commented 1 month ago

@JannikStreek lmao... I wrote <Ctrl> + <Enter> but without the code fences and of course they are interpreted as HTML tags then and not shown... fixing now but yes I meant ctrl + enter

PragTob commented 1 month ago

@JannikStreek as for the time/complexity/effort estimations tough to do when I don't know the app as well yet I can give it a shot but it'll be off even more than normal :)