tulir/gomuks

View on GitHub
matrix/rooms/room.go

Summary

Maintainability
B
5 hrs
Test Coverage

File room.go has 571 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// gomuks - A terminal Matrix client written in Go.
// Copyright (C) 2020 Tulir Asokan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
Severity: Minor
Found in matrix/rooms/room.go - About 3 hrs to fix

    Avoid deeply nested control flow statements.
    Open

            if room.secondMemberCache != nil {
                members += ", " + room.secondMemberCache.Displayname
                count--
            }
    Severity: Major
    Found in matrix/rooms/room.go - About 45 mins to fix

      Method Room.Tags has 5 return statements (exceeds 4 allowed).
      Open

      func (room *Room) Tags() []RoomTag {
          room.lock.RLock()
          defer room.lock.RUnlock()
          if len(room.RawTags) == 0 {
              if room.IsDirect {
      Severity: Major
      Found in matrix/rooms/room.go - About 35 mins to fix

        should omit 2nd value from range; this loop is equivalent to for userID := range ...
        Open

            for userID, _ := range members {
        Severity: Minor
        Found in matrix/rooms/room.go by golint

        There are no issues that match your filters.

        Category
        Status