Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

absorb database into common #40

Open
wants to merge 105 commits into
base: master
Choose a base branch
from
Open

absorb database into common #40

wants to merge 105 commits into from

Conversation

iggi42
Copy link
Contributor

@iggi42 iggi42 commented Sep 27, 2019

was to lazy to make a new branch, just gonna continue working on it. till the tag editor stands roughly.

}

@default %{
desc: "TODO, add a description"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO found

use Common.DataCase

alias Common.TestUtils
alias Common.ModDB

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alias Common.ModDB is not alphabetically ordered among its group.

describe "Mod" do

defp get_mod!(id) do
ModDB.get_mod!(id) |> Mod.preload()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pipe chain should start with a raw value.

@spec create_modlist(change :: Modlist.change)
:: {:ok, Modlist.t} | {:error, Changeset.t(Modlist.t)}
def create_modlist(change \\ %{}) do
Modlist.new(change) |> Repo.insert()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pipe chain should start with a raw value.

:ok -> value
f when is_function(f, 1) -> f.(value)
end
unless Map.has_key?(acc, clean_attr) do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function body is nested too deep (max depth is 2, was 3).

Returns the list of _all_ modlists.
"""
@spec list_modlists() :: [Modlist.t]
def list_modlists(), do: Repo.all(Modlist)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use parentheses when defining a function which has no arguments.

published: false
}


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no more than 1 consecutive blank lines.

def changeset(mod, changes \\ %{}) do
fields = [:name, :desc, :published, :image] |> MapSet.new
embeds = [:oldrim, :sse] |> MapSet.new
affected = Map.keys(changes) |> MapSet.new

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pipe chain should start with a raw value.


cs = Changeset.cast(mod, changes, MapSet.to_list(affected_fields))

cs = affected_embeds

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "cs" was declared more than once.

)
end

# TODO

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO found

)
end

def tag_change() do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use parentheses when defining a function which has no arguments.

published: false
}

@type tag_change :: [ {:add, ModTag.t()} | {:delete, ModTag.t()} ]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no whitespace around parentheses/brackets most of the time, but here there is.

def changeset(mod, changes \\ %{}) do
fields = [:name, :desc, :published, :image] |> MapSet.new()
embeds = [:oldrim, :sse] |> MapSet.new()
affected = Map.keys(changes) |> MapSet.new()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pipe chain should start with a raw value.

cs = Changeset.cast(mod, changes, MapSet.to_list(affected_fields))

# set the embeded fields
cs =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "cs" was declared more than once.

{:ok, Modlist.t()} | {:error, Changeset.t(Modlist.t())}
def add_mod_to_list(list, mod) do
_cs = Modlist.changeset(list)
# TODO

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO found

"""
@spec list_modlists() :: [Modlist.t()]
def list_modlists(), do: Repo.all(Modlist)
# TODO needs paging

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO found

"""
@spec list_mods() :: [Mod.t()]
def list_mods, do: Repo.all(Mod)
# TODO page this stuff, Repo.stream/2 seems useful

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO found

end

test "Mod.changeset/2" do
# TODO

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO found

"""
@spec list_modlists() :: [Modlist.t()]
def list_modlists(), do: Repo.all(Modlist)
# TODO needs paging

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a TODO tag in a comment: # TODO needs paging

"""
@spec list_mods() :: [Mod.t()]
def list_mods, do: Repo.all(Mod)
# TODO page this stuff, Repo.stream/2 seems useful

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a TODO tag in a comment: # TODO page this stuff, Repo.stream/2 seems useful

@sourcelevel-bot
Copy link

SourceLevel has finished reviewing this Pull Request and has found:

  • 114 possible new issues (including those that may have been commented here).
  • 1 fixed issue! 🎉

See more details about this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants