Preparing report...

Report for github.com/go-courier/validator

A+    Excellent!    Found 21 issues across 39 files

Tweet

gofmt97%

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!


gocyclo84%

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.

    • validator/float_validator.go
    • Line 230: warning: cyclomatic complexity 20 of function (FloatValidator).New() is high (> 15) (gocyclo)
    • Line 97: warning: cyclomatic complexity 18 of function (*FloatValidator).Validate() is high (> 15) (gocyclo)

golint48%

Golint is a linter for Go source code.

    • validator/utils.go
    • Line 11: warning: exported function MinInt should have comment or be unexported (golint)
    • Line 15: warning: exported function MaxInt should have comment or be unexported (golint)
    • Line 19: warning: exported function MaxUint should have comment or be unexported (golint)
    • Line 23: warning: exported function RangeFromUint should have comment or be unexported (golint)
    • Line 42: warning: exported function UintRange should have comment or be unexported (golint)
    • validator/errors/error_set.go
    • Line 9: warning: exported function NewErrorSet should have comment or be unexported (golint)
    • Line 16: warning: exported type ErrorSet should have comment or be unexported (golint)
    • Line 21: warning: exported method ErrorSet.AddErr should have comment or be unexported (golint)
    • Line 31: warning: exported method ErrorSet.Each should have comment or be unexported (golint)
    • Line 40: warning: exported method ErrorSet.Flatten should have comment or be unexported (golint)
    • Line 56: warning: exported method ErrorSet.Len should have comment or be unexported (golint)
    • Line 60: warning: exported method ErrorSet.Err should have comment or be unexported (golint)
    • Line 79: warning: exported type FieldError should have comment or be unexported (golint)
    • Line 84: warning: exported type KeyPath should have comment or be unexported (golint)
    • validator/int_validator.go
    • Line 17: warning: exported var TargetIntValue should have comment or be unexported (golint)
    • Line 20: warning: comment on exported type IntValidator should be of the form "IntValidator ..." (with optional leading article) (golint)
    • Line 77: warning: exported method IntValidator.Names should have comment or be unexported (golint)
    • Line 81: warning: exported method IntValidator.SetDefaults should have comment or be unexported (golint)
    • Line 103: warning: exported method IntValidator.Validate should have comment or be unexported (golint)
    • Line 159: warning: exported method IntValidator.New should have comment or be unexported (golint)
    • Line 234: warning: exported method IntValidator.TypeCheck should have comment or be unexported (golint)
    • validator/strfmt/strfmt_validators.go
    • Line 9: warning: exported var ASCIIValidator should have comment or be unexported (golint)
    • Line 13: warning: exported var AlphaValidator should have comment or be unexported (golint)
    • Line 17: warning: exported var AlphaNumericValidator should have comment or be unexported (golint)
    • Line 21: warning: exported var AlphaUnicodeValidator should have comment or be unexported (golint)
    • Line 27: warning: exported var AlphaUnicodeNumericValidator should have comment or be unexported (golint)
    • Line 31: warning: exported var Base64Validator should have comment or be unexported (golint)
    • Line 35: warning: exported var Base64URLValidator should have comment or be unexported (golint)
    • Line 39: warning: exported var BtcAddressValidator should have comment or be unexported (golint)
    • Line 43: warning: exported var BtcAddressLowerValidator should have comment or be unexported (golint)
    • Line 47: warning: exported var BtcAddressUpperValidator should have comment or be unexported (golint)
    • Line 51: warning: exported var DataURIValidator should have comment or be unexported (golint)
    • Line 55: warning: exported var EmailValidator should have comment or be unexported (golint)
    • Line 59: warning: exported var EthAddressValidator should have comment or be unexported (golint)
    • Line 63: warning: exported var EthAddressLowerValidator should have comment or be unexported (golint)
    • Line 67: warning: exported var EthAddressUpperValidator should have comment or be unexported (golint)
    • Line 71: warning: exported var HslValidator should have comment or be unexported (golint)
    • Line 75: warning: exported var HslaValidator should have comment or be unexported (golint)
    • Line 79: warning: exported var HexAdecimalValidator should have comment or be unexported (golint)
    • Line 83: warning: exported var HexColorValidator should have comment or be unexported (golint)
    • Line 87: warning: exported var HostnameValidator should have comment or be unexported (golint)
    • Line 91: warning: exported var HostnameXValidator should have comment or be unexported (golint)
    • Line 95: warning: exported var Isbn10Validator should have comment or be unexported (golint)
    • Line 99: warning: exported var Isbn13Validator should have comment or be unexported (golint)
    • Line 103: warning: exported var LatitudeValidator should have comment or be unexported (golint)
    • Line 107: warning: exported var LongitudeValidator should have comment or be unexported (golint)
    • Line 111: warning: exported var MultibyteValidator should have comment or be unexported (golint)
    • Line 115: warning: exported var NumberValidator should have comment or be unexported (golint)
    • Line 119: warning: exported var NumericValidator should have comment or be unexported (golint)
    • Line 123: warning: exported var PrintableASCIIValidator should have comment or be unexported (golint)
    • Line 127: warning: exported var RgbValidator should have comment or be unexported (golint)
    • Line 131: warning: exported var RgbaValidator should have comment or be unexported (golint)
    • Line 135: warning: exported var SsnValidator should have comment or be unexported (golint)
    • Line 139: warning: exported var UUIDValidator should have comment or be unexported (golint)
    • Line 143: warning: exported var Uuid3Validator should have comment or be unexported (golint)
    • Line 147: warning: exported var Uuid4Validator should have comment or be unexported (golint)
    • Line 151: warning: exported var Uuid5Validator should have comment or be unexported (golint)
    • validator/errors/validator_errors.go
    • Line 11: warning: exported type MissingRequiredFieldError should have comment or be unexported (golint)
    • Line 17: warning: exported type NotMatchError should have comment or be unexported (golint)
    • Line 27: warning: exported type MultipleOfError should have comment or be unexported (golint)
    • Line 41: warning: exported type NotInEnumError should have comment or be unexported (golint)
    • Line 64: warning: exported type OutOfRangeError should have comment or be unexported (golint)
    • validator/rules/utils.go
    • Line 9: warning: exported function Unslash should have comment or be unexported (golint)
    • Line 32: warning: exported function Slash should have comment or be unexported (golint)
    • Line 45: warning: exported function SingleQuote should have comment or be unexported (golint)
    • validator/float_validator.go
    • Line 18: warning: exported var TargetFloatValue should have comment or be unexported (golint)
    • Line 23: warning: comment on exported type FloatValidator should be of the form "FloatValidator ..." (with optional leading article) (golint)
    • Line 74: warning: exported method FloatValidator.SetDefaults should have comment or be unexported (golint)
    • Line 85: warning: exported method FloatValidator.Names should have comment or be unexported (golint)
    • Line 97: warning: exported method FloatValidator.Validate should have comment or be unexported (golint)
    • Line 230: warning: exported method FloatValidator.New should have comment or be unexported (golint)
    • Line 321: warning: exported method FloatValidator.TypeCheck should have comment or be unexported (golint)
    • validator/map_validator.go
    • Line 13: warning: exported var TargetMapLength should have comment or be unexported (golint)
    • Line 16: warning: comment on exported type MapValidator should be of the form "MapValidator ..." (with optional leading article) (golint)
    • Line 37: warning: exported method MapValidator.Names should have comment or be unexported (golint)
    • Line 41: warning: exported method MapValidator.Validate should have comment or be unexported (golint)
    • Line 50: warning: exported method MapValidator.ValidateReflectValue should have comment or be unexported (golint)
    • Line 95: warning: exported method MapValidator.New should have comment or be unexported (golint)
    • validator/slice_validator.go
    • Line 13: warning: exported var TargetSliceLength should have comment or be unexported (golint)
    • Line 16: warning: comment on exported type SliceValidator should be of the form "SliceValidator ..." (with optional leading article) (golint)
    • Line 39: warning: exported method SliceValidator.Names should have comment or be unexported (golint)
    • Line 43: warning: exported method SliceValidator.Validate should have comment or be unexported (golint)
    • Line 52: warning: exported method SliceValidator.ValidateReflectValue should have comment or be unexported (golint)
    • Line 85: warning: exported method SliceValidator.New should have comment or be unexported (golint)
    • validator/string_validator.go
    • Line 16: warning: exported var TargetStringLength should have comment or be unexported (golint)
    • Line 19: warning: exported type StrLenMode should have comment or be unexported (golint)
    • Line 22: warning: exported const STR_LEN_MODE__LENGTH should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported function ParseStrLenMode should have comment or be unexported (golint)
    • Line 63: warning: comment on exported type StringValidator should be of the form "StringValidator ..." (with optional leading article) (golint)
    • Line 106: warning: exported method StringValidator.Names should have comment or be unexported (golint)
    • Line 112: warning: exported method StringValidator.Validate should have comment or be unexported (golint)
    • Line 171: warning: exported method StringValidator.New should have comment or be unexported (golint)
    • Line 218: warning: exported method StringValidator.TypeCheck should have comment or be unexported (golint)
    • validator/struct_validator.go
    • Line 13: warning: exported function NewStructValidator should have comment or be unexported (golint)
    • Line 22: warning: exported function ContextWithNamedTagKey should have comment or be unexported (golint)
    • Line 26: warning: exported function NamedKeyFromContext should have comment or be unexported (golint)
    • Line 36: warning: exported type StructValidator should have comment or be unexported (golint)
    • Line 45: warning: exported method StructValidator.Names should have comment or be unexported (golint)
    • Line 49: warning: exported method StructValidator.Validate should have comment or be unexported (golint)
    • Line 58: warning: exported method StructValidator.ValidateReflectValue should have comment or be unexported (golint)
    • Line 94: warning: exported const TagValidate should have comment (or a comment on this block) or be unexported (golint)
    • Line 99: warning: exported method StructValidator.New should have comment or be unexported (golint)
    • validator/rules/rule.go
    • Line 11: warning: exported function MustParseRuleString should have comment or be unexported (golint)
    • Line 19: warning: exported function ParseRuleString should have comment or be unexported (golint)
    • Line 23: warning: exported function ParseRule should have comment or be unexported (golint)
    • validator/uint_validator.go
    • Line 16: warning: exported var TargetUintValue should have comment or be unexported (golint)
    • Line 19: warning: comment on exported type UintValidator should be of the form "UintValidator ..." (with optional leading article) (golint)
    • Line 76: warning: exported method UintValidator.Names should have comment or be unexported (golint)
    • Line 80: warning: exported method UintValidator.SetDefaults should have comment or be unexported (golint)
    • Line 99: warning: exported method UintValidator.Validate should have comment or be unexported (golint)
    • Line 152: warning: exported method UintValidator.New should have comment or be unexported (golint)
    • Line 230: warning: exported method UintValidator.TypeCheck should have comment or be unexported (golint)
    • validator/validator.go
    • Line 12: warning: exported function MustParseRuleStringWithType should have comment or be unexported (golint)
    • Line 20: warning: exported function ParseRuleWithType should have comment or be unexported (golint)
    • Line 37: warning: exported type Rule should have comment or be unexported (golint)
    • Line 48: warning: exported type RuleProcessor should have comment or be unexported (golint)
    • Line 50: warning: comment on exported type ValidatorMgr should be of the form "ValidatorMgr ..." (with optional leading article) (golint)
    • Line 56: warning: exported var ValidatorMgrDefault should have comment or be unexported (golint)
    • Line 60: warning: exported function ContextWithValidatorMgr should have comment or be unexported (golint)
    • Line 64: warning: exported function ValidatorMgrFromContext should have comment or be unexported (golint)
    • Line 68: warning: exported type ValidatorCreator should have comment or be unexported (golint)
    • Line 76: warning: exported type Validator should have comment or be unexported (golint)
    • Line 83: warning: exported function NewValidatorFactory should have comment or be unexported (golint)
    • Line 89: warning: exported type ValidatorFactory should have comment or be unexported (golint)
    • Line 93: warning: exported method ValidatorFactory.Register should have comment or be unexported (golint)
    • Line 102: warning: exported method ValidatorFactory.MustCompile should have comment or be unexported (golint)
    • Line 110: warning: exported method ValidatorFactory.Compile should have comment or be unexported (golint)
    • validator/rules/rule_node.go
    • Line 8: warning: exported type RuleNode should have comment or be unexported (golint)
    • Line 13: warning: exported function NewRule should have comment or be unexported (golint)
    • Line 19: warning: exported type Rule should have comment or be unexported (golint)
    • Line 39: warning: exported method Rule.ComputedValues should have comment or be unexported (golint)
    • Line 68: warning: exported method Rule.Bytes should have comment or be unexported (golint)
    • Line 143: warning: exported function NewRuleLit should have comment or be unexported (golint)
    • Line 149: warning: exported type RuleLit should have comment or be unexported (golint)
    • Line 154: warning: exported method RuleLit.Append should have comment or be unexported (golint)
    • Line 158: warning: exported method RuleLit.Bytes should have comment or be unexported (golint)
    • validator/strfmt_validator.go
    • Line 11: warning: exported function NewRegexpStrfmtValidator should have comment or be unexported (golint)
    • Line 26: warning: exported function NewStrfmtValidator should have comment or be unexported (golint)
    • Line 33: warning: exported type StrfmtValidator should have comment or be unexported (golint)
    • Line 42: warning: exported method StrfmtValidator.Names should have comment or be unexported (golint)
    • Line 46: warning: exported method StrfmtValidator.New should have comment or be unexported (golint)
    • Line 50: warning: exported method StrfmtValidator.TypeCheck should have comment or be unexported (golint)
    • Line 57: warning: exported method StrfmtValidator.Validate should have comment or be unexported (golint)
    • validator/validator_loader.go
    • Line 16: warning: exported function NewValidatorLoader should have comment or be unexported (golint)
    • Line 22: warning: exported type ValidatorLoader should have comment or be unexported (golint)
    • Line 32: warning: exported type PreprocessStage should have comment or be unexported (golint)
    • Line 35: warning: exported const PreprocessSkip should have comment (or a comment on this block) or be unexported (golint)
    • Line 66: warning: exported method ValidatorLoader.New should have comment or be unexported (golint)
    • Line 99: warning: exported method ValidatorLoader.Validate 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!