Preparing report...

Report for github.com/phonkee/gopypi

B    Not bad!    Found 31 issues across 34 files

Tweet

gofmt64%

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!


golint11%

Golint is a linter for Go source code.

    • gopypi/confgen.go
    • Line 12: warning: comment on exported const CONF_TEMPLATE should be of the form "CONF_TEMPLATE ..." (golint)
    • gopypi/managers.go
    • Line 1: warning: package comment should be of the form "Package core ..." (golint)
    • Line 25: warning: comment on exported type Manager should be of the form "Manager ..." (with optional leading article) (golint)
    • Line 165: warning: comment on exported method PackageManager.List should be of the form "List ..." (golint)
    • Line 174: warning: comment on exported method PackageManager.IsMaintainer should be of the form "IsMaintainer ..." (golint)
    • Line 287: warning: comment on exported method PackageVersionFileManager.GetRelativeFilename should be of the form "GetRelativeFilename ..." (golint)
    • Line 324: warning: comment on exported method PlatformManager.ListOrCreate should be of the form "ListOrCreate ..." (golint)
    • Line 437: warning: receiver name d should be consistent with previous receiver name s for DownloadStatsManager (golint)
    • Line 451: warning: comment on exported method DownloadStatsManager.GetCount should be of the form "GetCount ..." (golint)
    • Line 454: warning: receiver name d should be consistent with previous receiver name s for DownloadStatsManager (golint)
    • Line 459: warning: comment on exported method DownloadStatsManager.GetAllStats should be of the form "GetAllStats ..." (golint)
    • Line 462: warning: receiver name d should be consistent with previous receiver name s for DownloadStatsManager (golint)
    • Line 490: warning: exported method DownloadStatsManager.GetStats should have comment or be unexported (golint)
    • Line 490: warning: receiver name d should be consistent with previous receiver name s for DownloadStatsManager (golint)
    • Line 520: warning: receiver name d should be consistent with previous receiver name s for DownloadStatsManager (golint)
    • Line 554: warning: comment on exported method UserManager.Get should be of the form "Get ..." (golint)
    • gopypi/cli.go
    • Line 9: warning: exported var CliApp should have comment or be unexported (golint)
    • Line 37: warning: exported function MigrateAction should have comment or be unexported (golint)
    • Line 48: warning: exported function RunserverAction should have comment or be unexported (golint)
    • gopypi/stats.go
    • Line 5: warning: exported type StatsAggregation should have comment or be unexported (golint)
    • Line 8: warning: exported const STATS_DOWNLOAD_WEEKLY should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: exported type StatsDownloadItem should have comment or be unexported (golint)
    • gopypi/router.go
    • Line 14: warning: comment on exported function InitRouter should be of the form "InitRouter ..." (golint)
    • gopypi/settings.go
    • Line 6: warning: exported const VERSION should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported var AVAILABLE_DB_DRIVERS should have comment or be unexported (golint)
    • Line 68: warning: comment on exported var POST_PACKAGE_ACTIONS should be of the form "POST_PACKAGE_ACTIONS ..." (golint)
    • gopypi/timeutil.go
    • Line 1: warning: package comment should be of the form "Package core ..." (golint)
    • Line 22: warning: comment on exported function TimeAlignMonth should be of the form "TimeAlignMonth ..." (golint)
    • Line 29: warning: comment on exported function TimeAlignYear should be of the form "TimeAlignYear ..." (golint)
    • gopypi/token.go
    • Line 103: warning: comment on exported function ContextGetTokenUser should be of the form "ContextGetTokenUser ..." (golint)
    • Line 117: warning: comment on exported function ContextSetTokenUser should be of the form "ContextSetTokenUser ..." (golint)
    • Line 121: warning: should not use basic type int as key in context.WithValue (golint)
    • gopypi/db.go
    • Line 1: warning: package comment should be of the form "Package core ..." (golint)
    • gopypi/ffuncs.go
    • Line 1: warning: package comment should be of the form "Package core ..." (golint)
    • Line 22: warning: comment on exported function FFUsername should be of the form "FFUsername ..." (golint)
    • Line 122: warning: comment on exported function FFDownloadStatsPackageVersion should be of the form "FFDownloadStatsPackageVersion ..." (golint)
    • gopypi/views.go
    • Line 369: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 378: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • gopypi/xmlrpc_xmlrpc.go
    • Line 18: warning: comment on exported method SearchService.MethodExists should be of the form "MethodExists ..." (golint)
    • Line 26: warning: comment on exported method SearchService.ListMethods should be of the form "ListMethods ..." (golint)
    • Line 37: warning: comment on exported method SearchService.Dispatch should be of the form "Dispatch ..." (golint)
    • Line 48: warning: don't use underscores in Go names; var v_2 should be v2 (golint)
    • Line 64: warning: don't use underscores in Go names; var result_1 should be result1 (golint)
    • Line 71: warning: don't use underscores in Go names; var methodResponse_3 should be methodResponse3 (golint)
    • Line 75: warning: don't use underscores in Go names; var fault_8 should be fault8 (golint)
    • Line 77: warning: don't use underscores in Go names; var code_7 should be code7 (golint)
    • Line 80: warning: don't use underscores in Go names; var code_4 should be code4 (golint)
    • Line 80: warning: don't use underscores in Go names; var ok_6 should be ok6 (golint)
    • Line 84: warning: don't use underscores in Go names; var struct_5 should be struct5 (golint)
    • Line 86: warning: don't use underscores in Go names; var member_9 should be member9 (golint)
    • Line 90: warning: don't use underscores in Go names; var member_10 should be member10 (golint)
    • Line 96: warning: don't use underscores in Go names; var v_11 should be v11 (golint)
    • Line 97: warning: don't use underscores in Go names; var array_data_12 should be arrayData12 (golint)
    • Line 98: warning: don't use underscores in Go names; range var item_13 should be item13 (golint)
    • Line 99: warning: don't use underscores in Go names; var value_14 should be value14 (golint)
    • Line 101: warning: don't use underscores in Go names; var struct_15 should be struct15 (golint)
    • Line 104: warning: don't use underscores in Go names; var member_16 should be member16 (golint)
    • Line 109: warning: don't use underscores in Go names; var value_17 should be value17 (golint)
    • Line 112: warning: don't use underscores in Go names; var struct_var_18 should be structVar18 (golint)
    • Line 117: warning: don't use underscores in Go names; var member_19 should be member19 (golint)
    • Line 122: warning: don't use underscores in Go names; var value_20 should be value20 (golint)
    • Line 125: warning: don't use underscores in Go names; var struct_var_21 should be structVar21 (golint)
    • Line 130: warning: don't use underscores in Go names; var member_23 should be member23 (golint)
    • Line 135: warning: don't use underscores in Go names; var value_24 should be value24 (golint)
    • Line 138: warning: don't use underscores in Go names; var struct_var_25 should be structVar25 (golint)
    • Line 143: warning: don't use underscores in Go names; var member_27 should be member27 (golint)
    • Line 148: warning: don't use underscores in Go names; var value_28 should be value28 (golint)
    • Line 151: warning: don't use underscores in Go names; var struct_var_29 should be structVar29 (golint)
    • gopypi/views_api.go
    • Line 131: warning: comment on exported method LicenseAPIViewSet.MetadataList should be of the form "MetadataList ..." (golint)
    • Line 172: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 200: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 592: warning: comment on exported method StatsDownloadPackageAPIView.Retrieve should be of the form "Retrieve ..." (golint)
    • Line 606: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 630: warning: comment on exported method StatsDownloadPackageVersionAPIView.Retrieve should be of the form "Retrieve ..." (golint)
    • Line 650: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 974: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gopypi/config.go
    • Line 25: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 71: warning: exported type CoreConfig should have comment or be unexported (golint)
    • Line 82: warning: exported type DownloadStatsConfig should have comment or be unexported (golint)
    • Line 91: warning: exported type ManagerConfig should have comment or be unexported (golint)
    • Line 120: warning: exported type PackagesConfig should have comment or be unexported (golint)
    • Line 148: warning: comment on exported function NewConfig should be of the form "NewConfig ..." (golint)
    • Line 362: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gopypi/errors.go
    • Line 7: warning: comment on exported var ErrUnknownDBDriver should be of the form "ErrUnknownDBDriver ..." (golint)
    • Line 10: warning: comment on exported var ErrInvalidAuthHeader should be of the form "ErrInvalidAuthHeader ..." (golint)
    • Line 12: warning: exported var ErrLoginUsername should have comment or be unexported (golint)
    • Line 18: warning: comment on exported var ErrUsernameAlreadyExists should be of the form "ErrUsernameAlreadyExists ..." (golint)
    • Line 29: warning: comment on exported var ErrUserCannotRetrievePackages should be of the form "ErrUserCannotRetrievePackages ..." (golint)
    • Line 33: warning: comment on exported var ErrPostPackageInvalidAction should be of the form "ErrPostPackageInvalidAction ..." (golint)
    • Line 38: warning: comment on exported var ErrObjectNotFound should be of the form "ErrObjectNotFound ..." (golint)
    • gopypi/parser.go
    • Line 1: warning: package comment should be of the form "Package core ..." (golint)
    • Line 14: warning: comment on exported function GetPostAction should be of the form "GetPostAction ..." (golint)
    • Line 25: warning: comment on exported function GetPostedPackage should be of the form "GetPostedPackage ..." (golint)
    • Line 59: warning: comment on exported function GetPostedPackageVersion should be of the form "GetPostedPackageVersion ..." (golint)
    • Line 119: warning: comment on exported function GetPostedPackageVersionFile should be of the form "GetPostedPackageVersionFile ..." (golint)
    • gopypi/term.go
    • Line 53: warning: comment on exported function TerminalGetStringValue should be of the form "TerminalGetStringValue ..." (golint)
    • Line 83: warning: exported function TerminalGetStringValueChoices should have comment or be unexported (golint)
    • Line 118: warning: comment on exported function TerminalGetIntValue should be of the form "TerminalGetIntValue ..." (golint)
    • Line 142: warning: exported function TerminalGetBoolValue should have comment or be unexported (golint)
    • gopypi/commands.go
    • Line 1: warning: package comment should be of the form "Package core ..." (golint)
    • Line 89: warning: comment on exported method ChangePasswordCommand.Run should be of the form "Run ..." (golint)
    • gopypi/features.go
    • Line 1: warning: package comment should be of the form "Package core ..." (golint)
    • Line 17: warning: exported const FEATURE_AUTO_MAINTAINERS should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported const DESCRIPTION_FEATURE_AUTO_MAINTAINERS should have comment (or a comment on this block) or be unexported (golint)
    • gopypi/utils.go
    • Line 24: warning: exported type PackageVersionPathInfo should have comment or be unexported (golint)
    • Line 31: warning: comment on exported function GetPackageVersionFilePath should be of the form "GetPackageVersionFilePath ..." (golint)
    • gopypi/validator.go
    • Line 14: warning: exported function NewValidationResult should have comment or be unexported (golint)
    • Line 21: warning: exported type ValidationError should have comment or be unexported (golint)
    • Line 26: warning: exported type ValidationResult should have comment or be unexported (golint)
    • Line 86: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • gopypi/models.go
    • Line 64: warning: comment on exported method DownloadStatsWeekly.BeforeCreate should be of the form "BeforeCreate ..." (golint)
    • Line 79: warning: comment on exported method DownloadStatsMonthly.BeforeCreate should be of the form "BeforeCreate ..." (golint)
    • Line 94: warning: comment on exported method DownloadStatsYearly.BeforeCreate should be of the form "BeforeCreate ..." (golint)
    • gopypi/serializers.go
    • Line 25: warning: exported method LoginSerializer.Validate should have comment or be unexported (golint)
    • Line 41: warning: comment on exported type UserProfileSerializer should be of the form "UserProfileSerializer ..." (with optional leading article) (golint)
    • Line 67: warning: comment on exported type UserAddSerializer should be of the form "UserAddSerializer ..." (with optional leading article) (golint)
    • Line 132: warning: comment on exported method UserAddSerializer.GetUser should be of the form "GetUser ..." (golint)
    • Line 155: warning: comment on exported type UserUpdateSerializer should be of the form "UserUpdateSerializer ..." (with optional leading article) (golint)
    • Line 269: warning: comment on exported method LicenseUpdateSerializer.UpdateLicense should be of the form "UpdateLicense ..." (golint)
    • Line 278: warning: comment on exported type UserChangePasswordSerializer should be of the form "UserChangePasswordSerializer ..." (with optional leading article) (golint)
    • gopypi/xmlrpc.go
    • Line 1: warning: package comment should be of the form "Package core ..." (golint)
    • Line 14: warning: don't use underscores in Go names; struct field _pypi_ordering should be _pypiOrdering (golint)
    • gopypi/common.go
    • Line 6: warning: comment on exported var CommonPaginator should be of the form "CommonPaginator ..." (golint)
    • gopypi/middleware.go
    • Line 72: warning: comment on exported function BasicAuthLoginRequired should be of the form "BasicAuthLoginRequired ..." (golint)
    • Line 130: warning: exported function CommonMiddleware should have comment or be unexported (golint)
    • Line 148: warning: should not use basic type int as key in context.WithValue (golint)

gocyclo97%

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.

    • gopypi/views.go
    • Line 120: warning: cyclomatic complexity 21 of function (*PostPackageView).ActionFileUpload() is high (> 15) (gocyclo)

ineffassign94%

IneffAssign detects ineffectual assignments in Go code.

    • gopypi/views_api.go
    • Line 38: warning: ineffectual assignment to err (ineffassign)
    • Line 427: warning: ineffectual assignment to err (ineffassign)
    • Line 843: warning: ineffectual assignment to err (ineffassign)
    • Line 877: warning: ineffectual assignment to err (ineffassign)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words