Preparing report...

Report for github.com/mattermost/mattermost-plugin-apps

A+    Excellent!    Found 71 issues across 127 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


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.


golint44%

Golint is a linter for Go source code.

    • mattermost-plugin-apps/server/logger/logger.go
    • Line 7: warning: exported type Logger should have comment or be unexported (golint)
    • Line 8: warning: exported type LogContext should have comment or be unexported (golint)
    • Line 10: warning: exported type LogAPI should have comment or be unexported (golint)
    • Line 37: warning: exported function New should have comment or be unexported (golint)
    • mattermost-plugin-apps/examples/go/hello/send_survey.go
    • Line 14: warning: exported type SurveyFormSubmission should have comment or be unexported (golint)
    • Line 45: warning: exported function NewSendSurveyFormResponse should have comment or be unexported (golint)
    • Line 97: warning: exported function NewSendSurveyPartialFormResponse should have comment or be unexported (golint)
    • Line 128: warning: exported method HelloApp.SendSurvey should have comment or be unexported (golint)
    • mattermost-plugin-apps/apps/mmclient/mattermost_client_pp.go
    • Line 18: warning: exported const HeaderEtagClient should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type ClientPP should have comment or be unexported (golint)
    • Line 57: warning: exported function NewAPIClientPP should have comment or be unexported (golint)
    • Line 62: warning: exported method ClientPP.SetOAuthToken should have comment or be unexported (golint)
    • Line 67: warning: exported method ClientPP.KVSet should have comment or be unexported (golint)
    • Line 76: warning: exported method ClientPP.KVGet should have comment or be unexported (golint)
    • Line 90: warning: exported method ClientPP.KVDelete should have comment or be unexported (golint)
    • Line 99: warning: exported method ClientPP.Subscribe should have comment or be unexported (golint)
    • Line 110: warning: exported method ClientPP.Unsubscribe should have comment or be unexported (golint)
    • Line 121: warning: exported method ClientPP.StoreOAuth2App should have comment or be unexported (golint)
    • Line 134: warning: exported method ClientPP.StoreOAuth2User should have comment or be unexported (golint)
    • Line 143: warning: exported method ClientPP.GetOAuth2User should have comment or be unexported (golint)
    • Line 157: warning: exported method ClientPP.GetPluginsRoute should have comment or be unexported (golint)
    • Line 161: warning: exported method ClientPP.GetPluginRoute should have comment or be unexported (golint)
    • Line 165: warning: exported method ClientPP.DoAPIGET should have comment or be unexported (golint)
    • Line 169: warning: exported method ClientPP.DoAPIPOST should have comment or be unexported (golint)
    • Line 173: warning: exported method ClientPP.DoAPIDELETE should have comment or be unexported (golint)
    • Line 177: warning: exported method ClientPP.DoAPIRequest should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/upstream/uphttp/upstream.go
    • Line 22: warning: exported type Upstream should have comment or be unexported (golint)
    • Line 28: warning: exported function NewUpstream should have comment or be unexported (golint)
    • Line 36: warning: exported method Upstream.Roundtrip should have comment or be unexported (golint)
    • Line 100: warning: exported method Upstream.GetStatic should have comment or be unexported (golint)
    • mattermost-plugin-apps/apps/mmclient/mattermost_client.go
    • Line 13: warning: exported type Client should have comment or be unexported (golint)
    • Line 23: warning: exported function AsBot should have comment or be unexported (golint)
    • Line 27: warning: exported function AsActingUser should have comment or be unexported (golint)
    • Line 31: warning: exported function AsAdmin should have comment or be unexported (golint)
    • Line 35: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 46: warning: exported method Client.KVSet should have comment or be unexported (golint)
    • Line 60: warning: exported method Client.KVGet should have comment or be unexported (golint)
    • Line 71: warning: exported method Client.KVDelete should have comment or be unexported (golint)
    • Line 85: warning: exported method Client.Subscribe should have comment or be unexported (golint)
    • Line 100: warning: exported method Client.Unsubscribe should have comment or be unexported (golint)
    • Line 115: warning: exported method Client.StoreOAuth2App should have comment or be unexported (golint)
    • Line 126: warning: exported method Client.StoreOAuth2User should have comment or be unexported (golint)
    • Line 137: warning: exported method Client.GetOAuth2User should have comment or be unexported (golint)
    • Line 148: warning: exported method Client.CreatePost should have comment or be unexported (golint)
    • Line 163: warning: exported method Client.DM should have comment or be unexported (golint)
    • Line 175: warning: exported method Client.DMPost should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/proxy/service.go
    • Line 23: warning: exported type Proxy should have comment or be unexported (golint)
    • Line 36: warning: exported type Service should have comment or be unexported (golint)
    • Line 62: warning: exported function NewService should have comment or be unexported (golint)
    • Line 75: warning: exported method Proxy.AddBuiltinUpstream should have comment or be unexported (golint)
    • Line 82: warning: exported function WriteCallError should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/config/config.go
    • Line 33: warning: exported type BuildConfig should have comment or be unexported (golint)
    • Line 60: warning: exported method Config.SetContextDefaults should have comment or be unexported (golint)
    • Line 69: warning: exported method Config.SetContextDefaultsForApp should have comment or be unexported (golint)
    • Line 79: warning: exported method Config.AppPath should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/proxy/proxy.go
    • Line 21: warning: exported method Proxy.Call should have comment or be unexported (golint)
    • Line 71: warning: exported method Proxy.Notify should have comment or be unexported (golint)
    • Line 113: warning: exported method Proxy.NotifyRemoteWebhook should have comment or be unexported (golint)
    • Line 151: warning: exported method Proxy.GetAsset should have comment or be unexported (golint)
    • mattermost-plugin-apps/apps/app.go
    • Line 88: warning: exported type AppMetadataForClient should have comment or be unexported (golint)
    • Line 94: warning: exported const MinAppIDLength should have comment (or a comment on this block) or be unexported (golint)
    • Line 98: warning: exported method AppID.IsValid should have comment or be unexported (golint)
    • Line 126: warning: exported const VersionFormat should have comment or be unexported (golint)
    • Line 128: warning: exported method AppVersion.IsValid should have comment or be unexported (golint)
    • Line 153: warning: comment on exported const AppTypeHTTP should be of the form "AppTypeHTTP ..." (golint)
    • Line 159: warning: comment on exported const AppTypeAWSLambda should be of the form "AppTypeAWSLambda ..." (golint)
    • Line 165: warning: comment on exported const AppTypeBuiltin should be of the form "AppTypeBuiltin ..." (golint)
    • Line 171: warning: exported method AppType.IsValid should have comment or be unexported (golint)
    • mattermost-plugin-apps/apps/call.go
    • Line 72: warning: exported type CallResponseType should have comment or be unexported (golint)
    • Line 79: warning: comment on exported const CallResponseTypeError should be of the form "CallResponseTypeError ..." (golint)
    • Line 145: warning: exported function NewProxyCallResponse should have comment or be unexported (golint)
    • Line 152: warning: exported function NewErrorCallResponse should have comment or be unexported (golint)
    • Line 168: warning: exported function CallRequestFromJSON should have comment or be unexported (golint)
    • Line 177: warning: exported function CallRequestFromJSONReader should have comment or be unexported (golint)
    • Line 186: warning: exported function NewCall should have comment or be unexported (golint)
    • Line 193: warning: exported method Call.WithOverrides should have comment or be unexported (golint)
    • Line 210: warning: exported method CallRequest.GetValue should have comment or be unexported (golint)
    • mattermost-plugin-apps/apps/manifest.go
    • Line 12: warning: comment on exported const StaticFolder should be of the form "StaticFolder ..." (golint)
    • Line 15: warning: comment on exported const PathWebhook should be of the form "PathWebhook ..." (golint)
    • Line 21: warning: exported type Manifest should have comment or be unexported (golint)
    • Line 104: warning: exported var DefaultOnInstall should have comment or be unexported (golint)
    • Line 111: warning: exported var DefaultBindings should have comment or be unexported (golint)
    • Line 115: warning: exported var DefaultGetOAuth2ConnectURL should have comment or be unexported (golint)
    • Line 124: warning: exported var DefaultOnOAuth2Complete should have comment or be unexported (golint)
    • Line 134: warning: exported method Manifest.IsValid should have comment or be unexported (golint)
    • Line 168: warning: exported function ManifestFromJSON should have comment or be unexported (golint)
    • mattermost-plugin-apps/aws/provision_data.go
    • Line 35: warning: exported type FunctionData should have comment or be unexported (golint)
    • Line 42: warning: exported type AssetData should have comment or be unexported (golint)
    • Line 47: warning: exported function GetProvisionDataFromFile should have comment or be unexported (golint)
    • Line 187: warning: exported method ProvisionData.IsValid should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/config/service.go
    • Line 16: warning: exported type Configurable should have comment or be unexported (golint)
    • Line 20: warning: comment on exported type Service should be of the form "Service ..." (with optional leading article) (golint)
    • Line 41: warning: exported function NewService should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/proxy/list.go
    • Line 15: warning: exported method Proxy.GetManifest should have comment or be unexported (golint)
    • Line 19: warning: exported method Proxy.GetInstalledApp should have comment or be unexported (golint)
    • Line 23: warning: exported method Proxy.GetInstalledApps should have comment or be unexported (golint)
    • Line 38: warning: exported method Proxy.GetListedApps should have comment or be unexported (golint)
    • mattermost-plugin-apps/examples/go/hello/survey.go
    • Line 7: warning: exported function NewSurveyForm should have comment or be unexported (golint)
    • Line 26: warning: exported function NewSurveyFormResponse should have comment or be unexported (golint)
    • Line 34: warning: exported method HelloApp.ProcessSurvey should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/config/test_service.go
    • Line 8: warning: exported type TestConfigurator should have comment or be unexported (golint)
    • Line 15: warning: exported function NewTestConfigurator should have comment or be unexported (golint)
    • Line 21: warning: exported method TestConfigurator.WithMattermostConfig should have comment or be unexported (golint)
    • Line 26: warning: exported method TestConfigurator.GetConfig should have comment or be unexported (golint)
    • Line 30: warning: exported method TestConfigurator.GetMattermostConfig should have comment or be unexported (golint)
    • Line 34: warning: exported method TestConfigurator.Reconfigure should have comment or be unexported (golint)
    • Line 38: warning: exported method TestConfigurator.StoreConfig should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/appservices/oauth2.go
    • Line 8: warning: exported method AppServices.StoreOAuth2App should have comment or be unexported (golint)
    • Line 31: warning: exported method AppServices.StoreOAuth2User should have comment or be unexported (golint)
    • Line 45: warning: exported method AppServices.GetOAuth2User should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/main.go
    • Line 9: warning: exported var BuildHash should have comment or be unexported (golint)
    • Line 10: warning: exported var BuildHashShort should have comment or be unexported (golint)
    • Line 11: warning: exported var BuildDate should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/plugin.go
    • Line 33: warning: exported type Plugin should have comment or be unexported (golint)
    • Line 51: warning: exported function NewPlugin should have comment or be unexported (golint)
    • Line 57: warning: exported method Plugin.OnActivate should have comment or be unexported (golint)
    • Line 148: warning: exported method Plugin.OnConfigurationChange should have comment or be unexported (golint)
    • Line 160: warning: exported method Plugin.ExecuteCommand should have comment or be unexported (golint)
    • Line 169: warning: exported method Plugin.UserHasBeenCreated should have comment or be unexported (golint)
    • Line 179: warning: exported method Plugin.UserHasJoinedChannel should have comment or be unexported (golint)
    • Line 183: warning: exported method Plugin.UserHasLeftChannel should have comment or be unexported (golint)
    • Line 187: warning: exported method Plugin.UserHasJoinedTeam should have comment or be unexported (golint)
    • Line 191: warning: exported method Plugin.UserHasLeftTeam should have comment or be unexported (golint)
    • Line 195: warning: exported method Plugin.MessageHasBeenPosted should have comment or be unexported (golint)
    • Line 210: warning: exported method Plugin.ChannelHasBeenCreated should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/utils/errors.go
    • Line 5: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 6: warning: exported var ErrForbidden should have comment or be unexported (golint)
    • Line 7: warning: exported var ErrUnauthorized should have comment or be unexported (golint)
    • Line 8: warning: exported var ErrInvalid should have comment or be unexported (golint)
    • Line 10: warning: exported function NewError should have comment or be unexported (golint)
    • Line 29: warning: exported function NewNotFoundError should have comment or be unexported (golint)
    • Line 30: warning: exported function NewForbiddenError should have comment or be unexported (golint)
    • Line 31: warning: exported function NewUnauthorizedError should have comment or be unexported (golint)
    • Line 32: warning: exported function NewInvalidError should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/utils/httputils/utils.go
    • Line 22: warning: exported function NormalizeRemoteBaseURL should have comment or be unexported (golint)
    • Line 53: warning: exported function WriteError should have comment or be unexported (golint)
    • Line 72: warning: exported function WriteJSON should have comment or be unexported (golint)
    • Line 77: warning: exported function WriteJSONStatus should have comment or be unexported (golint)
    • Line 83: warning: exported const InLimit should have comment or be unexported (golint)
    • Line 85: warning: exported function ReadAndClose should have comment or be unexported (golint)
    • Line 90: warning: exported function LimitReadAll should have comment or be unexported (golint)
    • Line 97: warning: exported function ProcessResponseError should have comment or be unexported (golint)
    • Line 112: warning: exported function CheckAuthorized should have comment or be unexported (golint)
    • mattermost-plugin-apps/examples/go/hello/builtin_hello/helloapp.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 21: warning: exported const AppID should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported function New should have comment or be unexported (golint)
    • Line 38: warning: exported function Manifest should have comment or be unexported (golint)
    • Line 60: warning: exported function App should have comment or be unexported (golint)
    • mattermost-plugin-apps/apps/expand.go
    • Line 6: warning: exported type ExpandLevel should have comment or be unexported (golint)
    • Line 9: warning: exported const ExpandDefault should have comment (or a comment on this block) or be unexported (golint)
    • mattermost-plugin-apps/apps/locations.go
    • Line 10: warning: exported const LocationPostMenu should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type Location should have comment or be unexported (golint)
    • Line 18: warning: exported type Locations should have comment or be unexported (golint)
    • Line 20: warning: exported method Location.IsTop should have comment or be unexported (golint)
    • Line 30: warning: exported method Location.In should have comment or be unexported (golint)
    • Line 34: warning: exported method Location.Make should have comment or be unexported (golint)
    • Line 45: warning: exported method Location.Markdown should have comment or be unexported (golint)
    • mattermost-plugin-apps/apps/subscription.go
    • Line 11: warning: exported type Subject should have comment or be unexported (golint)
    • Line 25: warning: exported const SubjectUserLeftChannel should have comment (or a comment on this block) or be unexported (golint)
    • Line 66: warning: exported method Subscription.EqualScope should have comment or be unexported (golint)
    • Line 72: warning: exported method Subscription.ToJSON should have comment or be unexported (golint)
    • Line 77: warning: exported type SubscriptionResponse should have comment or be unexported (golint)
    • Line 82: warning: exported function SubscriptionResponseFromJSON should have comment or be unexported (golint)
    • Line 91: warning: exported method SubscriptionResponse.ToJSON should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/appservices/kv.go
    • Line 3: warning: exported method AppServices.KVSet should have comment or be unexported (golint)
    • Line 10: warning: exported method AppServices.KVGet should have comment or be unexported (golint)
    • Line 17: warning: exported method AppServices.KVDelete should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/appservices/service.go
    • Line 18: warning: exported var ErrNotABot should have comment or be unexported (golint)
    • Line 19: warning: exported var ErrIsABot should have comment or be unexported (golint)
    • Line 21: warning: exported type Service should have comment or be unexported (golint)
    • Line 42: warning: exported type AppServices should have comment or be unexported (golint)
    • Line 50: warning: exported function NewService should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/config/constants.go
    • Line 20: warning: comment on exported const InteractiveDialogPath should be of the form "InteractiveDialogPath ..." (golint)
    • Line 24: warning: comment on exported const HelloHTTPPath should be of the form "HelloHTTPPath ..." (golint)
    • Line 27: warning: comment on exported const PathCall should be of the form "PathCall ..." (golint)
    • Line 31: warning: comment on exported const PathApps should be of the form "PathApps ..." (golint)
    • Line 34: warning: comment on exported const PathMattermostOAuth2Connect should be of the form "PathMattermostOAuth2Connect ..." (golint)
    • Line 36: warning: exported const PathMattermostOAuth2Complete should have comment (or a comment on this block) or be unexported (golint)
    • Line 40: warning: comment on exported const PathStatic should be of the form "PathStatic ..." (golint)
    • Line 43: warning: comment on exported const PathMarketplace should be of the form "PathMarketplace ..." (golint)
    • Line 50: warning: exported const PropTeamID should have comment (or a comment on this block) or be unexported (golint)
    • mattermost-plugin-apps/apps/permissions.go
    • Line 8: warning: exported type Permissions should have comment or be unexported (golint)
    • Line 10: warning: exported type Permission should have comment or be unexported (golint)
    • Line 40: warning: exported method Permissions.Contains should have comment or be unexported (golint)
    • Line 70: warning: exported method Permissions.IsValid should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/utils/md/markdown.go
    • Line 12: warning: exported type MD should have comment or be unexported (golint)
    • Line 14: warning: exported const Nil should have comment or be unexported (golint)
    • Line 18: warning: exported type Markdowner should have comment or be unexported (golint)
    • Line 23: warning: exported method MD.Markdown should have comment or be unexported (golint)
    • Line 26: warning: exported function Markdownf should have comment or be unexported (golint)
    • Line 30: warning: exported function JSON should have comment or be unexported (golint)
    • Line 35: warning: exported function CodeBlock should have comment or be unexported (golint)
    • Line 39: warning: exported function JSONBlock should have comment or be unexported (golint)
    • Line 43: warning: exported function Indent should have comment or be unexported (golint)
    • Line 51: warning: exported function Bold should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/proxy/enable.go
    • Line 12: warning: comment on exported method Proxy.EnableApp should be of the form "EnableApp ..." (golint)
    • Line 46: warning: comment on exported method Proxy.DisableApp should be of the form "DisableApp ..." (golint)
    • Line 81: warning: exported method Proxy.AppIsEnabled should have comment or be unexported (golint)
    • mattermost-plugin-apps/apps/aws.go
    • Line 14: warning: exported const AWSMaxLambdaName should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: comment on exported const AWSS3BucketEnvVar should be of the form "AWSS3BucketEnvVar ..." (golint)
    • Line 20: warning: comment on exported const AWSDefaultS3Bucket should be of the form "AWSDefaultS3Bucket ..." (golint)
    • Line 43: warning: exported method AWSLambdaFunction.IsValid should have comment or be unexported (golint)
    • Line 89: warning: comment on exported function AssetS3Name should be of the form "AssetS3Name ..." (golint)
    • Line 96: warning: exported function S3BucketNameWithDefaults should have comment or be unexported (golint)
    • mattermost-plugin-apps/apps/field.go
    • Line 3: warning: exported type FieldType should have comment or be unexported (golint)
    • Line 4: warning: exported type TextFieldSubtype should have comment or be unexported (golint)
    • Line 7: warning: comment on exported const FieldTypeText should be of the form "FieldTypeText ..." (golint)
    • Line 11: warning: comment on exported const FieldTypeStaticSelect should be of the form "FieldTypeStaticSelect ..." (golint)
    • Line 14: warning: comment on exported const FieldTypeDynamicSelect should be of the form "FieldTypeDynamicSelect ..." (golint)
    • Line 18: warning: comment on exported const FieldTypeBool should be of the form "FieldTypeBool ..." (golint)
    • Line 21: warning: comment on exported const FieldTypeUser should be of the form "FieldTypeUser ..." (golint)
    • Line 24: warning: comment on exported const FieldTypeChannel should be of the form "FieldTypeChannel ..." (golint)
    • Line 27: warning: exported const TextFieldSubtypeInput should have comment (or a comment on this block) or be unexported (golint)
    • Line 36: warning: exported type SelectOption should have comment or be unexported (golint)
    • Line 44: warning: exported type Field should have comment or be unexported (golint)
    • mattermost-plugin-apps/server/utils/utils.go
    • Line 13: warning: exported function ToJSON should have comment or be unexported (golint)
    • Line 41: warning: exported function EnsureSysAdmin should have comment or be unexported (golint)
    • Line 48: warning: exported function LoadSession should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!