Preparing report...

Report for github.com/intuit/foremast

A+    Excellent!    Found 17 issues across 57 files

Tweet

gofmt91%

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!


gocyclo94%

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.

    • foremast/foremast-barrelman/pkg/controller/Barrelman.go
    • Line 448: warning: cyclomatic complexity 36 of function (*Barrelman).checkRunningStatus() is high (> 15) (gocyclo)
    • Line 100: warning: cyclomatic complexity 28 of function (*Barrelman).getPodNames() is high (> 15) (gocyclo)
    • Line 233: warning: cyclomatic complexity 24 of function (*Barrelman).monitorNewDeployment() is high (> 15) (gocyclo)

golint75%

Golint is a linter for Go source code.

    • foremast/foremast-barrelman/pkg/client/analyst/analystclient.go
    • Line 15: warning: exported type Interface should have comment or be unexported (golint)
    • Line 20: warning: exported type Client should have comment or be unexported (golint)
    • Line 27: warning: exported type ApplicationHealthAnalyzeRequest should have comment or be unexported (golint)
    • Line 52: warning: exported type AnomalyInfo should have comment or be unexported (golint)
    • Line 57: warning: exported type ApplicationHealthAnalyzeResponse should have comment or be unexported (golint)
    • Line 106: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 115: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 127: warning: exported method Client.StartAnalyzing should have comment or be unexported (golint)
    • Line 195: warning: exported method Client.GetStatus should have comment or be unexported (golint)
    • foremast/foremast-trigger/pkg/foremasttrigger/metricsquery.go
    • Line 14: warning: exported const CategoryCurrent should have comment or be unexported (golint)
    • Line 15: warning: exported const CategoryBaseline should have comment or be unexported (golint)
    • Line 16: warning: exported const CategoryHistorical should have comment or be unexported (golint)
    • Line 17: warning: exported const StrategyRollingUpdate should have comment or be unexported (golint)
    • Line 18: warning: exported const StrategyCanary should have comment or be unexported (golint)
    • Line 19: warning: exported const StrategyContinuous should have comment or be unexported (golint)
    • Line 91: warning: exported function CreateMetricsInfo should have comment or be unexported (golint)
    • Line 124: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 129: warning: exported type MetricsInfo should have comment or be unexported (golint)
    • Line 137: warning: exported type MetricQuery should have comment or be unexported (golint)
    • foremast/foremast-barrelman/pkg/controller/Barrelman.go
    • Line 25: warning: exported const FOREMAST should have comment or be unexported (golint)
    • Line 27: warning: exported const MODE_HPA_ONLY should have comment or be unexported (golint)
    • Line 28: warning: exported const MODE_HPA_AND_HEALTHY_MONITORING should have comment or be unexported (golint)
    • Line 30: warning: comment on exported const HPA_STRATEGY_HPA_EXISTS should be of the form "HPA_STRATEGY_HPA_EXISTS ..." (golint)
    • Line 34: warning: comment on exported const HPA_STRATEGY_ANYWAY should be of the form "HPA_STRATEGY_ANYWAY ..." (golint)
    • Line 37: warning: exported const HPA_SCORE_TEMPLATE_DEFAULT should have comment or be unexported (golint)
    • Line 39: warning: comment on exported type Barrelman should be of the form "Barrelman ..." (with optional leading article) (golint)
    • Line 51: warning: exported function NewBarrelman should have comment or be unexported (golint)
    • Line 191: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • foremast/foremast-barrelman/pkg/controller/DeploymentController.go
    • Line 52: warning: exported const DeploymentName should have comment or be unexported (golint)
    • Line 54: warning: exported const Strategy should have comment or be unexported (golint)
    • Line 56: warning: exported const ForemastAnotation should have comment or be unexported (golint)
    • Line 58: warning: exported const CanarySuffic should have comment or be unexported (golint)
    • Line 125: warning: exported function EnvArrayEquals should have comment or be unexported (golint)
    • foremast/foremast-barrelman/pkg/controller/HpaController.go
    • Line 23: warning: exported const ForemastHPA should have comment or be unexported (golint)
    • Line 25: warning: comment on exported type HpaController should be of the form "HpaController ..." (with optional leading article) (golint)
    • Line 60: warning: comment on exported function NewHpaController should be of the form "NewHpaController ..." (golint)
    • Line 167: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • foremast/foremast-barrelman/pkg/client/metrics/metricsquery.go
    • Line 14: warning: exported const CategoryCurrent should have comment or be unexported (golint)
    • Line 15: warning: exported const CategoryBaseline should have comment or be unexported (golint)
    • Line 16: warning: exported const CategoryHistorical should have comment or be unexported (golint)
    • Line 17: warning: exported const StrategyRollingUpdate should have comment or be unexported (golint)
    • Line 18: warning: exported const StrategyCanary should have comment or be unexported (golint)
    • Line 19: warning: exported const StrategyContinuous should have comment or be unexported (golint)
    • Line 20: warning: exported const StrategyHpa should have comment or be unexported (golint)
    • Line 112: warning: exported function CreateMetricsInfo should have comment or be unexported (golint)
    • Line 144: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 149: warning: exported function CreatePodCountURL should have comment or be unexported (golint)
    • Line 171: warning: exported type MetricsInfo should have comment or be unexported (golint)
    • Line 179: warning: exported type MetricQuery should have comment or be unexported (golint)
    • foremast/foremast-trigger/pkg/foremasttrigger/trigger.go
    • Line 23: warning: exported type JobRequest should have comment or be unexported (golint)
    • Line 27: warning: exported type JobInfo should have comment or be unexported (golint)
    • Line 35: warning: exported type JobInfoM should have comment or be unexported (golint)
    • Line 163: warning: comment on exported function GenerateReport should be of the form "GenerateReport ..." (golint)
    • Line 173: warning: should omit 2nd value from range; this loop is equivalent to `for metricName := range ...` (golint)
    • Line 181: warning: comment on exported function GenerateSummaryReport should be of the form "GenerateSummaryReport ..." (golint)
    • Line 199: warning: should omit 2nd value from range; this loop is equivalent to `for metric := range ...` (golint)
    • Line 218: warning: comment on exported function ForemastQuery should be of the form "ForemastQuery ..." (golint)
    • Line 283: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 290: warning: exported function CreateDashboardURL should have comment or be unexported (golint)
    • Line 329: warning: comment on exported function MonitorService should be of the form "MonitorService ..." (golint)
    • foremast/foremast-trigger/pkg/foremasttrigger/types.go
    • Line 49: warning: exported type Analyst should have comment or be unexported (golint)
    • Line 56: warning: comment on exported type Descriptor should be of the form "Descriptor ..." (with optional leading article) (golint)
    • Line 139: warning: exported type Monitoring should have comment or be unexported (golint)
    • Line 149: warning: exported type Logs should have comment or be unexported (golint)
    • Line 193: warning: exported type DeploymentMonitorSpec should have comment or be unexported (golint)
    • Line 271: warning: comment on exported type RemediationAction should be of the form "RemediationAction ..." (with optional leading article) (golint)
    • Line 284: warning: exported type AnomalousMetric should have comment or be unexported (golint)
    • Line 292: warning: exported type AnomalousMetricValue should have comment or be unexported (golint)
    • foremast/foremast-barrelman/pkg/controller/MonitorController.go
    • Line 1: warning: package comment should be of the form "Package controller ..." (golint)
    • Line 36: warning: exported const MonitorControllerName should have comment or be unexported (golint)
    • Line 38: warning: exported type MonitorController should have comment or be unexported (golint)
    • Line 162: warning: comment on exported type RemediationOptions should be of the form "RemediationOptions ..." (with optional leading article) (golint)
    • Line 176: warning: exported const AnnotationDeploymentRollbackMessage should have comment or be unexported (golint)
    • foremast/foremast-barrelman/pkg/apis/deployment/v1alpha1/types.go
    • Line 50: warning: comment on exported type HpaScoreTemplate should be of the form "HpaScoreTemplate ..." (with optional leading article) (golint)
    • Line 71: warning: exported type Analyst should have comment or be unexported (golint)
    • Line 78: warning: comment on exported type Descriptor should be of the form "Descriptor ..." (with optional leading article) (golint)
    • Line 161: warning: exported type Monitoring should have comment or be unexported (golint)
    • Line 174: warning: exported type Logs should have comment or be unexported (golint)
    • Line 218: warning: exported type DeploymentMonitorSpec should have comment or be unexported (golint)
    • Line 330: warning: comment on exported type RemediationAction should be of the form "RemediationAction ..." (with optional leading article) (golint)
    • Line 343: warning: exported type AnomalousMetric should have comment or be unexported (golint)
    • Line 351: warning: exported type AnomalousMetricValue should have comment or be unexported (golint)
    • foremast/foremast-trigger/pkg/foremasttrigger/analystclient.go
    • Line 14: warning: exported type Interface should have comment or be unexported (golint)
    • Line 19: warning: exported type Client should have comment or be unexported (golint)
    • Line 26: warning: exported type ApplicationHealthAnalyzeRequest should have comment or be unexported (golint)
    • Line 45: warning: exported type AnomalyInfo should have comment or be unexported (golint)
    • Line 50: warning: exported type ApplicationHealthAnalyzeResponse should have comment or be unexported (golint)
    • Line 62: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 71: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 83: warning: exported method Client.StartAnalyzing should have comment or be unexported (golint)
    • Line 161: warning: exported method Client.GetStatus should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell92%

Misspell Finds commonly misspelled English words