Preparing report...

Report for github.com/openinx/huker

A    Great!    Found 29 issues across 41 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!


gocyclo80%

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.


golint39%

Golint is a linter for Go source code.

    • huker/pkg/pkgsrv/pkgsrv.go
    • Line 88: warning: comment on exported type PackageServer should be of the form "PackageServer ..." (with optional leading article) (golint)
    • Line 98: warning: comment on exported function NewPackageServer should be of the form "NewPackageServer ..." (golint)
    • huker/pkg/core/job.go
    • Line 15: warning: exported const DEFAULT_SUPERVISOR_PORT should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported type MainEntry should have comment or be unexported (golint)
    • Line 60: warning: exported type Host should have comment or be unexported (golint)
    • Line 68: warning: exported function NewHost should have comment or be unexported (golint)
    • Line 123: warning: exported method Host.ToHttpAddress should have comment or be unexported (golint)
    • Line 127: warning: exported method Host.ToKey should have comment or be unexported (golint)
    • Line 142: warning: exported type Job should have comment or be unexported (golint)
    • Line 154: warning: exported function NewJob should have comment or be unexported (golint)
    • Line 188: 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 307: warning: exported method Job.GetHost should have comment or be unexported (golint)
    • Line 330: 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 333: 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 341: warning: exported function ParseStringArray should have comment or be unexported (golint)
    • Line 379: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • huker/pkg/supervisor/prog.go
    • Line 59: warning: comment on exported method Program.UpdatePackage should be of the form "UpdatePackage ..." (golint)
    • Line 121: warning: exported method Program.DumpConfigFiles should have comment or be unexported (golint)
    • Line 134: warning: comment on exported method Program.RenderVars should be of the form "RenderVars ..." (golint)
    • Line 264: warning: comment on exported method Program.ExecHooks should be of the form "ExecHooks ..." (golint)
    • huker/pkg/supervisor/supercli.go
    • Line 12: warning: exported type SupervisorCli should have comment or be unexported (golint)
    • Line 16: warning: exported function NewSupervisorCli should have comment or be unexported (golint)
    • Line 58: warning: exported method SupervisorCli.Bootstrap should have comment or be unexported (golint)
    • Line 68: warning: exported method SupervisorCli.Show should have comment or be unexported (golint)
    • Line 81: warning: exported method SupervisorCli.Start should have comment or be unexported (golint)
    • Line 87: warning: exported method SupervisorCli.Cleanup should have comment or be unexported (golint)
    • Line 93: warning: exported method SupervisorCli.RollingUpdate should have comment or be unexported (golint)
    • Line 103: warning: exported method SupervisorCli.Restart should have comment or be unexported (golint)
    • Line 109: warning: exported method SupervisorCli.Stop should have comment or be unexported (golint)
    • Line 115: warning: exported method SupervisorCli.ListTasks should have comment or be unexported (golint)
    • Line 136: warning: exported method SupervisorCli.GetTask should have comment or be unexported (golint)
    • huker/pkg/metrics/thirdparts/hbase.go
    • Line 12: warning: exported type HBaseMetricFetcher should have comment or be unexported (golint)
    • Line 20: warning: exported function NewHBaseMetricFetcher should have comment or be unexported (golint)
    • Line 44: warning: exported method HBaseMetricFetcher.Pull should have comment or be unexported (golint)
    • huker/pkg/metrics/thirdparts/hdfs.go
    • Line 10: warning: exported type HDFSMetricFetcher should have comment or be unexported (golint)
    • Line 18: warning: exported function NewHDFSMetricFetcher should have comment or be unexported (golint)
    • Line 40: warning: exported method HDFSMetricFetcher.Pull should have comment or be unexported (golint)
    • Line 81: 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)
    • huker/pkg/metrics/thirdparts/zookeeper.go
    • Line 11: warning: exported type ZookeeperMetricFetcher should have comment or be unexported (golint)
    • Line 17: warning: exported function NewZookeeperMetricFetcher should have comment or be unexported (golint)
    • Line 33: warning: exported method ZookeeperMetricFetcher.Pull should have comment or be unexported (golint)
    • Line 46: 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)
    • huker/pkg/dashboard/dashboard.go
    • Line 20: warning: exported type Dashboard should have comment or be unexported (golint)
    • Line 31: warning: exported function NewDashboard should have comment or be unexported (golint)
    • Line 51: warning: exported type HandleFunc should have comment or be unexported (golint)
    • Line 182: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 290: warning: receiver name s should be consistent with previous receiver name d for Dashboard (golint)
    • Line 319: warning: receiver name s should be consistent with previous receiver name d for Dashboard (golint)
    • Line 355: warning: receiver name s should be consistent with previous receiver name d for Dashboard (golint)
    • huker/pkg/metrics/collector.go
    • Line 18: warning: exported type MetricFetcher should have comment or be unexported (golint)
    • Line 22: warning: exported type Collector should have comment or be unexported (golint)
    • Line 59: warning: exported function NewCollector should have comment or be unexported (golint)
    • Line 241: warning: exported method Collector.Start should have comment or be unexported (golint)
    • huker/pkg/core/re.go
    • Line 295: warning: comment on exported function GlobalRender should be of the form "GlobalRender ..." (golint)
    • Line 310: warning: comment on exported function HostRender should be of the form "HostRender ..." (golint)
    • huker/pkg/supervisor/supervisor.go
    • Line 46: warning: exported method Supervisor.RootDir should have comment or be unexported (golint)
    • Line 264: 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 343: warning: comment on exported function NewSupervisor should be of the form "NewSupervisor ..." (golint)
    • huker/pkg/configparser.go
    • Line 12: warning: comment on exported const HukerPkgSrvHttpAddress should be of the form "HukerPkgSrvHttpAddress ..." (golint)
    • Line 15: warning: comment on exported const HukerDashboardHttpAddress should be of the form "HukerDashboardHttpAddress ..." (golint)
    • Line 18: warning: comment on exported const HukerOpenTSDBHttpAddress should be of the form "HukerOpenTSDBHttpAddress ..." (golint)
    • Line 20: warning: exported const HukerGrafanaHttpAddress should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: comment on exported const HukerSupervisorPort should be of the form "HukerSupervisorPort ..." (golint)
    • Line 33: warning: exported type HukerConfig should have comment or be unexported (golint)
    • Line 38: warning: exported function NewHukerConfig should have comment or be unexported (golint)
    • Line 54: warning: exported method HukerConfig.GetInt should have comment or be unexported (golint)
    • Line 57: 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 62: warning: exported method HukerConfig.Get should have comment or be unexported (golint)
    • Line 65: 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 70: warning: exported method HukerConfig.GetURL should have comment or be unexported (golint)
    • Line 73: 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 82: warning: exported method HukerConfig.GetSlice should have comment or be unexported (golint)
    • huker/pkg/dashboard/deploy_agent.go
    • Line 11: warning: exported type DeployRequest should have comment or be unexported (golint)
    • Line 39: 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 53: 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 70: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • huker/pkg/metrics/grafana/syncer.go
    • Line 15: warning: exported type GrafanaSyncer should have comment or be unexported (golint)
    • Line 23: warning: exported function NewGrafanaSyncer should have comment or be unexported (golint)
    • Line 81: warning: exported method GrafanaSyncer.GetDashboard should have comment or be unexported (golint)
    • Line 85: warning: exported method GrafanaSyncer.CreateHostDashboard should have comment or be unexported (golint)
    • Line 152: warning: exported method GrafanaSyncer.CreateNodesDashboard should have comment or be unexported (golint)
    • Line 157: warning: exported method GrafanaSyncer.CreateJvmGcDashboard should have comment or be unexported (golint)
    • Line 181: warning: exported method GrafanaSyncer.CreateHDFSDashboard should have comment or be unexported (golint)
    • Line 216: warning: exported method GrafanaSyncer.CreateZookeeperDashboard should have comment or be unexported (golint)
    • Line 243: warning: exported method GrafanaSyncer.CreateHBaseDashboard should have comment or be unexported (golint)
    • huker/pkg/core/api.go
    • Line 21: warning: exported type TaskResult should have comment or be unexported (golint)
    • Line 27: warning: exported function NewTaskResult should have comment or be unexported (golint)
    • Line 31: warning: exported type HukerJob should have comment or be unexported (golint)
    • Line 45: warning: exported function NewDefaultHukerJob should have comment or be unexported (golint)
    • Line 55: warning: exported type ConfigFileHukerJob should have comment or be unexported (golint)
    • Line 60: warning: exported function NewConfigFileHukerJob should have comment or be unexported (golint)
    • Line 104: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 139: warning: exported method ConfigFileHukerJob.List should have comment or be unexported (golint)
    • Line 139: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 173: warning: exported method ConfigFileHukerJob.Install should have comment or be unexported (golint)
    • Line 173: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 178: warning: exported method ConfigFileHukerJob.Shell should have comment or be unexported (golint)
    • Line 178: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 207: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 224: warning: exported method ConfigFileHukerJob.Bootstrap should have comment or be unexported (golint)
    • Line 224: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 231: warning: exported method ConfigFileHukerJob.Show should have comment or be unexported (golint)
    • Line 231: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 235: warning: exported method ConfigFileHukerJob.Start should have comment or be unexported (golint)
    • Line 235: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 239: warning: exported method ConfigFileHukerJob.Stop should have comment or be unexported (golint)
    • Line 239: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 243: warning: exported method ConfigFileHukerJob.Restart should have comment or be unexported (golint)
    • Line 243: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 247: warning: exported method ConfigFileHukerJob.RollingUpdate should have comment or be unexported (golint)
    • Line 247: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 254: warning: exported method ConfigFileHukerJob.Cleanup should have comment or be unexported (golint)
    • Line 254: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 258: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • Line 291: warning: exported method ConfigFileHukerJob.ListHosts should have comment or be unexported (golint)
    • Line 291: warning: receiver name j should be consistent with previous receiver name cfg for ConfigFileHukerJob (golint)
    • huker/pkg/core/cfg.go
    • Line 10: warning: comment on exported type ConfigFile should be of the form "ConfigFile ..." (with optional leading article) (golint)
    • Line 18: warning: comment on exported type INIConfigFile should be of the form "INIConfigFile ..." (with optional leading article) (golint)
    • Line 24: warning: comment on exported function NewINIConfigFile should be of the form "NewINIConfigFile ..." (golint)
    • Line 48: warning: exported method INIConfigFile.ToString should have comment or be unexported (golint)
    • Line 52: warning: exported method INIConfigFile.ToKeyValue should have comment or be unexported (golint)
    • Line 64: warning: exported method INIConfigFile.GetConfigName should have comment or be unexported (golint)
    • Line 68: warning: comment on exported type XMLConfigFile should be of the form "XMLConfigFile ..." (with optional leading article) (golint)
    • Line 74: warning: comment on exported function NewXMLConfigFile should be of the form "NewXMLConfigFile ..." (golint)
    • Line 98: warning: exported method XMLConfigFile.ToString should have comment or be unexported (golint)
    • Line 114: warning: exported method XMLConfigFile.ToKeyValue should have comment or be unexported (golint)
    • Line 126: warning: exported method XMLConfigFile.GetConfigName should have comment or be unexported (golint)
    • Line 130: warning: comment on exported type PlainConfigFile should be of the form "PlainConfigFile ..." (with optional leading article) (golint)
    • Line 136: warning: comment on exported function NewPlainConfigFile should be of the form "NewPlainConfigFile ..." (golint)
    • Line 151: warning: exported method PlainConfigFile.ToString should have comment or be unexported (golint)
    • Line 159: warning: exported method PlainConfigFile.ToKeyValue should have comment or be unexported (golint)
    • Line 167: warning: exported method PlainConfigFile.GetConfigName should have comment or be unexported (golint)
    • Line 171: warning: comment on exported function ParseConfigFile should be of the form "ParseConfigFile ..." (golint)
    • huker/pkg/supervisor/metrics.go
    • Line 35: warning: exported function MarshalMetrics should have comment or be unexported (golint)
    • Line 41: 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 48: 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 55: 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 62: 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 69: 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 76: 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 83: 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 89: 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)
    • huker/pkg/supervisor/trash.go
    • Line 17: warning: exported type TrashCleaner should have comment or be unexported (golint)
    • Line 22: warning: exported function NewTrashCleaner should have comment or be unexported (golint)
    • Line 81: warning: exported method TrashCleaner.CheckAndClean should have comment or be unexported (golint)
    • huker/cmd/huker.go
    • Line 66: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • huker/pkg/metrics/thirdparts/node.go
    • Line 12: warning: exported type NodeMetricFetcher should have comment or be unexported (golint)
    • Line 17: warning: exported function NewNodeMetricFetcher should have comment or be unexported (golint)
    • Line 30: warning: exported method NodeMetricFetcher.Pull should have comment or be unexported (golint)
    • Line 150: 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)
    • huker/pkg/minihuker/mini.go
    • Line 22: warning: exported type MiniHuker should have comment or be unexported (golint)
    • Line 35: warning: exported function NewMiniHuker should have comment or be unexported (golint)
    • Line 85: warning: exported function NewTestingMiniHuker should have comment or be unexported (golint)
    • Line 98: warning: exported method MiniHuker.Start should have comment or be unexported (golint)
    • Line 130: warning: exported method MiniHuker.Wait should have comment or be unexported (golint)
    • Line 134: warning: exported method MiniHuker.Stop should have comment or be unexported (golint)
    • huker/pkg/core/cluster.go
    • Line 32: warning: comment on exported function NewCluster should be of the form "NewCluster ..." (golint)
    • Line 104: 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 137: warning: comment on exported method Cluster.RenderConfigFiles should be of the form "RenderConfigFiles ..." (golint)
    • Line 138: warning: receiver name c should be consistent with previous receiver name s for Cluster (golint)
    • Line 168: warning: exported function LoadClusterConfig should have comment or be unexported (golint)
    • Line 171: 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 184: 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)
    • huker/pkg/core/env.go
    • Line 8: warning: comment on exported type EnvVariables should be of the form "EnvVariables ..." (with optional leading article) (golint)
    • Line 18: warning: exported const TML_NAME should have comment or be unexported (golint)
    • Line 20: warning: comment on exported method EnvVariables.RenderTemplate should be of the form "RenderTemplate ..." (golint)
    • huker/pkg/utils/utils.go
    • Line 25: warning: exported function IsProcessOK should have comment or be unexported (golint)
    • Line 39: warning: exported function CalcFileMD5Sum should have comment or be unexported (golint)
    • Line 52: warning: comment on exported function WebGetToLocal should be of the form "WebGetToLocal ..." (golint)
    • Line 76: warning: comment on exported function RunCommand should be of the form "RunCommand ..." (golint)
    • Line 94: warning: comment on exported function ReadEnvStrValue should be of the form "ReadEnvStrValue ..." (golint)
    • Line 103: warning: comment on exported function ReadEnvIntValue should be of the form "ReadEnvIntValue ..." (golint)
    • Line 111: 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 116: warning: comment on exported function StringSliceContains should be of the form "StringSliceContains ..." (golint)
    • Line 126: warning: comment on exported function IsStringType should be of the form "IsStringType ..." (golint)
    • Line 131: warning: comment on exported function IsIntegerType should be of the form "IsIntegerType ..." (golint)
    • Line 136: warning: comment on exported function IsMapType should be of the form "IsMapType ..." (golint)
    • Line 141: warning: comment on exported function IsSliceType should be of the form "IsSliceType ..." (golint)
    • Line 146: warning: comment on exported function IsArrayType should be of the form "IsArrayType ..." (golint)
    • Line 151: warning: comment on exported function MergeMap should be of the form "MergeMap ..." (golint)
    • Line 204: warning: comment on exported function LocalHukerDir should be of the form "LocalHukerDir ..." (golint)
    • Line 213: warning: exported function HttpGetJSON should have comment or be unexported (golint)
    • Line 230: warning: comment on exported function GetHukerDir should be of the form "GetHukerDir ..." (golint)
    • Line 240: warning: comment on exported function GetHukerSourceDir should be of the form "GetHukerSourceDir ..." (golint)
    • Line 249: warning: exported function RenderHTMLTemplate should have comment or be unexported (golint)
    • Line 291: warning: exported function FindJavaHome should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words