Preparing report...

Report for github.com/datreeio/datree

A    Great!    Found 36 issues across 43 files

Tweet

gofmt90%

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.


golint20%

Golint is a linter for Go source code.

    • datree/cmd/version/main.go
    • Line 10: warning: exported type Messager should have comment or be unexported (golint)
    • Line 14: warning: exported type Printer should have comment or be unexported (golint)
    • Line 17: warning: exported type VersionCommandContext should have comment or be unexported (golint)
    • Line 33: warning: exported function New should have comment or be unexported (golint)
    • datree/pkg/printer/theme.go
    • Line 10: warning: exported type Theme should have comment or be unexported (golint)
    • Line 65: warning: exported function CreateSimpleTheme should have comment or be unexported (golint)
    • datree/pkg/extractor/extractor.go
    • Line 11: warning: exported type FileReader should have comment or be unexported (golint)
    • Line 15: warning: exported type Configuration should have comment or be unexported (golint)
    • Line 17: warning: exported type FileConfigurations should have comment or be unexported (golint)
    • Line 22: warning: exported function ParseYaml should have comment or be unexported (golint)
    • Line 26: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 56: warning: exported function ReadFileContent should have comment or be unexported (golint)
    • datree/bl/files/files_test.go
    • Line 35: warning: don't use underscores in Go names; func test_existed_file should be testExistedFile (golint)
    • Line 50: warning: don't use underscores in Go names; func test_not_existed_file should be testNotExistedFile (golint)
    • Line 64: warning: don't use underscores in Go names; func test_directory_file should be testDirectoryFile (golint)
    • datree/bl/validation/k8sValidator_test.go
    • Line 28: warning: don't use underscores in Go names; func test_valid_multiple_configurations should be testValidMultipleConfigurations (golint)
    • Line 52: warning: don't use underscores in Go names; func test_invalid_file should be testInvalidFile (golint)
    • datree/pkg/fileReader/reader_test.go
    • Line 1: warning: don't use MixedCaps in package name; fileReader should be filereader (golint)
    • Line 171: warning: don't use underscores in Go names; func getFilesPaths_noMatchesTestCase should be getFilesPathsNoMatchesTestCase (golint)
    • Line 246: warning: receiver name c should be consistent with previous receiver name mfi for MockFileInfo (golint)
    • Line 251: warning: don't use underscores in Go names; func getFilesPaths_withMatchesTestCase should be getFilesPathsWithMatchesTestCase (golint)
    • datree/bl/validation/k8sValidator.go
    • Line 12: warning: exported type ValidationClient should have comment or be unexported (golint)
    • Line 16: warning: exported type K8sValidator should have comment or be unexported (golint)
    • Line 20: warning: exported function New should have comment or be unexported (golint)
    • Line 24: warning: exported type InvalidFile should have comment or be unexported (golint)
    • Line 28: warning: exported type InvalidYamlFile should have comment or be unexported (golint)
    • Line 30: warning: exported type InvalidK8sFile should have comment or be unexported (golint)
    • Line 32: warning: exported method K8sValidator.InitClient should have comment or be unexported (golint)
    • Line 36: warning: exported method K8sValidator.ValidateResources should have comment or be unexported (golint)
    • datree/pkg/fileReader/reader.go
    • Line 1: warning: don't use MixedCaps in package name; fileReader should be filereader (golint)
    • Line 11: warning: exported type ReadFileFn should have comment or be unexported (golint)
    • Line 12: warning: exported type GlobFn should have comment or be unexported (golint)
    • Line 13: warning: exported type StatFn should have comment or be unexported (golint)
    • Line 14: warning: exported type AbsFn should have comment or be unexported (golint)
    • Line 16: warning: exported type FileReader should have comment or be unexported (golint)
    • Line 23: warning: exported type FileReaderOptions should have comment or be unexported (golint)
    • Line 30: warning: exported function CreateFileReader should have comment or be unexported (golint)
    • Line 59: warning: exported method FileReader.FilterFiles should have comment or be unexported (golint)
    • Line 76: warning: exported method FileReader.ReadFileContent should have comment or be unexported (golint)
    • datree/cmd/test/main.go
    • Line 23: warning: exported type Evaluator should have comment or be unexported (golint)
    • Line 30: warning: exported type Messager should have comment or be unexported (golint)
    • Line 34: warning: exported type K8sValidator should have comment or be unexported (golint)
    • Line 39: warning: exported type TestCommandFlags should have comment or be unexported (golint)
    • Line 46: warning: exported type EvaluationPrinter should have comment or be unexported (golint)
    • Line 54: warning: exported type Reader should have comment or be unexported (golint)
    • Line 58: warning: exported type LocalConfig should have comment or be unexported (golint)
    • Line 62: warning: exported type TestCommandContext should have comment or be unexported (golint)
    • Line 72: warning: exported function New should have comment or be unexported (golint)
    • datree/cmd/test/main_test.go
    • Line 176: warning: don't use underscores in Go names; func test_testCommand_no_flags should be testTestCommandNoFlags (golint)
    • Line 183: warning: don't use underscores in Go names; func test_testCommand_json_output should be testTestCommandJSONOutput (golint)
    • Line 189: warning: don't use underscores in Go names; func test_testCommand_yaml_output should be testTestCommandYamlOutput (golint)
    • Line 195: warning: don't use underscores in Go names; func test_testCommand_xml_output should be testTestCommandXMLOutput (golint)
    • datree/bl/evaluation/printer_test.go
    • Line 21: warning: receiver name c should be consistent with previous receiver name m for mockPrinter (golint)
    • Line 25: warning: receiver name c should be consistent with previous receiver name m for mockPrinter (golint)
    • Line 74: warning: don't use underscores in Go names; func print_resultst should be printResultst (golint)
    • datree/pkg/cliClient/evaluation.go
    • Line 1: warning: don't use MixedCaps in package name; cliClient should be cliclient (golint)
    • Line 10: warning: exported type Metadata should have comment or be unexported (golint)
    • Line 17: warning: exported type CreateEvaluationRequest should have comment or be unexported (golint)
    • Line 24: warning: exported type CreateEvaluationResponse should have comment or be unexported (golint)
    • Line 31: warning: exported method CliClient.CreateEvaluation should have comment or be unexported (golint)
    • Line 46: warning: exported type Match should have comment or be unexported (golint)
    • Line 54: warning: exported type EvaluationResult should have comment or be unexported (golint)
    • Line 68: warning: exported type EvaluationResponse should have comment or be unexported (golint)
    • Line 73: warning: exported type EvaluationRequest should have comment or be unexported (golint)
    • Line 78: warning: exported method CliClient.RequestEvaluation should have comment or be unexported (golint)
    • Line 93: warning: exported type UpdateEvaluationValidationRequest should have comment or be unexported (golint)
    • Line 99: warning: exported method CliClient.SendFailedYamlValidation should have comment or be unexported (golint)
    • Line 108: warning: exported method CliClient.SendFailedK8sValidation should have comment or be unexported (golint)
    • datree/pkg/cliClient/cliClient.go
    • Line 1: warning: don't use MixedCaps in package name; cliClient should be cliclient (golint)
    • Line 7: warning: exported type HTTPClient should have comment or be unexported (golint)
    • Line 10: warning: exported type CliClient should have comment or be unexported (golint)
    • Line 16: warning: exported function NewCliClient should have comment or be unexported (golint)
    • datree/pkg/deploymentConfig/default.go
    • Line 5: warning: don't use MixedCaps in package name; deploymentConfig should be deploymentconfig (golint)
    • Line 8: warning: exported const URL should have comment (or a comment on this block) or be unexported (golint)
    • datree/cmd/config/main.go
    • Line 9: warning: exported type Messager should have comment or be unexported (golint)
    • Line 13: warning: exported type Printer should have comment or be unexported (golint)
    • Line 17: warning: exported type LocalConfig should have comment or be unexported (golint)
    • Line 22: warning: exported type ConfigCommandContext should have comment or be unexported (golint)
    • Line 29: warning: exported function New should have comment or be unexported (golint)
    • datree/pkg/localConfig/localConfig.go
    • Line 1: warning: don't use MixedCaps in package name; localConfig should be localconfig (golint)
    • Line 12: warning: exported type ConfigContent should have comment or be unexported (golint)
    • Line 16: warning: exported type LocalConfig should have comment or be unexported (golint)
    • Line 19: warning: exported function NewLocalConfig should have comment or be unexported (golint)
    • Line 23: warning: exported method LocalConfig.GetLocalConfiguration should have comment or be unexported (golint)
    • Line 61: warning: exported method LocalConfig.Set should have comment or be unexported (golint)
    • datree/bl/files/files.go
    • Line 15: warning: exported type UnknownStruct should have comment or be unexported (golint)
    • Line 17: warning: exported function ToAbsolutePath should have comment or be unexported (golint)
    • Line 31: warning: exported function ExtractFilesConfigurations should have comment or be unexported (golint)
    • Line 68: warning: exported function ExtractYamlFileToUnknownStruct should have comment or be unexported (golint)
    • datree/bl/validation/main.go
    • Line 8: warning: exported type InvalidK8sSchemaError should have comment or be unexported (golint)
    • Line 23: warning: exported type InvalidYamlError should have comment or be unexported (golint)
    • datree/bl/evaluation/evaluator_test.go
    • Line 145: warning: don't use underscores in Go names; func request_evaluation_all_valid should be requestEvaluationAllValid (golint)
    • Line 209: warning: don't use underscores in Go names; func request_evaluation_all_invalid should be requestEvaluationAllInvalid (golint)
    • datree/cmd/publish/main.go
    • Line 12: warning: exported type Messager should have comment or be unexported (golint)
    • Line 16: warning: exported type Printer should have comment or be unexported (golint)
    • Line 20: warning: exported type LocalConfig should have comment or be unexported (golint)
    • Line 24: warning: exported type CliClient should have comment or be unexported (golint)
    • Line 28: warning: exported type PublishCommandContext should have comment or be unexported (golint)
    • Line 36: warning: exported function New should have comment or be unexported (golint)
    • Line 75: warning: exported type MessagesContext should have comment or be unexported (golint)
    • datree/pkg/cliClient/messages.go
    • Line 1: warning: don't use MixedCaps in package name; cliClient should be cliclient (golint)
    • Line 11: warning: exported type VersionMessage should have comment or be unexported (golint)
    • Line 17: warning: exported method CliClient.GetVersionMessage should have comment or be unexported (golint)
    • datree/bl/messager/messager.go
    • Line 7: warning: exported type MessagesClient should have comment or be unexported (golint)
    • Line 11: warning: exported type Messager should have comment or be unexported (golint)
    • Line 16: warning: exported function New should have comment or be unexported (golint)
    • Line 23: warning: exported type VersionMessage should have comment or be unexported (golint)
    • Line 29: warning: exported method Messager.LoadVersionMessages should have comment or be unexported (golint)
    • datree/bl/messager/messenger_test.go
    • Line 68: warning: don't use underscores in Go names; func load_message_success should be loadMessageSuccess (golint)
    • Line 93: warning: don't use underscores in Go names; func load_message_failed should be loadMessageFailed (golint)
    • datree/pkg/printer/printer.go
    • Line 13: warning: exported type Printer should have comment or be unexported (golint)
    • Line 17: warning: exported function CreateNewPrinter should have comment or be unexported (golint)
    • Line 24: warning: exported type FailedRule should have comment or be unexported (golint)
    • Line 31: warning: exported type OccurrenceDetails should have comment or be unexported (golint)
    • Line 36: warning: exported type InvalidYamlInfo should have comment or be unexported (golint)
    • Line 39: warning: exported type InvalidK8sInfo should have comment or be unexported (golint)
    • Line 43: warning: exported type Warning should have comment or be unexported (golint)
    • Line 50: warning: exported method Printer.SetTheme should have comment or be unexported (golint)
    • Line 82: warning: exported method Printer.PrintWarnings should have comment or be unexported (golint)
    • Line 125: warning: exported type SummaryItem should have comment or be unexported (golint)
    • Line 131: warning: exported type Summary should have comment or be unexported (golint)
    • Line 137: warning: exported type EvaluationSummary should have comment or be unexported (golint)
    • Line 146: warning: exported method Printer.PrintEvaluationSummary should have comment or be unexported (golint)
    • Line 158: warning: exported method Printer.PrintSummaryTable should have comment or be unexported (golint)
    • Line 209: warning: exported method Printer.PrintMessage should have comment or be unexported (golint)
    • Line 225: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • datree/bl/evaluation/printer.go
    • Line 18: warning: exported type Printer should have comment or be unexported (golint)
    • Line 24: warning: exported type FormattedOutput should have comment or be unexported (golint)
    • Line 31: warning: exported function PrintResults should have comment or be unexported (golint)
    • Line 191: warning: exported type OutputTitle should have comment or be unexported (golint)
    • Line 194: warning: exported const EvaluatedConfigurations should have comment (or a comment on this block) or be unexported (golint)
    • Line 246: warning: exported method FileNameRuleMapper.MarshalXML should have comment or be unexported (golint)
    • datree/bl/evaluation/rule.go
    • Line 3: warning: exported type Rule should have comment or be unexported (golint)
    • Line 10: warning: exported method Rule.GetCount should have comment or be unexported (golint)
    • Line 14: warning: exported type OccurrenceDetails should have comment or be unexported (golint)
    • datree/pkg/cliClient/cliClient_test.go
    • Line 1: warning: don't use MixedCaps in package name; cliClient should be cliclient (golint)
    • Line 265: warning: don't use underscores in Go names; func test_getVersionMessage_success should be testGetVersionMessageSuccess (golint)
    • Line 312: warning: don't use underscores in Go names; func test_requestEvaluation_success should be testRequestEvaluationSuccess (golint)
    • Line 365: warning: don't use underscores in Go names; func test_createEvaluation_success should be testCreateEvaluationSuccess (golint)
    • Line 440: warning: don't use underscores in Go names; func test_publishPolicies_success should be testPublishPoliciesSuccess (golint)
    • Line 491: warning: don't use underscores in Go names; func test_publishPolicies_schemaError should be testPublishPoliciesSchemaError (golint)
    • datree/cmd/root.go
    • Line 25: warning: exported var CliVersion should have comment or be unexported (golint)
    • Line 62: warning: exported function Execute should have comment or be unexported (golint)
    • datree/bl/evaluation/evaluator.go
    • Line 9: warning: exported type CLIClient should have comment or be unexported (golint)
    • Line 16: warning: exported type Evaluator should have comment or be unexported (golint)
    • Line 21: warning: exported function New should have comment or be unexported (golint)
    • Line 28: warning: exported type FileNameRuleMapper should have comment or be unexported (golint)
    • Line 30: warning: exported type EvaluationResults should have comment or be unexported (golint)
    • Line 39: warning: exported method Evaluator.CreateEvaluation should have comment or be unexported (golint)
    • Line 55: warning: exported method Evaluator.UpdateFailedYamlValidation should have comment or be unexported (golint)
    • Line 68: warning: exported method Evaluator.UpdateFailedK8sValidation should have comment or be unexported (golint)
    • Line 81: warning: exported method Evaluator.Evaluate should have comment or be unexported (golint)
    • datree/pkg/cliClient/publish.go
    • Line 1: warning: don't use MixedCaps in package name; cliClient should be cliclient (golint)
    • Line 8: warning: exported method CliClient.PublishPolicies should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!