Re-enable Credo CyclomaticComplexity check

This commit is contained in:
Claudio Ortolina
2026-03-06 10:08:25 +00:00
parent d3ae3a7381
commit a23f772c04
4 changed files with 3 additions and 1 deletions
-1
View File
@@ -7,7 +7,6 @@
{Credo.Check.Refactor.Nesting, max_nesting: 3} {Credo.Check.Refactor.Nesting, max_nesting: 3}
], ],
disabled: [ disabled: [
{Credo.Check.Refactor.CyclomaticComplexity, []},
{Credo.Check.Readability.ModuleDoc, []} {Credo.Check.Readability.ModuleDoc, []}
] ]
} }
@@ -186,6 +186,7 @@ defmodule MusicLibraryWeb.Components.Pagination do
@visible_left_pages 3 @visible_left_pages 3
@visible_right_pages 3 @visible_right_pages 3
@middle "..." @middle "..."
# credo:disable-for-next-line Credo.Check.Refactor.CyclomaticComplexity
defp generate_page_links(pagination_params) do defp generate_page_links(pagination_params) do
%{ %{
total_entries: total_entries, total_entries: total_entries,
@@ -254,6 +254,7 @@ defmodule MusicLibraryWeb.StatsComponents do
# The Tailwind build step requires all needed classes to be explicitly referenced # The Tailwind build step requires all needed classes to be explicitly referenced
# in the source code, and not dynamically generated. This implies that one cannot # in the source code, and not dynamically generated. This implies that one cannot
# (for example) interpolate a number in a class name. # (for example) interpolate a number in a class name.
# credo:disable-for-next-line Credo.Check.Refactor.CyclomaticComplexity
defp stats_class(collection) do defp stats_class(collection) do
case Enum.count(collection) do case Enum.count(collection) do
1 -> "grid-cols-1" 1 -> "grid-cols-1"
@@ -10,6 +10,7 @@ defmodule MusicLibrary.ScrobbledTracksFixtures do
@doc """ @doc """
Generate a scrobbled track. Generate a scrobbled track.
""" """
# credo:disable-for-next-line Credo.Check.Refactor.CyclomaticComplexity
def track_fixture(attrs \\ %{}) do def track_fixture(attrs \\ %{}) do
scrobbled_at_uts = scrobbled_at_uts =
attrs[:scrobbled_at_uts] || System.system_time(:second) - Enum.random(0..86_400) attrs[:scrobbled_at_uts] || System.system_time(:second) - Enum.random(0..86_400)