Preparing report...

Report for github.com/checkr/openmock

A+    Excellent!    Found 15 issues across 35 files

Tweet

gofmt94%

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!


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.

    • openmock/load.go
    • Line 210: warning: cyclomatic complexity 17 of function (*Mock).loadFile() is high (> 15) (gocyclo)
    • Line 72: warning: cyclomatic complexity 17 of function (*OpenMock).populateBehaviors() is high (> 15) (gocyclo)

golint57%

Golint is a linter for Go source code.

    • openmock/pkg/evaluator/evaluate_test.go
    • Line 22: warning: don't use underscores in Go names; var kafka_payload should be kafkaPayload (golint)
    • Line 43: warning: don't use underscores in Go names; var expected_kafka_action should be expectedKafkaAction (golint)
    • Line 49: warning: don't use underscores in Go names; var expected_reply_http_action should be expectedReplyHTTPAction (golint)
    • Line 60: warning: don't use underscores in Go names; var expected_actions should be expectedActions (golint)
    • Line 64: warning: don't use underscores in Go names; var actual_actions should be actualActions (golint)
    • Line 84: warning: don't use underscores in Go names; var empty_context should be emptyContext (golint)
    • Line 122: warning: don't use underscores in Go names; var empty_context should be emptyContext (golint)
    • Line 127: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 133: warning: don't use underscores in Go names; var empty_context should be emptyContext (golint)
    • Line 135: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 141: warning: don't use underscores in Go names; var eval_context should be evalContext (golint)
    • Line 152: warning: don't use underscores in Go names; var http_context should be httpContext (golint)
    • Line 156: warning: don't use underscores in Go names; var http_om_context should be httpOmContext (golint)
    • Line 163: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 169: warning: don't use underscores in Go names; var eval_context should be evalContext (golint)
    • Line 174: warning: don't use underscores in Go names; var kafka_context should be kafkaContext (golint)
    • Line 178: warning: don't use underscores in Go names; var kafka_om_context should be kafkaOmContext (golint)
    • Line 185: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 191: warning: don't use underscores in Go names; var http_eval_context should be httpEvalContext (golint)
    • Line 202: warning: don't use underscores in Go names; var http_om_context should be httpOmContext (golint)
    • Line 209: warning: don't use underscores in Go names; var kafka_eval_context should be kafkaEvalContext (golint)
    • Line 214: warning: don't use underscores in Go names; var kafka_om_context should be kafkaOmContext (golint)
    • Line 221: warning: don't use underscores in Go names; var expected_result should be expectedResult (golint)
    • Line 228: warning: don't use underscores in Go names; var eval_context should be evalContext (golint)
    • Line 233: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 266: warning: don't use underscores in Go names; var condition_rendered should be conditionRendered (golint)
    • Line 271: warning: don't use underscores in Go names; var expected_result should be expectedResult (golint)
    • Line 278: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 288: warning: don't use underscores in Go names; var expected_err should be expectedErr (golint)
    • Line 293: warning: don't use underscores in Go names; var expected_result should be expectedResult (golint)
    • Line 300: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 300: warning: don't use underscores in Go names; var actual_err should be actualErr (golint)
    • Line 306: warning: don't use underscores in Go names; var condition_rendered should be conditionRendered (golint)
    • Line 311: warning: don't use underscores in Go names; var expected_result should be expectedResult (golint)
    • Line 318: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 318: warning: don't use underscores in Go names; var actual_err should be actualErr (golint)
    • Line 325: warning: don't use underscores in Go names; var expected_result should be expectedResult (golint)
    • Line 329: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • openmock/load.go
    • Line 22: warning: exported method OpenMock.RedisTemplatesStore should have comment or be unexported (golint)
    • openmock/handle_actions.go
    • Line 12: warning: exported method MocksArray.DoActions should have comment or be unexported (golint)
    • Line 20: warning: exported method Mock.DoActions should have comment or be unexported (golint)
    • Line 41: warning: exported method ActionSendHTTP.Perform should have comment or be unexported (golint)
    • Line 73: warning: exported method ActionReplyHTTP.Perform should have comment or be unexported (golint)
    • Line 116: warning: exported method ActionReplyGRPC.Perform should have comment or be unexported (golint)
    • Line 155: warning: exported method ActionRedis.Perform should have comment or be unexported (golint)
    • Line 165: warning: exported method ActionSleep.Perform should have comment or be unexported (golint)
    • Line 170: warning: exported method ActionPublishKafka.Perform should have comment or be unexported (golint)
    • Line 185: warning: exported method ActionPublishAMQP.Perform should have comment or be unexported (golint)
    • openmock/pkg/evaluator/kafka_test.go
    • Line 13: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 22: warning: don't use underscores in Go names; var eval_context should be evalContext (golint)
    • Line 27: warning: don't use underscores in Go names; var expected_result should be expectedResult (golint)
    • Line 31: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 38: warning: don't use underscores in Go names; var matching_topic should be matchingTopic (golint)
    • Line 39: warning: don't use underscores in Go names; var mismatching_topic should be mismatchingTopic (golint)
    • Line 41: warning: don't use underscores in Go names; var good_context should be goodContext (golint)
    • Line 45: warning: don't use underscores in Go names; var good_mock should be goodMock (golint)
    • Line 53: warning: don't use underscores in Go names; var empty_context should be emptyContext (golint)
    • Line 54: warning: don't use underscores in Go names; var empty_mock should be emptyMock (golint)
    • Line 73: warning: don't use underscores in Go names; var mismatching_context should be mismatchingContext (golint)
    • openmock/pkg/admin/crud.go
    • Line 25: warning: exported type CRUD should have comment or be unexported (golint)
    • Line 40: warning: exported function NewCRUD should have comment or be unexported (golint)
    • openmock/model.go
    • Line 13: warning: exported const KindBehavior should have comment (or a comment on this block) or be unexported (golint)
    • Line 139: warning: comment on exported type ActionDispatcher should be of the form "ActionDispatcher ..." (with optional leading article) (golint)
    • Line 151: warning: exported type Action should have comment or be unexported (golint)
    • Line 202: warning: exported method MockRepo.AsArray should have comment or be unexported (golint)
    • Line 238: warning: exported var GetActualAction should have comment or be unexported (golint)
    • openmock/pkg/evaluator/http.go
    • Line 23: warning: don't use underscores in Go names; var output_headers should be outputHeaders (golint)
    • Line 33: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 41: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 47: warning: don't use underscores in Go names; var body_len should be bodyLen (golint)
    • Line 66: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 70: warning: don't use underscores in Go names; var v_string should be vString (golint)
    • Line 95: warning: don't use underscores in Go names; var methods_match should be methodsMatch (golint)
    • Line 101: warning: don't use underscores in Go names; var paths_match should be pathsMatch (golint)
    • openmock/pkg/evaluator/http_test.go
    • Line 14: warning: don't use underscores in Go names; var mock_action should be mockAction (golint)
    • Line 22: warning: don't use underscores in Go names; var eval_context should be evalContext (golint)
    • Line 26: warning: don't use underscores in Go names; var expected_result should be expectedResult (golint)
    • Line 36: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 44: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 53: warning: don't use underscores in Go names; var query_string should be queryString (golint)
    • Line 55: warning: don't use underscores in Go names; var eval_context should be evalContext (golint)
    • Line 66: warning: don't use underscores in Go names; var expected_result should be expectedResult (golint)
    • Line 75: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • Line 82: warning: don't use underscores in Go names; var matching_method should be matchingMethod (golint)
    • Line 83: warning: don't use underscores in Go names; var mismatching_method should be mismatchingMethod (golint)
    • Line 84: warning: don't use underscores in Go names; var matching_path should be matchingPath (golint)
    • Line 85: warning: don't use underscores in Go names; var mismatching_path should be mismatchingPath (golint)
    • Line 87: warning: don't use underscores in Go names; var good_context should be goodContext (golint)
    • Line 92: warning: don't use underscores in Go names; var empty_context should be emptyContext (golint)
    • Line 94: warning: don't use underscores in Go names; var good_mock should be goodMock (golint)
    • Line 103: warning: don't use underscores in Go names; var empty_mock should be emptyMock (golint)
    • Line 122: warning: don't use underscores in Go names; var mismatching_method_context should be mismatchingMethodContext (golint)
    • Line 131: warning: don't use underscores in Go names; var mismatching_path_context should be mismatchingPathContext (golint)
    • Line 144: warning: don't use underscores in Go names; var complicated_mock should be complicatedMock (golint)
    • Line 154: warning: don't use underscores in Go names; var non_matching_context should be nonMatchingContext (golint)
    • Line 162: warning: don't use underscores in Go names; var matching_context should be matchingContext (golint)
    • openmock/template_test.go
    • Line 14: warning: don't use underscores in Go names; var orig_context should be origContext (golint)
    • Line 18: warning: don't use underscores in Go names; var merge_context should be mergeContext (golint)
    • Line 22: warning: don't use underscores in Go names; var expected_result should be expectedResult (golint)
    • Line 28: warning: don't use underscores in Go names; var actual_result should be actualResult (golint)
    • openmock/pkg/evaluator/evaluate.go
    • Line 14: warning: exported var Evaluate should have comment or be unexported (golint)
    • Line 15: warning: don't use underscores in Go names; var actions_performed should be actionsPerformed (golint)
    • Line 18: warning: don't use underscores in Go names; var expect_passed should be expectPassed (golint)
    • Line 27: warning: don't use underscores in Go names; var om_context should be omContext (golint)
    • Line 40: warning: don't use underscores in Go names; var condition_passed should be conditionPassed (golint)
    • Line 40: warning: don't use underscores in Go names; var condition_rendered should be conditionRendered (golint)
    • Line 89: warning: don't use underscores in Go names; var render_result should be renderResult (golint)
    • Line 105: warning: don't use underscores in Go names; var http_context should be httpContext (golint)
    • Line 113: warning: don't use underscores in Go names; var kafka_context should be kafkaContext (golint)
    • Line 125: warning: don't use underscores in Go names; var ordered_actions should be orderedActions (golint)
    • Line 131: warning: don't use underscores in Go names; var output_actions should be outputActions (golint)
    • Line 132: warning: don't use underscores in Go names; range var om_action should be omAction (golint)
    • Line 133: warning: don't use underscores in Go names; var actual_action should be actualAction (golint)
    • Line 135: warning: don't use underscores in Go names; var reply_http_action should be replyHTTPAction (golint)
    • Line 136: warning: don't use underscores in Go names; var output_action should be outputAction (golint)
    • Line 141: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 145: warning: don't use underscores in Go names; var publish_kafka_action should be publishKafkaAction (golint)
    • Line 146: warning: don't use underscores in Go names; var output_action should be outputAction (golint)
    • Line 151: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • openmock/openmock.go
    • Line 62: warning: exported method OpenMock.ToYAML should have comment or be unexported (golint)
    • Line 66: warning: exported method OpenMock.ToArray should have comment or be unexported (golint)
    • Line 78: warning: exported method OpenMock.SetupLogrus should have comment or be unexported (golint)
    • Line 87: warning: exported method OpenMock.SetupRepo should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!