Preparing report...

Report for github.com/ory/x

(v0.0.326)

A+    Excellent!    Found 63 issues across 232 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!


gocyclo96%

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.

    • watcherx/file.go
    • Line 49: warning: cyclomatic complexity 16 of function streamFileEvents() is high (> 15) (gocyclo)
    • decoderx/http.go
    • Line 407: warning: cyclomatic complexity 43 of function (*HTTP).decodeURLValues() is high (> 15) (gocyclo)

golint75%

Golint is a linter for Go source code.

    • configx/koanf_file.go
    • Line 29: warning: comment on exported function NewKoanfFile should be of the form "NewKoanfFile ..." (golint)
    • Line 34: warning: exported function NewKoanfFileSubKey should have comment or be unexported (golint)
    • sqlcon/dockertest/test_helper.go
    • Line 189: warning: exported function ConnectToTestPostgreSQLPop should have comment or be unexported (golint)
    • Line 248: warning: exported function ConnectToTestMySQLPop should have comment or be unexported (golint)
    • Line 277: warning: comment on exported function RunCockroachDBWithVersion should be of the form "RunCockroachDBWithVersion ..." (golint)
    • Line 292: warning: comment on exported function RunTestCockroachDBWithVersion should be of the form "RunTestCockroachDBWithVersion ..." (golint)
    • Line 321: warning: exported function ConnectToTestCockroachDBPop should have comment or be unexported (golint)
    • Line 346: warning: exported function StripDump should have comment or be unexported (golint)
    • Line 355: warning: exported function DumpSchema should have comment or be unexported (golint)
    • cmdx/noise_printer.go
    • Line 11: warning: exported type ConditionalPrinter should have comment or be unexported (golint)
    • Line 17: warning: exported const FlagQuiet should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported function RegisterNoiseFlags should have comment or be unexported (golint)
    • Line 108: warning: exported function NewConditionalPrinter should have comment or be unexported (golint)
    • Line 115: warning: exported method ConditionalPrinter.Println should have comment or be unexported (golint)
    • Line 122: warning: exported method ConditionalPrinter.Print should have comment or be unexported (golint)
    • Line 129: warning: exported method ConditionalPrinter.Printf should have comment or be unexported (golint)
    • configx/span.go
    • Line 4: warning: exported const LoadSpanOpName should have comment (or a comment on this block) or be unexported (golint)
    • popx/transaction.go
    • Line 16: warning: exported function WithTransaction should have comment or be unexported (golint)
    • Line 20: warning: exported function Transaction should have comment or be unexported (golint)
    • Line 46: warning: exported function GetConnection should have comment or be unexported (golint)
    • metricsx/middleware.go
    • Line 313: warning: exported method Service.UnaryInterceptor should have comment or be unexported (golint)
    • Line 346: warning: exported method Service.StreamInterceptor should have comment or be unexported (golint)
    • Line 352: warning: exported method Service.Close should have comment or be unexported (golint)
    • cmdx/user_input.go
    • Line 11: warning: comment on exported function AskForConfirmation should be of the form "AskForConfirmation ..." (golint)
    • logrusx/helper.go
    • Line 21: warning: exported type Logger should have comment or be unexported (golint)
    • Line 31: warning: exported method Logger.LeakSensitiveData should have comment or be unexported (golint)
    • Line 35: warning: exported method Logger.Logrus should have comment or be unexported (golint)
    • Line 39: warning: exported method Logger.NewEntry should have comment or be unexported (golint)
    • Line 45: warning: exported method Logger.WithContext should have comment or be unexported (golint)
    • Line 51: warning: exported method Logger.HTTPHeadersRedacted should have comment or be unexported (golint)
    • Line 72: warning: exported method Logger.WithRequest should have comment or be unexported (golint)
    • Line 107: warning: exported method Logger.WithFields should have comment or be unexported (golint)
    • Line 113: warning: exported method Logger.WithField should have comment or be unexported (golint)
    • Line 129: warning: exported method Logger.WithSensitiveField should have comment or be unexported (golint)
    • Line 133: warning: exported method Logger.WithError should have comment or be unexported (golint)
    • Line 176: warning: exported method Logger.PopLogger should have comment or be unexported (golint)
    • configx/error.go
    • Line 9: warning: exported type ImmutableError should have comment or be unexported (golint)
    • Line 16: warning: exported function NewImmutableError should have comment or be unexported (golint)
    • popx/sql_template_funcs.go
    • Line 8: warning: exported var SQLTemplateFuncs should have comment or be unexported (golint)
    • Line 14: warning: exported function Identifier should have comment or be unexported (golint)
    • jsonschemax/keys.go
    • Line 22: warning: exported type PathEnhancer should have comment or be unexported (golint)
    • Line 25: warning: exported type TypeHint should have comment or be unexported (golint)
    • Line 33: warning: exported const String should have comment (or a comment on this block) or be unexported (golint)
    • configx/provider.go
    • Line 48: warning: exported type Provider should have comment or be unexported (golint)
    • Line 77: warning: exported const FlagConfig should have comment (or a comment on this block) or be unexported (golint)
    • Line 132: warning: exported method Provider.SkipValidation should have comment or be unexported (golint)
    • Line 328: warning: exported method Provider.Set should have comment or be unexported (golint)
    • Line 344: warning: exported method Provider.BoolF should have comment or be unexported (golint)
    • Line 355: warning: exported method Provider.StringF should have comment or be unexported (golint)
    • Line 366: warning: exported method Provider.StringsF should have comment or be unexported (golint)
    • Line 377: warning: exported method Provider.IntF should have comment or be unexported (golint)
    • Line 388: warning: exported method Provider.Float64F should have comment or be unexported (golint)
    • Line 399: warning: exported method Provider.DurationF should have comment or be unexported (golint)
    • Line 410: warning: exported method Provider.ByteSizeF should have comment or be unexported (golint)
    • Line 438: warning: exported method Provider.GetF should have comment or be unexported (golint)
    • Line 449: warning: exported method Provider.CORS should have comment or be unexported (golint)
    • Line 466: warning: exported method Provider.TracingConfig should have comment or be unexported (golint)
    • Line 491: warning: exported method Provider.RequestURIF should have comment or be unexported (golint)
    • Line 509: warning: exported method Provider.URIF should have comment or be unexported (golint)
    • httpx/assert.go
    • Line 7: warning: exported function GetResponseMeta should have comment or be unexported (golint)
    • networkx/manager.go
    • Line 21: warning: exported type Manager should have comment or be unexported (golint)
    • Line 27: warning: exported function NewManager should have comment or be unexported (golint)
    • Line 39: warning: exported method Manager.Determine should have comment or be unexported (golint)
    • httpx/gzip_server.go
    • Line 13: warning: exported type CompressionRequestReader should have comment or be unexported (golint)
    • Line 21: warning: exported function NewCompressionRequestReader should have comment or be unexported (golint)
    • prometheusx/metrics.go
    • Line 24: warning: exported const HTTPMetrics should have comment or be unexported (golint)
    • Line 25: warning: exported const GRPCMetrics should have comment or be unexported (golint)
    • configx/helpers.go
    • Line 15: warning: comment on exported function GetAddress should be of the form "GetAddress ..." (golint)
    • proxy/proxy.go
    • Line 11: warning: exported type RespMiddleware should have comment or be unexported (golint)
    • Line 12: warning: exported type ReqMiddleware should have comment or be unexported (golint)
    • Line 13: warning: exported type HostMapper should have comment or be unexported (golint)
    • Line 22: warning: exported type HostConfig should have comment or be unexported (golint)
    • Line 47: warning: exported type Options should have comment or be unexported (golint)
    • Line 149: warning: exported function WithOnError should have comment or be unexported (golint)
    • Line 156: warning: exported function WithReqMiddleware should have comment or be unexported (golint)
    • Line 162: warning: exported function WithRespMiddleware should have comment or be unexported (golint)
    • Line 168: warning: exported function WithTransport should have comment or be unexported (golint)
    • popx/migration_box.go
    • Line 24: warning: exported type MigrationContent should have comment or be unexported (golint)
    • Line 27: warning: exported function WithTemplateValues should have comment or be unexported (golint)
    • Line 34: warning: exported function WithMigrationContentMiddleware should have comment or be unexported (golint)
    • dbal/dsn.go
    • Line 8: warning: exported const SQLiteInMemory should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: comment on exported function IsMemorySQLite should be of the form "IsMemorySQLite ..." (golint)
    • healthx/handler.go
    • Line 86: warning: comment on exported method Handler.SetVersionRoutes should be of the form "SetVersionRoutes ..." (golint)
    • networkx/network.go
    • Line 9: warning: exported type Network should have comment or be unexported (golint)
    • Line 19: warning: exported method Network.TableName should have comment or be unexported (golint)
    • Line 23: warning: exported function NewNetwork should have comment or be unexported (golint)
    • configx/context.go
    • Line 9: warning: exported function ContextWithConfigOptions should have comment or be unexported (golint)
    • Line 13: warning: exported function ConfigOptionsFromContext should have comment or be unexported (golint)
    • configx/koanf_schema_defaults.go
    • Line 11: warning: exported type KoanfSchemaDefaults should have comment or be unexported (golint)
    • Line 15: warning: exported function NewKoanfSchemaDefaults should have comment or be unexported (golint)
    • Line 24: warning: exported method KoanfSchemaDefaults.ReadBytes should have comment or be unexported (golint)
    • httpx/resilient_client.go
    • Line 35: warning: exported type ResilientOptions should have comment or be unexported (golint)
    • Line 37: warning: exported function ResilientClientWithClient should have comment or be unexported (golint)
    • Line 43: warning: exported function ResilientClientWithMaxRetry should have comment or be unexported (golint)
    • Line 49: warning: exported function ResilientClientWithMinxRetryWait should have comment or be unexported (golint)
    • Line 55: warning: exported function ResilientClientWithMaxRetryWait should have comment or be unexported (golint)
    • Line 61: warning: exported function ResilientClientWithConnectionTimeout should have comment or be unexported (golint)
    • Line 67: warning: exported function ResilientClientWithLogger should have comment or be unexported (golint)
    • Line 73: warning: exported function NewResilientClient should have comment or be unexported (golint)
    • osx/file.go
    • Line 23: warning: exported type Option should have comment or be unexported (golint)
    • Line 91: warning: comment on exported function WithHTTPClient should be of the form "WithHTTPClient ..." (golint)
    • prometheusx/handler.go
    • Line 13: warning: exported const MetricsPrometheusPath should have comment (or a comment on this block) or be unexported (golint)
    • pkgerx/migration_box.go
    • Line 30: warning: exported type MigrationContent should have comment or be unexported (golint)
    • Line 76: warning: exported function WithTemplateValues should have comment or be unexported (golint)
    • Line 83: warning: exported function WithMigrationContentMiddleware should have comment or be unexported (golint)
    • jsonschemax/print.go
    • Line 14: warning: exported function FormatValidationErrorForCLI should have comment or be unexported (golint)
    • Line 45: warning: exported function FormatError should have comment or be unexported (golint)
    • configx/options.go
    • Line 21: warning: exported type OptionModifier should have comment or be unexported (golint)
    • Line 24: warning: exported function WithContext should have comment or be unexported (golint)
    • Line 33: warning: exported function WithConfigFiles should have comment or be unexported (golint)
    • Line 39: warning: exported function WithImmutables should have comment or be unexported (golint)
    • Line 45: warning: exported function WithFlags should have comment or be unexported (golint)
    • Line 51: warning: exported function WithLogger should have comment or be unexported (golint)
    • Line 57: warning: exported function SkipValidation should have comment or be unexported (golint)
    • Line 63: warning: exported function WithValue should have comment or be unexported (golint)
    • Line 69: warning: exported function WithValues should have comment or be unexported (golint)
    • Line 77: warning: exported function WithBaseValues should have comment or be unexported (golint)
    • Line 85: warning: exported function WithUserProviders should have comment or be unexported (golint)
    • Line 91: warning: exported function OmitKeysFromTracing should have comment or be unexported (golint)
    • Line 97: warning: exported function AttachWatcher should have comment or be unexported (golint)
    • Line 103: warning: exported function WithLogrusWatcher should have comment or be unexported (golint)
    • Line 107: warning: exported function LogrusWatcher should have comment or be unexported (golint)
    • Line 132: warning: exported function WithStderrValidationReporter should have comment or be unexported (golint)
    • Line 140: warning: exported function WithStandardValidationReporter should have comment or be unexported (golint)
    • flagx/flagx.go
    • Line 13: warning: exported function NewFlagSet should have comment or be unexported (golint)
    • networkx/listener.go
    • Line 10: warning: exported function AddressIsUnixSocket should have comment or be unexported (golint)
    • Line 14: warning: exported function MakeListener should have comment or be unexported (golint)
    • cmdx/helper.go
    • Line 158: warning: exported function ExecCtx should have comment or be unexported (golint)
    • Line 173: warning: exported function ExecNoErrCtx should have comment or be unexported (golint)
    • Line 189: warning: exported function ExecExpectedErrCtx should have comment or be unexported (golint)
    • Line 196: warning: exported type CommandExecuter should have comment or be unexported (golint)
    • Line 202: warning: exported method CommandExecuter.Exec should have comment or be unexported (golint)
    • Line 206: warning: exported method CommandExecuter.ExecBackground should have comment or be unexported (golint)
    • Line 210: warning: exported method CommandExecuter.ExecNoErr should have comment or be unexported (golint)
    • Line 214: warning: exported method CommandExecuter.ExecExpectedErr should have comment or be unexported (golint)
    • logrusx/logrus.go
    • Line 5: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 28: warning: exported type Option should have comment or be unexported (golint)
    • Line 36: warning: comment on exported var ConfigSchema should be of the form "ConfigSchema ..." (golint)
    • Line 39: warning: exported const ConfigSchemaID should have comment or be unexported (golint)
    • Line 115: warning: exported function ForceLevel should have comment or be unexported (golint)
    • Line 121: warning: exported function ForceFormatter should have comment or be unexported (golint)
    • Line 127: warning: exported function WithConfigurator should have comment or be unexported (golint)
    • Line 133: warning: exported function ForceFormat should have comment or be unexported (golint)
    • Line 139: warning: exported function WithHook should have comment or be unexported (golint)
    • Line 145: warning: exported function WithExitFunc should have comment or be unexported (golint)
    • Line 151: warning: exported function ReportCaller should have comment or be unexported (golint)
    • Line 157: warning: exported function UseLogger should have comment or be unexported (golint)
    • Line 163: warning: exported function LeakSensitive should have comment or be unexported (golint)
    • Line 199: warning: exported function NewAudit should have comment or be unexported (golint)
    • Line 203: warning: exported method Logger.UseConfig should have comment or be unexported (golint)
    • popx/migrator.go
    • Line 32: warning: exported const Pending should have comment (or a comment on this block) or be unexported (golint)
    • Line 373: warning: exported type MigrationStatus should have comment or be unexported (golint)
    • Line 379: warning: exported type MigrationStatuses should have comment or be unexported (golint)
    • Line 383: warning: exported method MigrationStatuses.Header should have comment or be unexported (golint)
    • Line 387: warning: exported method MigrationStatuses.Table should have comment or be unexported (golint)
    • Line 395: warning: exported method MigrationStatuses.Interface should have comment or be unexported (golint)
    • Line 399: warning: exported method MigrationStatuses.Len should have comment or be unexported (golint)
    • Line 403: warning: exported method MigrationStatuses.IDs should have comment or be unexported (golint)
    • Line 423: warning: exported method MigrationStatuses.HasPending should have comment or be unexported (golint)
    • assertx/assertx.go
    • Line 15: warning: exported function PrettifyJSONPayload should have comment or be unexported (golint)
    • Line 21: warning: exported function EqualAsJSON should have comment or be unexported (golint)
    • Line 32: warning: exported function EqualAsJSONExcept should have comment or be unexported (golint)
    • pkgerx/sql_template_funcs.go
    • Line 8: warning: exported var SQLTemplateFuncs should have comment or be unexported (golint)
    • Line 14: warning: exported function Identifier should have comment or be unexported (golint)
    • jsonx/helpers.go
    • Line 10: warning: exported function TestMarshalJSONString should have comment or be unexported (golint)
    • Line 16: warning: exported function TestUnmarshalJSON should have comment or be unexported (golint)
    • configx/permission.go
    • Line 9: warning: exported type UnixPermission should have comment or be unexported (golint)
    • Line 15: warning: exported method UnixPermission.SetPermission should have comment or be unexported (golint)
    • cmdx/printing.go
    • Line 15: warning: exported type TableHeader should have comment or be unexported (golint)
    • Line 18: warning: exported type TableRow should have comment or be unexported (golint)
    • Line 23: warning: exported type Table should have comment or be unexported (golint)
    • Line 29: warning: exported type Nil should have comment or be unexported (golint)
    • Line 35: warning: exported const FormatQuiet should have comment (or a comment on this block) or be unexported (golint)
    • Line 50: warning: exported method Nil.Interface should have comment or be unexported (golint)
    • Line 54: warning: exported function PrintErrors should have comment or be unexported (golint)
    • Line 60: warning: exported function PrintRow should have comment or be unexported (golint)
    • Line 86: warning: exported function PrintTable should have comment or be unexported (golint)
    • Line 125: warning: exported function PrintJSONAble should have comment or be unexported (golint)
    • Line 189: warning: exported function RegisterJSONFormatFlags should have comment or be unexported (golint)
    • Line 193: warning: exported function RegisterFormatFlags should have comment or be unexported (golint)
    • popx/span.go
    • Line 4: warning: exported const MigrationStatusOpName should have comment (or a comment on this block) or be unexported (golint)
    • dbal/driver.go
    • Line 16: warning: exported var ErrSQLiteSupportMissing should have comment or be unexported (golint)
    • prometheusx/middleware.go
    • Line 10: warning: exported type MetricsManager should have comment or be unexported (golint)
    • Line 15: warning: exported function NewMetricsManager should have comment or be unexported (golint)
    • Line 33: warning: exported method MetricsManager.RegisterRouter should have comment or be unexported (golint)
    • migratest/run.go
    • Line 14: warning: exported function ContainsExpectedIds should have comment or be unexported (golint)
    • Line 25: warning: exported function CompareWithFixture should have comment or be unexported (golint)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell99%

Misspell Finds commonly misspelled English words