Skip to content

Commit

Permalink
credo cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
macobo committed Jan 16, 2025
1 parent b174537 commit d00c02d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/plausible/stats/filters/filters.ex
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ defmodule Plausible.Stats.Filters do
{depth + 1, is_behavioral_filter or operator in [:has_done, :has_not_done]}
end
)
|> Enum.filter(fn {_filter, {depth, _}} -> depth >= min_depth and depth <= max_depth end)
|> Enum.filter(fn {_filter, {_, is_behavioral_filter}} ->
case behavioral_filter_option do
:ignore -> not is_behavioral_filter
:only -> is_behavioral_filter
_ -> true
end
|> Enum.filter(fn {_filter, {depth, is_behavioral_filter}} ->
matches_behavioral_filter_option? =
case behavioral_filter_option do
:ignore -> not is_behavioral_filter
:only -> is_behavioral_filter
_ -> true
end

depth >= min_depth and depth <= max_depth and matches_behavioral_filter_option?
end)
|> Enum.map(fn {[_operator, dimension | _rest], _depth} -> dimension end)
end
Expand Down

0 comments on commit d00c02d

Please sign in to comment.