Closed hloeung closed 3 years ago
FWIW, these are the ones skipped over:
pkg/matterclient/matterclient.go:111: Function 'Login' is too long (68 > 60) (funlen)
func (m *Client) Login() error {
pkg/matterclient/matterclient.go:365:3: ifElseChain: rewrite if-else to switch statement (gocritic)
if m.Credentials.Token != "" {
^
bridge/slack/slack.go:504: Function 'handleSlack' has too many statements (44 > 40) (funlen)
func (s *Slack) handleSlack() {
main.go:27: Function 'main' has too many statements (54 > 40) (funlen)
func main() {
mm-go-irckit/channel.go:332: Function 'Join' is too long (62 > 60) (funlen)
func (ch *channel) Join(u *User) error {
mm-go-irckit/server.go:402: Function 'handshake' is too long (74 > 60) (funlen)
func (s *server) handshake(u *User) error {
mm-go-irckit/server_commands.go:336: Function 'CmdPrivMsg' has too many statements (62 > 40) (funlen)
func CmdPrivMsg(s Server, u *User, msg *irc.Message) error {
mm-go-irckit/server_commands.go:445: Function 'parseModifyMsg' has too many statements (44 > 40) (funlen)
func parseModifyMsg(u *User, msg *irc.Message, channelID string) bool {
mm-go-irckit/service.go:36: Function 'login' has too many statements (93 > 40) (funlen)
func login(u *User, toUser *User, args []string, service string) {
mm-go-irckit/service.go:400: Function 'parseCommandString' is too long (61 > 60) (funlen)
func parseCommandString(line string) ([]string, error) {
mm-go-irckit/userbridge.go:548: Function 'addUserToChannelWorker' has too many statements (59 > 40) (funlen)
func (u *User) addUserToChannelWorker(channels <-chan *bridge.ChannelInfo, throttle *time.Ticker) {
mm-go-irckit/server.go:460:15: string `slack` has 10 occurrences, make it a constant (goconst)
service = "slack"
^
mm-go-irckit/server_commands.go:710:30: string `online` has 3 occurrences, make it a constant (goconst)
if statuses[other.User] != "online" {
^
mm-go-irckit/channel.go:359:16: string `&users` has 3 occurrences, make it a constant (goconst)
if ch.name == "&users" && u.Ghost {
^
mm-go-irckit/user.go:133:21: string `PRIVMSG` has 3 occurrences, make it a constant (goconst)
if msg.Command == "PRIVMSG" && (msg.Prefix.Name == "slack" || msg.Prefix.Name == "mattermost") && msg.Prefix.Host == "service" && strings.Contains(msg.Trailing, "token") {
^
mm-go-irckit/server.go:458:15: string `mattermost` has 7 occurrences, make it a constant (goconst)
service := "mattermost"
^
mm-go-irckit/service.go:42:2: `if service == "slack"` is deeply nested (complexity: 10) (nestif)
if service == "slack" {
^
mm-go-irckit/server_commands.go:371:2: `if exists` is deeply nested (complexity: 5) (nestif)
if ch, exists := s.HasChannel(query); exists {
^
mm-go-irckit/server_commands.go:403:2: `if exists` is deeply nested (complexity: 5) (nestif)
if toUser, exists := s.HasUser(query); exists {
^
For OCD reasons, could you rename your commits to Fix golangci-lint dupl
etc ? :)
(So I don't need to squash)
For OCD reasons, could you rename your commits to
Fix golangci-lint dupl
etc ? :) (So I don't need to squash)
Done, I think that's what you mean.
Thanks!
That's the following:
Ignoring the funlen, goconst, gocognit, gocyclo, and a bunch of other nestif ones for now.