Preparing report...

Report for github.com/ruslanBik4/httpgo

A+    Excellent!    Found 51 issues across 93 files

Tweet

gofmt96%

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!


gocyclo87%

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.

    • httpgo/models/db/db.go
    • Line 230: warning: cyclomatic complexity 25 of function DoUpdateFromForm() is high (> 15) (gocyclo)
    • Line 112: warning: cyclomatic complexity 23 of function DoInsertFromForm() is high (> 15) (gocyclo)

golint53%

Golint is a linter for Go source code.

    • httpgo/apis/errors.go
    • Line 22: warning: exported type ErrorResp should have comment or be unexported (golint)
    • Line 26: warning: exported function NewErrorResp should have comment or be unexported (golint)
    • Line 30: warning: exported function NewErrorRespBadDTO should have comment or be unexported (golint)
    • httpgo/httpGo/config.go
    • Line 5: warning: don't use MixedCaps in package name; httpGo should be httpgo (golint)
    • Line 18: warning: exported type AccessConf should have comment or be unexported (golint)
    • Line 90: warning: exported method CfgHttp.Allow should have comment or be unexported (golint)
    • Line 111: warning: exported method CfgHttp.Deny should have comment or be unexported (golint)
    • Line 132: warning: exported method CfgHttp.IsAccess should have comment or be unexported (golint)
    • Line 136: warning: exported method CfgHttp.Reload should have comment or be unexported (golint)
    • httpgo/models/db/mysql.go
    • Line 1: warning: package comment should be of the form "Package db ..." (golint)
    • Line 28: warning: exported var SQLvalidator should have comment or be unexported (golint)
    • Line 42: warning: exported type ErrBadSelectQuery should have comment or be unexported (golint)
    • Line 49: warning: exported function PrepareQuery should have comment or be unexported (golint)
    • Line 84: warning: comment on exported function DoInsert should be of the form "DoInsert ..." (golint)
    • Line 98: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 104: warning: comment on exported function DoUpdate should be of the form "DoUpdate ..." (golint)
    • Line 115: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 121: warning: comment on exported function DoSelect should be of the form "DoSelect ..." (golint)
    • Line 129: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 135: warning: exported function DoQuery should have comment or be unexported (golint)
    • Line 190: warning: comment on exported function PrepareRowsToReading should be of the form "PrepareRowsToReading ..." (golint)
    • Line 455: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 500: warning: comment on exported function PerformSelectQuery should be of the form "PerformSelectQuery ..." (golint)
    • httpgo/views/templates/forms/columnDecor.go
    • Line 20: warning: exported type AttachmentList should have comment or be unexported (golint)
    • Line 25: warning: exported type ColumnDecor should have comment or be unexported (golint)
    • Line 47: warning: exported function NewColumnDecor should have comment or be unexported (golint)
    • Line 70: warning: exported method ColumnDecor.Copy should have comment or be unexported (golint)
    • Line 91: warning: exported method ColumnDecor.Placeholder should have comment or be unexported (golint)
    • Line 107: warning: exported method ColumnDecor.Pattern should have comment or be unexported (golint)
    • Line 125: warning: exported method ColumnDecor.GetFields should have comment or be unexported (golint)
    • Line 167: warning: exported method ColumnDecor.Type should have comment or be unexported (golint)
    • Line 177: warning: exported method ColumnDecor.GetValues should have comment or be unexported (golint)
    • Line 239: warning: exported method ColumnDecor.InputName should have comment or be unexported (golint)
    • Line 289: warning: exported type Button should have comment or be unexported (golint)
    • Line 295: warning: exported type BlockColumns should have comment or be unexported (golint)
    • httpgo/models/docs/sheets.go
    • Line 27: warning: exported const ClientID should have comment or be unexported (golint)
    • Line 30: warning: exported type SheetsGoogleDocs should have comment or be unexported (golint)
    • Line 127: warning: exported method SheetsGoogleDocs.Init should have comment or be unexported (golint)
    • Line 153: warning: exported method SheetsGoogleDocs.Sheets should have comment or be unexported (golint)
    • httpgo/apis/apiroute.go
    • Line 58: warning: exported type ApiRouteHandler should have comment or be unexported (golint)
    • Line 59: warning: exported type ApiRouteFuncAuth should have comment or be unexported (golint)
    • Line 343: warning: exported function AddFieldToJSON should have comment or be unexported (golint)
    • Line 348: warning: exported function AddObjectToJSON should have comment or be unexported (golint)
    • Line 354: warning: exported function FirstFieldToJSON should have comment or be unexported (golint)
    • Line 359: warning: exported function FirstObjectToJSON should have comment or be unexported (golint)
    • Line 366: warning: exported type MapRoutes should have comment or be unexported (golint)
    • Line 506: warning: exported method MapRoutes.GetTestRouteSuffix should have comment or be unexported (golint)
    • Line 514: warning: exported method MapRoutes.GetRoute should have comment or be unexported (golint)
    • httpgo/auth/tokens.go
    • Line 14: warning: exported type Tokens should have comment or be unexported (golint)
    • Line 20: warning: exported type TokenData should have comment or be unexported (golint)
    • Line 32: warning: exported type MapTokens should have comment or be unexported (golint)
    • Line 38: warning: exported function NewMapTokens should have comment or be unexported (golint)
    • Line 42: warning: exported method MapTokens.NewToken should have comment or be unexported (golint)
    • Line 70: warning: exported method MapTokens.GetToken should have comment or be unexported (golint)
    • Line 82: warning: exported method MapTokens.RemoveToken should have comment or be unexported (golint)
    • httpgo/models/db/db.go
    • Line 5: warning: package comment should be of the form "Package db ..." (golint)
    • Line 23: warning: exported function GetParentFieldName should have comment or be unexported (golint)
    • Line 45: warning: exported var DigitsValidator should have comment or be unexported (golint)
    • Line 48: warning: exported function GetNameTableProps should have comment or be unexported (golint)
    • Line 109: warning: comment on exported function DoInsertFromForm should be of the form "DoInsertFromForm ..." (golint)
    • Line 220: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 226: warning: comment on exported function DoUpdateFromForm should be of the form "DoUpdateFromForm ..." (golint)
    • Line 342: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 420: warning: exported type MenuItems should have comment or be unexported (golint)
    • Line 425: warning: exported var IDvalidator should have comment or be unexported (golint)
    • Line 427: warning: comment on exported method MenuItems.GetMenu should be of the form "GetMenu ..." (golint)
    • Line 451: warning: comment on exported method MenuItems.GetMenuByUserId should be of the form "GetMenuByUserId ..." (golint)
    • Line 452: warning: don't use underscores in Go names; method parameter user_id should be userID (golint)
    • Line 465: warning: don't use underscores in Go names; var is_admin should be isAdmin (golint)
    • Line 508: warning: comment on exported method MenuItems.Init should be of the form "Init ..." (golint)
    • Line 543: warning: comment on exported function GetSimpleInsertSQLString should be of the form "GetSimpleInsertSQLString ..." (golint)
    • httpgo/services/tcpip.go
    • Line 20: warning: exported function DoRequest should have comment or be unexported (golint)
    • Line 85: warning: exported function DoGetRequest should have comment or be unexported (golint)
    • Line 123: warning: exported function DoRequestAndKeep should have comment or be unexported (golint)
    • httpgo/models/telegrambot/telegrambot.go
    • Line 203: warning: comment on exported method TelegramBot.GetUpdates should be of the form "GetUpdates ..." (golint)
    • Line 226: warning: comment on exported method TelegramBot.GetChat should be of the form "GetChat ..." (golint)
    • Line 239: warning: comment on exported method TelegramBot.GetChatMemberCount should be of the form "GetChatMemberCount ..." (golint)
    • Line 252: warning: comment on exported method TelegramBot.GetChatMember should be of the form "GetChatMember ..." (golint)
    • Line 266: warning: comment on exported method TelegramBot.InviteUser should be of the form "InviteUser ..." (golint)
    • Line 280: warning: error should be the last type when returning multiple items (golint)
    • Line 455: warning: error should be the last type when returning multiple items (golint)
    • Line 499: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 528: warning: comment on exported method TelegramBot.GetResult should be of the form "GetResult ..." (golint)
    • httpgo/main.go
    • Line 24: warning: should not use dot imports (golint)
    • Line 29: warning: should not use dot imports (golint)
    • Line 46: warning: exported const ShowVersion should have comment or be unexported (golint)
    • Line 421: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 422: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 423: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 495: warning: comment on exported function HandleVersion should be of the form "HandleVersion ..." (golint)
    • httpgo/auth/basic.go
    • Line 19: warning: exported type AuthBasic should have comment or be unexported (golint)
    • Line 26: warning: exported function NewAuthBasic should have comment or be unexported (golint)
    • Line 30: warning: exported method AuthBasic.Auth should have comment or be unexported (golint)
    • Line 67: warning: exported method AuthBasic.AdminAuth should have comment or be unexported (golint)
    • httpgo/apis/apis.go
    • Line 33: warning: exported type CtxApis should have comment or be unexported (golint)
    • Line 35: warning: exported function NewCtxApis should have comment or be unexported (golint)
    • Line 39: warning: exported method CtxApis.AddValue should have comment or be unexported (golint)
    • Line 42: warning: exported method CtxApis.Deadline should have comment or be unexported (golint)
    • Line 45: warning: exported method CtxApis.Done should have comment or be unexported (golint)
    • Line 48: warning: exported method CtxApis.Err should have comment or be unexported (golint)
    • Line 51: warning: exported method CtxApis.Value should have comment or be unexported (golint)
    • Line 58: warning: exported type FncAuth should have comment or be unexported (golint)
    • httpgo/apis/dto.go
    • Line 17: warning: exported type CheckDTO should have comment or be unexported (golint)
    • Line 21: warning: exported type CompoundDTO should have comment or be unexported (golint)
    • httpgo/models/fcgi_client/fcgiclient.go
    • Line 26: warning: exported const FCGI_LISTENSOCK_FILENO should have comment or be unexported (golint)
    • Line 27: warning: exported const FCGI_HEADER_LEN should have comment or be unexported (golint)
    • Line 28: warning: exported const VERSION_1 should have comment or be unexported (golint)
    • Line 29: warning: exported const FCGI_NULL_REQUEST_ID should have comment or be unexported (golint)
    • Line 30: warning: exported const FCGI_KEEP_CONN should have comment or be unexported (golint)
    • Line 34: warning: exported const FCGI_BEGIN_REQUEST should have comment (or a comment on this block) or be unexported (golint)
    • Line 49: warning: exported const FCGI_RESPONDER should have comment (or a comment on this block) or be unexported (golint)
    • Line 55: warning: exported const FCGI_REQUEST_COMPLETE should have comment (or a comment on this block) or be unexported (golint)
    • Line 62: warning: exported const FCGI_MAX_CONNS should have comment (or a comment on this block) or be unexported (golint)
    • Line 122: warning: exported type FCGIClient should have comment or be unexported (golint)
    • Line 131: warning: comment on exported function Dial should be of the form "Dial ..." (golint)
    • Line 151: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 155: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 173: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 178: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 185: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 329: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 352: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 384: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 392: warning: comment on exported method FCGIClient.Post should be of the form "Post ..." (golint)
    • Line 394: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 411: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 419: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • httpgo/models/docs/replaces.go
    • Line 17: warning: exported function GetReplaces should have comment or be unexported (golint)
    • Line 59: warning: comment on exported function GetKeyword should be of the form "GetKeyword ..." (golint)
    • httpgo/tools/selenius/wd.go
    • Line 13: warning: should not use dot imports (golint)
    • Line 18: warning: exported type WD should have comment or be unexported (golint)
    • Line 24: warning: exported function NewWD should have comment or be unexported (golint)
    • Line 48: warning: comment on exported method WD.SetAlertText should be of the form "SetAlertText ..." (golint)
    • Line 63: warning: comment on exported method WD.SaveScreenShoot should be of the form "SaveScreenShoot ..." (golint)
    • Line 79: warning: exported method WD.AcceptAlert should have comment or be unexported (golint)
    • Line 83: warning: exported method WD.ActiveElement should have comment or be unexported (golint)
    • Line 87: warning: exported method WD.ExecuteScript should have comment or be unexported (golint)
    • Line 91: warning: exported method WD.MaximizeWindow should have comment or be unexported (golint)
    • Line 95: warning: comment on exported method WD.FindElementBySelector should be of the form "FindElementBySelector ..." (golint)
    • httpgo/views/templates/json/anyjson.go
    • Line 5: warning: package comment should be of the form "Package json ..." (golint)
    • Line 20: warning: exported var Json should have comment or be unexported (golint)
    • Line 22: warning: exported function StreamWrap should have comment or be unexported (golint)
    • httpgo/views/templates/json/anyjson.qtpl_test.go
    • Line 64: warning: don't use underscores in Go names; struct field Id_roles should be IDRoles (golint)
    • Line 65: warning: don't use underscores in Go names; struct field Last_login should be LastLogin (golint)
    • Line 67: warning: don't use underscores in Go names; struct field Last_page should be LastPage (golint)
    • httpgo/models/fcgi_client/fcgiclient_test.go
    • Line 31: warning: don't use underscores in Go names; const script_file should be scriptFile (golint)
    • Line 33: warning: don't use underscores in Go names; const ip_port should be ipPort (golint)
    • Line 48: warning: don't use underscores in Go names; var file_num should be fileNum (golint)
    • Line 101: warning: don't use underscores in Go names; func parameter fcgi_params should be fcgiParams (golint)
    • Line 209: warning: don't use underscores in Go names; var fcgi_params should be fcgiParams (golint)
    • httpgo/models/html.go
    • Line 21: warning: exported function GetTags should have comment or be unexported (golint)
    • Line 25: warning: exported function IsRusText should have comment or be unexported (golint)
    • Line 29: warning: exported function IsEngText should have comment or be unexported (golint)
    • Line 33: warning: exported function DecodeHtml should have comment or be unexported (golint)
    • httpgo/typesExt/define.go
    • Line 1: warning: don't use MixedCaps in package name; typesExt should be typesext (golint)
    • Line 8: warning: exported const TArray should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported function StringTypeKinds should have comment or be unexported (golint)
    • Line 26: warning: exported function Basic should have comment or be unexported (golint)
    • Line 34: warning: exported function BasicInfo should have comment or be unexported (golint)
    • Line 42: warning: exported function IsNumeric should have comment or be unexported (golint)
    • httpgo/views/templates/forms/fields-form.go
    • Line 5: warning: package comment should be of the form "Package forms ..." (golint)
    • Line 16: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 28: warning: comment on exported type FieldStructure should be of the form "FieldStructure ..." (with optional leading article) (golint)
    • Line 63: warning: exported type FieldsTable should have comment or be unexported (golint)
    • Line 84: warning: comment on exported method FieldStructure.TypeInput should be of the form "TypeInput ..." (golint)
    • Line 141: warning: comment on exported function StyleInput should be of the form "StyleInput ..." (golint)
    • Line 167: warning: comment on exported function GetLengthFromType should be of the form "GetLengthFromType ..." (golint)
    • Line 214: warning: exported method FieldsTable.FindField should have comment or be unexported (golint)
    • Line 317: warning: exported const CELL_TABLE should have comment or be unexported (golint)
    • Line 318: warning: exported const CELL_SELECT should have comment or be unexported (golint)
    • Line 503: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 508: warning: exported method FieldStructure.GetOptions should have comment or be unexported (golint)
    • Line 573: warning: exported method FieldStructure.RenderSet should have comment or be unexported (golint)
    • Line 588: warning: exported method FieldStructure.RenderEnum should have comment or be unexported (golint)
    • Line 640: warning: exported method FieldStructure.GetColumnTitles should have comment or be unexported (golint)
    • Line 640: warning: receiver name fieldStrc should be consistent with previous receiver name field for FieldStructure (golint)
    • Line 667: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 676: warning: receiver name fieldStrc should be consistent with previous receiver name field for FieldStructure (golint)
    • Line 719: warning: exported method FieldStructure.GetTitle should have comment or be unexported (golint)
    • Line 719: warning: receiver name fieldStrc should be consistent with previous receiver name field for FieldStructure (golint)
    • Line 783: warning: comment on exported method FieldsTable.PutDataFrom should be of the form "PutDataFrom ..." (golint)
    • Line 784: warning: receiver name fields should be consistent with previous receiver name ns for FieldsTable (golint)
    • Line 833: warning: receiver name fields should be consistent with previous receiver name ns for FieldsTable (golint)
    • Line 843: warning: exported method FieldStructure.GetListJSON should have comment or be unexported (golint)
    • Line 860: warning: exported method FieldStructure.GetOptionsJson should have comment or be unexported (golint)
    • httpgo/views/render.go
    • Line 39: warning: exported function WriteHeadersHTML should have comment or be unexported (golint)
    • Line 50: warning: comment on exported function RenderHTMLPage should be of the form "RenderHTMLPage ..." (golint)
    • Line 157: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 170: warning: exported function RenderOutWithWrapLine should have comment or be unexported (golint)
    • httpgo/auth/jwt.go
    • Line 18: warning: exported type AuthBearer should have comment or be unexported (golint)
    • Line 22: warning: exported function NewAuthBearer should have comment or be unexported (golint)
    • Line 33: warning: exported method AuthBearer.NewToken should have comment or be unexported (golint)
    • Line 37: warning: exported method AuthBearer.RemoveToken should have comment or be unexported (golint)
    • Line 41: warning: exported method AuthBearer.GetToken should have comment or be unexported (golint)
    • Line 68: warning: exported method AuthBearer.Auth should have comment or be unexported (golint)
    • Line 80: warning: exported method AuthBearer.AdminAuth should have comment or be unexported (golint)
    • httpgo/models/db/qb/types.go
    • Line 16: warning: comment on exported type QBField should be of the form "QBField ..." (with optional leading article) (golint)
    • Line 29: warning: comment on exported type QBTable should be of the form "QBTable ..." (with optional leading article) (golint)
    • Line 41: warning: comment on exported type QueryBuilder should be of the form "QueryBuilder ..." (with optional leading article) (golint)
    • Line 57: warning: comment on exported method QueryBuilder.PrintToLogs should be of the form "PrintToLogs ..." (golint)
    • Line 80: warning: comment on exported method QueryBuilder.AddArg should be of the form "AddArg ..." (golint)
    • Line 86: warning: exported method QueryBuilder.AddArgs should have comment or be unexported (golint)
    • Line 94: warning: exported method QueryBuilder.SetArgs should have comment or be unexported (golint)
    • Line 101: warning: comment on exported method QueryBuilder.SetWhere should be of the form "SetWhere ..." (golint)
    • Line 119: warning: comment on exported method QueryBuilder.JoinTable should be of the form "JoinTable ..." (golint)
    • Line 128: warning: exported method QueryBuilder.Join should have comment or be unexported (golint)
    • Line 136: warning: exported method QueryBuilder.LeftJoin should have comment or be unexported (golint)
    • Line 144: warning: exported method QueryBuilder.RightJoin should have comment or be unexported (golint)
    • Line 152: warning: exported method QueryBuilder.InnerJoin should have comment or be unexported (golint)
    • Line 160: warning: exported method QueryBuilder.AddUnion should have comment or be unexported (golint)
    • httpgo/apis/types.go
    • Line 16: warning: should not use dot imports (golint)
    • Line 23: warning: exported type ApisValues should have comment or be unexported (golint)
    • Line 50: warning: exported function NewStructInParam should have comment or be unexported (golint)
    • Line 58: warning: comment on exported function NewSliceTypeInParam should be of the form "NewSliceTypeInParam ..." (golint)
    • Line 156: warning: exported method TypeInParam.ReadValue should have comment or be unexported (golint)
    • Line 179: warning: exported method TypeInParam.ConvertSlice should have comment or be unexported (golint)
    • Line 279: warning: exported method TypeInParam.IsSlice should have comment or be unexported (golint)
    • httpgo/services/show_logs.go
    • Line 105: warning: comment on exported function HandleStatusServer should be of the form "HandleStatusServer ..." (golint)
    • Line 116: warning: comment on exported function HandleStatusServices should be of the form "HandleStatusServices ..." (golint)
    • Line 122: warning: comment on exported function HandleStatusDB should be of the form "HandleStatusDB ..." (golint)
    • Line 205: warning: exported function RunGrep should have comment or be unexported (golint)
    • Line 243: warning: exported function RunPostgresqlLog should have comment or be unexported (golint)
    • Line 257: warning: exported type ShowLogsEngine should have comment or be unexported (golint)
    • Line 261: warning: exported method ShowLogsEngine.Init should have comment or be unexported (golint)
    • Line 276: warning: exported method ShowLogsEngine.Send should have comment or be unexported (golint)
    • Line 280: warning: exported method ShowLogsEngine.Get should have comment or be unexported (golint)
    • Line 284: warning: exported method ShowLogsEngine.Connect should have comment or be unexported (golint)
    • Line 288: warning: exported method ShowLogsEngine.Close should have comment or be unexported (golint)
    • Line 292: warning: exported method ShowLogsEngine.Status should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign92%

IneffAssign detects ineffectual assignments in Go code.


misspell96%

Misspell Finds commonly misspelled English words