Preparing report...

Report for github.com/impactasaurus/server

(v0.0.0-20210410192404-f2e39e4bca01)

A+    Excellent!    Found 53 issues across 98 files

Tweet

gofmt93%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo96%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • server/api/outcomeset.go
    • Line 412: warning: cyclomatic complexity 25 of function (*v1).getOSMutations() is high (> 15) (gocyclo)
    • Line 15: warning: cyclomatic complexity 17 of function (*v1).initOutcomeSetTypes() is high (> 15) (gocyclo)

golint56%

Golint is a linter for Go source code.

    • server/data/mongo/session/outcomeset.go
    • Line 48: warning: exported method S.GetOutcomeSet should have comment or be unexported (golint)
    • Line 69: warning: exported method S.GetOutcomeSets should have comment or be unexported (golint)
    • Line 85: warning: exported method S.NewOutcomeSet should have comment or be unexported (golint)
    • Line 105: warning: exported method S.ImportOutcomeSet should have comment or be unexported (golint)
    • Line 134: warning: exported method S.EditOutcomeSet should have comment or be unexported (golint)
    • Line 157: warning: exported method S.DeleteOutcomeSet should have comment or be unexported (golint)
    • server/meeting.go
    • Line 12: warning: exported type AnswerType should have comment or be unexported (golint)
    • Line 14: warning: exported const INT should have comment or be unexported (golint)
    • Line 16: warning: exported type Answer should have comment or be unexported (golint)
    • Line 23: warning: exported type Meeting should have comment or be unexported (golint)
    • Line 54: warning: exported method Answer.IsNumeric should have comment or be unexported (golint)
    • Line 58: warning: exported method Answer.ToFloat should have comment or be unexported (golint)
    • Line 75: warning: exported method Meeting.GetAnswer should have comment or be unexported (golint)
    • Line 118: warning: exported method Meeting.GetCategoryAggregates should have comment or be unexported (golint)
    • Line 151: warning: exported type Meetings should have comment or be unexported (golint)
    • Line 153: warning: exported method Meetings.KeyedByBeneficiary should have comment or be unexported (golint)
    • Line 165: warning: exported type QuestionnaireFetcher should have comment or be unexported (golint)
    • Line 169: warning: exported method Meetings.FilterDeletedQuestionnaires should have comment or be unexported (golint)
    • server/data/mongo/session/category.go
    • Line 13: warning: exported method S.GetCategory should have comment or be unexported (golint)
    • Line 27: warning: exported method S.NewCategory should have comment or be unexported (golint)
    • Line 71: warning: exported method S.DeleteCategory should have comment or be unexported (golint)
    • Line 100: warning: exported method S.EditCategory should have comment or be unexported (golint)
    • server/aggregate.go
    • Line 5: warning: exported type Aggregation should have comment or be unexported (golint)
    • Line 8: warning: exported const MEAN should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: exported function Mean should have comment or be unexported (golint)
    • Line 17: warning: exported function Sum should have comment or be unexported (golint)
    • Line 25: warning: exported function Aggregate should have comment or be unexported (golint)
    • server/user/dataloader/directory.go
    • Line 17: warning: comment on exported type BatchedDirectory should be of the form "BatchedDirectory ..." (with optional leading article) (golint)
    • Line 26: warning: exported function NewUserDirectory should have comment or be unexported (golint)
    • Line 36: warning: exported method Directory.GetUser should have comment or be unexported (golint)
    • Line 49: warning: exported method Directory.GetOrgUsers should have comment or be unexported (golint)
    • Line 60: warning: exported method Directory.UpdateUser should have comment or be unexported (golint)
    • Line 69: warning: exported method Directory.CreateUser should have comment or be unexported (golint)
    • server/user/auth0/directory.go
    • Line 18: warning: exported method Client.MaxBatch should have comment or be unexported (golint)
    • Line 68: warning: exported method Client.GetUsers should have comment or be unexported (golint)
    • Line 87: warning: exported method Client.GetOrgUsers should have comment or be unexported (golint)
    • Line 103: warning: exported method Client.CreateUser should have comment or be unexported (golint)
    • Line 232: warning: exported method Client.UpdateUser should have comment or be unexported (golint)
    • server/controller/organisation.go
    • Line 14: warning: exported type OrgDB should have comment or be unexported (golint)
    • Line 22: warning: exported type UserCreator should have comment or be unexported (golint)
    • Line 28: warning: exported type OrgController should have comment or be unexported (golint)
    • Line 33: warning: exported function NewOrgController should have comment or be unexported (golint)
    • server/outcomeset.go
    • Line 9: warning: exported type QuestionType should have comment or be unexported (golint)
    • Line 11: warning: exported const LIKERT should have comment or be unexported (golint)
    • Line 13: warning: exported type Question should have comment or be unexported (golint)
    • Line 24: warning: exported type Label should have comment or be unexported (golint)
    • Line 29: warning: exported method Question.GetName should have comment or be unexported (golint)
    • Line 36: warning: exported method Question.GetScale should have comment or be unexported (golint)
    • Line 56: warning: exported method Question.GetExtremeLabels should have comment or be unexported (golint)
    • Line 90: warning: exported method Question.Labels should have comment or be unexported (golint)
    • Line 128: warning: exported type Category should have comment or be unexported (golint)
    • Line 135: warning: exported type Source should have comment or be unexported (golint)
    • Line 142: warning: exported type OutcomeSet should have comment or be unexported (golint)
    • Line 156: warning: exported method OutcomeSet.GetCategory should have comment or be unexported (golint)
    • Line 209: warning: exported type CatalogueOutcomeSet should have comment or be unexported (golint)
    • server/data/mongo/db.go
    • Line 12: warning: exported method Mongo.NewOutcomeSet should have comment or be unexported (golint)
    • Line 18: warning: exported method Mongo.ImportOutcomeSet should have comment or be unexported (golint)
    • Line 24: warning: exported method Mongo.EditOutcomeSet should have comment or be unexported (golint)
    • Line 30: warning: exported method Mongo.GetOutcomeSet should have comment or be unexported (golint)
    • Line 36: warning: exported method Mongo.GetOutcomeSets should have comment or be unexported (golint)
    • Line 42: warning: exported method Mongo.DeleteOutcomeSet should have comment or be unexported (golint)
    • Line 48: warning: exported method Mongo.GetQuestion should have comment or be unexported (golint)
    • Line 54: warning: exported method Mongo.NewQuestion should have comment or be unexported (golint)
    • Line 60: warning: exported method Mongo.DeleteQuestion should have comment or be unexported (golint)
    • Line 66: warning: exported method Mongo.EditQuestion should have comment or be unexported (golint)
    • Line 72: warning: exported method Mongo.MoveQuestion should have comment or be unexported (golint)
    • Line 78: warning: exported method Mongo.GetCategory should have comment or be unexported (golint)
    • Line 84: warning: exported method Mongo.NewCategory should have comment or be unexported (golint)
    • Line 90: warning: exported method Mongo.DeleteCategory should have comment or be unexported (golint)
    • Line 96: warning: exported method Mongo.EditCategory should have comment or be unexported (golint)
    • Line 102: warning: exported method Mongo.SetCategory should have comment or be unexported (golint)
    • Line 108: warning: exported method Mongo.RemoveCategory should have comment or be unexported (golint)
    • Line 114: warning: exported method Mongo.GetOrganisation should have comment or be unexported (golint)
    • Line 120: warning: exported method Mongo.AddOrganisation should have comment or be unexported (golint)
    • Line 126: warning: exported method Mongo.DeleteOrganisation should have comment or be unexported (golint)
    • Line 132: warning: exported method Mongo.UpdateSetting should have comment or be unexported (golint)
    • Line 138: warning: exported method Mongo.GetOrganisations should have comment or be unexported (golint)
    • Line 144: warning: exported method Mongo.GetMeeting should have comment or be unexported (golint)
    • Line 150: warning: exported method Mongo.GetMeetingsForBeneficiary should have comment or be unexported (golint)
    • Line 156: warning: exported method Mongo.GetRecentMeetings should have comment or be unexported (golint)
    • Line 162: warning: exported method Mongo.GetIncompleteMeetingsForBeneficiary should have comment or be unexported (golint)
    • Line 168: warning: exported method Mongo.GetOSMeetingsInTimeRange should have comment or be unexported (golint)
    • Line 174: warning: exported method Mongo.GetOSMeetingsForBeneficiary should have comment or be unexported (golint)
    • Line 180: warning: exported method Mongo.GetFilteredOSMeetingsInTimeRange should have comment or be unexported (golint)
    • Line 186: warning: exported method Mongo.GetFilteredOSMeetingsForBeneficiaries should have comment or be unexported (golint)
    • Line 192: warning: exported method Mongo.NewMeeting should have comment or be unexported (golint)
    • Line 198: warning: exported method Mongo.NewAnswer should have comment or be unexported (golint)
    • Line 204: warning: exported method Mongo.SetNotes should have comment or be unexported (golint)
    • Line 210: warning: exported method Mongo.CompleteMeeting should have comment or be unexported (golint)
    • Line 216: warning: exported method Mongo.DeleteMeeting should have comment or be unexported (golint)
    • Line 222: warning: exported method Mongo.EditMeetingTags should have comment or be unexported (golint)
    • Line 228: warning: exported method Mongo.EditMeetingDate should have comment or be unexported (golint)
    • Line 234: warning: exported method Mongo.EditMeetingBeneficiary should have comment or be unexported (golint)
    • Line 240: warning: exported method Mongo.NewSummon should have comment or be unexported (golint)
    • Line 246: warning: exported method Mongo.NewMeetingFromSummon should have comment or be unexported (golint)
    • Line 252: warning: exported method Mongo.GetTags should have comment or be unexported (golint)
    • Line 258: warning: exported method Mongo.GetTagSuggestions should have comment or be unexported (golint)
    • Line 264: warning: exported method Mongo.GetQuestionnaireTagSuggestions should have comment or be unexported (golint)
    • Line 270: warning: exported method Mongo.GetBeneficiary should have comment or be unexported (golint)
    • Line 276: warning: exported method Mongo.GetBeneficiaries should have comment or be unexported (golint)
    • Line 282: warning: exported method Mongo.SetBeneficiaryTags should have comment or be unexported (golint)
    • Line 288: warning: exported method Mongo.SaveJWT should have comment or be unexported (golint)
    • Line 294: warning: exported method Mongo.GetJWT should have comment or be unexported (golint)
    • Line 300: warning: exported method Mongo.SaveExport should have comment or be unexported (golint)
    • Line 306: warning: exported method Mongo.GetExport should have comment or be unexported (golint)
    • Line 312: warning: exported method Mongo.SaveInvite should have comment or be unexported (golint)
    • Line 318: warning: exported method Mongo.GetInvite should have comment or be unexported (golint)
    • Line 324: warning: exported method Mongo.SaveReportRequest should have comment or be unexported (golint)
    • Line 330: warning: exported method Mongo.HasGeneratedReport should have comment or be unexported (golint)
    • Line 336: warning: exported method Mongo.SaveSummonAcceptance should have comment or be unexported (golint)
    • server/data/mongo/session/meeting.go
    • Line 58: warning: exported method S.GetMeeting should have comment or be unexported (golint)
    • Line 104: warning: exported method S.GetRecentMeetings should have comment or be unexported (golint)
    • Line 119: warning: exported method S.GetMeetingsForBeneficiary should have comment or be unexported (golint)
    • Line 135: warning: exported method S.GetOSMeetingsForBeneficiary should have comment or be unexported (golint)
    • Line 139: warning: exported method S.GetOSMeetingsInTimeRange should have comment or be unexported (golint)
    • Line 148: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 155: warning: exported method S.GetFilteredOSMeetingsInTimeRange should have comment or be unexported (golint)
    • Line 179: warning: exported method S.GetFilteredOSMeetingsForBeneficiaries should have comment or be unexported (golint)
    • Line 207: warning: exported method S.GetIncompleteMeetingsForBeneficiary should have comment or be unexported (golint)
    • Line 250: warning: exported method S.NewMeeting should have comment or be unexported (golint)
    • Line 286: warning: exported method S.NewAnswer should have comment or be unexported (golint)
    • Line 335: warning: exported method S.SetNotes should have comment or be unexported (golint)
    • Line 345: warning: exported method S.CompleteMeeting should have comment or be unexported (golint)
    • Line 358: warning: exported method S.DeleteMeeting should have comment or be unexported (golint)
    • Line 372: warning: exported method S.EditMeetingTags should have comment or be unexported (golint)
    • Line 396: warning: exported method S.EditMeetingDate should have comment or be unexported (golint)
    • Line 412: warning: exported method S.EditMeetingBeneficiary should have comment or be unexported (golint)
    • server/data/mongo/session/organisation.go
    • Line 15: warning: exported method S.GetOrganisation should have comment or be unexported (golint)
    • Line 27: warning: exported method S.UpdateSetting should have comment or be unexported (golint)
    • Line 35: warning: exported method S.AddOrganisation should have comment or be unexported (golint)
    • Line 44: warning: exported method S.DeleteOrganisation should have comment or be unexported (golint)
    • Line 48: warning: exported method S.GetOrganisations should have comment or be unexported (golint)
    • server/controller/user.go
    • Line 10: warning: exported type UserDirectory should have comment or be unexported (golint)
    • Line 19: warning: exported type UserController should have comment or be unexported (golint)
    • Line 23: warning: exported function NewUserController should have comment or be unexported (golint)
    • Line 29: warning: exported method UserController.GetUser should have comment or be unexported (golint)
    • Line 50: warning: exported method UserController.GetUsers should have comment or be unexported (golint)
    • Line 75: warning: exported method UserController.GetSelf should have comment or be unexported (golint)
    • Line 86: warning: exported method UserController.UpdateSelf should have comment or be unexported (golint)
    • Line 109: warning: exported method UserController.CreateUser should have comment or be unexported (golint)
    • Line 117: warning: exported method UserController.UnsubscribeUser should have comment or be unexported (golint)
    • Line 125: warning: exported method UserController.UpdateUser should have comment or be unexported (golint)
    • server/controller/report.go
    • Line 9: warning: exported type ReportDB should have comment or be unexported (golint)
    • Line 13: warning: exported type ReportController should have comment or be unexported (golint)
    • Line 17: warning: exported function NewReportController should have comment or be unexported (golint)
    • Line 21: warning: exported method ReportController.HasGeneratedReport should have comment or be unexported (golint)
    • server/data/mongo/session/tags.go
    • Line 47: warning: exported method S.GetTags should have comment or be unexported (golint)
    • Line 80: warning: exported method S.GetTagSuggestions should have comment or be unexported (golint)
    • Line 107: warning: exported method S.GetQuestionnaireTagSuggestions should have comment or be unexported (golint)
    • server/logic/report.go
    • Line 10: warning: exported type ReportDB should have comment or be unexported (golint)
    • Line 16: warning: exported function ReportOnRecords should have comment or be unexported (golint)
    • Line 35: warning: exported function Report should have comment or be unexported (golint)
    • Line 78: warning: should omit 2nd value from range; this loop is equivalent to `for ben := range ...` (golint)
    • server/auth/keys.go
    • Line 10: warning: exported function MustParseRSAPublicKeyFromPEM should have comment or be unexported (golint)
    • Line 18: warning: exported function MustParseRSAPrivateKeyFromPEM should have comment or be unexported (golint)
    • server/softoutcomes/client.go
    • Line 14: warning: exported type Client should have comment or be unexported (golint)
    • Line 18: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 45: warning: exported method Client.GetQuestionnaires should have comment or be unexported (golint)
    • Line 75: warning: exported method Client.GetQuestionnaire should have comment or be unexported (golint)
    • server/data/mongo/session/audit.go
    • Line 9: warning: exported method S.SaveReportRequest should have comment or be unexported (golint)
    • Line 35: warning: exported method S.HasGeneratedReport should have comment or be unexported (golint)
    • Line 44: warning: exported method S.SaveSummonAcceptance should have comment or be unexported (golint)
    • server/data/mongo/session/question.go
    • Line 11: warning: exported method S.GetQuestion should have comment or be unexported (golint)
    • Line 25: warning: exported method S.NewQuestion should have comment or be unexported (golint)
    • Line 57: warning: exported method S.DeleteQuestion should have comment or be unexported (golint)
    • Line 74: warning: exported method S.EditQuestion should have comment or be unexported (golint)
    • Line 99: warning: exported method S.MoveQuestion should have comment or be unexported (golint)
    • Line 145: warning: exported method S.SetCategory should have comment or be unexported (golint)
    • Line 170: warning: exported method S.RemoveCategory should have comment or be unexported (golint)
    • server/cmd/config.go
    • Line 12: warning: exported type Auth should have comment or be unexported (golint)
    • Line 18: warning: exported type UserDirectory should have comment or be unexported (golint)
    • Line 26: warning: exported type AuthGen should have comment or be unexported (golint)
    • Line 31: warning: exported type Network should have comment or be unexported (golint)
    • Line 35: warning: exported type ErrorTracking should have comment or be unexported (golint)
    • Line 39: warning: exported type DBCache should have comment or be unexported (golint)
    • Line 43: warning: exported type Config should have comment or be unexported (golint)
    • Line 53: warning: exported function MustGetConfiguration should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell97%

Misspell Finds commonly misspelled English words