Preparing report...

Report for github.com/thetreep/go-swagger

(v0.0.0-20240223100711-35af64f14f01)

A+    Excellent!    Found 31 issues across 219 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!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo86%

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.

    • codescan/schema.go
    • Line 292: warning: cyclomatic complexity 54 of function (*schemaBuilder).buildFromType() is high (> 15) (gocyclo)
    • Line 670: warning: cyclomatic complexity 46 of function (*schemaBuilder).buildFromStruct() is high (> 15) (gocyclo)
    • Line 477: warning: cyclomatic complexity 45 of function (*schemaBuilder).buildFromInterface() is high (> 15) (gocyclo)
    • Line 167: warning: cyclomatic complexity 22 of function (*schemaBuilder).buildFromDecl() is high (> 15) (gocyclo)
    • Line 964: warning: cyclomatic complexity 16 of function (*schemaBuilder).createParser() is high (> 15) (gocyclo)
    • generator/parameter_test.go
    • Line 268: warning: cyclomatic complexity 31 of function (*paramTestContext).assertGenParam() is high (> 15) (gocyclo)
    • Line 370: warning: cyclomatic complexity 21 of function (*paramItemsTestContext).Assert() is high (> 15) (gocyclo)
    • codescan/parser.go
    • Line 1370: warning: cyclomatic complexity 26 of function (*setOpResponses).Parse() is high (> 15) (gocyclo)
    • Line 580: warning: cyclomatic complexity 24 of function (*sectionedParser).Parse() is high (> 15) (gocyclo)
    • Line 1560: warning: cyclomatic complexity 23 of function buildExtensionObjects() is high (> 15) (gocyclo)
    • Line 211: warning: cyclomatic complexity 21 of function swaggerSchemaForType() is high (> 15) (gocyclo)
    • codescan/application.go
    • Line 606: warning: cyclomatic complexity 22 of function (*typeIndex).detectNodes() is high (> 15) (gocyclo)
    • Line 471: warning: cyclomatic complexity 21 of function (*typeIndex).processPackage() is high (> 15) (gocyclo)
    • Line 361: warning: cyclomatic complexity 18 of function (*scanCtx).FindEnumValues() is high (> 15) (gocyclo)
    • generator/operation.go
    • Line 317: warning: cyclomatic complexity 38 of function (*codeGenOpBuilder).MakeOperation() is high (> 15) (gocyclo)
    • Line 847: warning: cyclomatic complexity 31 of function (*codeGenOpBuilder).MakeBodyParameterItemsAndMaps() is high (> 15) (gocyclo)
    • Line 950: warning: cyclomatic complexity 26 of function (*codeGenOpBuilder).setBodyParamValidation() is high (> 15) (gocyclo)
    • Line 717: warning: cyclomatic complexity 16 of function (*codeGenOpBuilder).MakeParameter() is high (> 15) (gocyclo)
    • generator/types.go
    • Line 803: warning: cyclomatic complexity 29 of function (*typeResolver).ResolveSchema() is high (> 15) (gocyclo)
    • Line 534: warning: cyclomatic complexity 28 of function (*typeResolver).resolveObject() is high (> 15) (gocyclo)
    • Line 687: warning: cyclomatic complexity 25 of function nullableNumber() is high (> 15) (gocyclo)
    • generator/pointer_test.go
    • Line 429: warning: cyclomatic complexity 16 of function testPointToSliceElements() is high (> 15) (gocyclo)
    • Line 474: warning: cyclomatic complexity 16 of function testPointToPrimitives() is high (> 15) (gocyclo)
    • Line 384: warning: cyclomatic complexity 16 of function testPointToAdditionalPropertiesElements() is high (> 15) (gocyclo)
    • generator/model.go
    • Line 1966: warning: cyclomatic complexity 61 of function (*schemaGenContext).makeGenSchema() is high (> 15) (gocyclo)
    • Line 754: warning: cyclomatic complexity 52 of function (*schemaGenContext).buildProperties() is high (> 15) (gocyclo)
    • Line 166: warning: cyclomatic complexity 45 of function shallowValidationLookup() is high (> 15) (gocyclo)
    • Line 1237: warning: cyclomatic complexity 39 of function (*schemaGenContext).buildAdditionalProperties() is high (> 15) (gocyclo)
    • Line 1091: warning: cyclomatic complexity 33 of function (*mapStack).Build() is high (> 15) (gocyclo)
    • Line 933: warning: cyclomatic complexity 31 of function (*schemaGenContext).buildAllOf() is high (> 15) (gocyclo)
    • Line 228: warning: cyclomatic complexity 25 of function makeGenDefinitionHierarchy() is high (> 15) (gocyclo)
    • Line 379: warning: cyclomatic complexity 24 of function findImports() is high (> 15) (gocyclo)
    • Line 1927: warning: cyclomatic complexity 19 of function (*schemaGenContext).buildMapOfNullable() is high (> 15) (gocyclo)
    • Line 1449: warning: cyclomatic complexity 18 of function (*schemaGenContext).buildArray() is high (> 15) (gocyclo)
    • Line 1530: warning: cyclomatic complexity 18 of function (*schemaGenContext).buildItems() is high (> 15) (gocyclo)
    • codescan/parameters.go
    • Line 295: warning: cyclomatic complexity 44 of function (*parameterBuilder).buildFromStruct() is high (> 15) (gocyclo)
    • Line 219: warning: cyclomatic complexity 17 of function (*parameterBuilder).buildFromField() is high (> 15) (gocyclo)
    • generator/response_test.go
    • Line 213: warning: cyclomatic complexity 20 of function (*respHeaderTestContext).Assert() is high (> 15) (gocyclo)
    • Line 146: warning: cyclomatic complexity 16 of function (*responseTestContext).Assert() is high (> 15) (gocyclo)
    • codescan/responses.go
    • Line 292: warning: cyclomatic complexity 38 of function (*responseBuilder).buildFromStruct() is high (> 15) (gocyclo)
    • Line 181: warning: cyclomatic complexity 17 of function (*responseBuilder).buildFromField() is high (> 15) (gocyclo)
    • hack/codegen_nonreg_test.go
    • Line 413: warning: cyclomatic complexity 24 of function TestCodegen() is high (> 15) (gocyclo)
    • Line 302: warning: cyclomatic complexity 18 of function buildRuns() is high (> 15) (gocyclo)
    • codescan/route_params.go
    • Line 77: warning: cyclomatic complexity 21 of function (*setOpParams).Parse() is high (> 15) (gocyclo)
    • Line 174: warning: cyclomatic complexity 17 of function processSchema() is high (> 15) (gocyclo)
    • generator/template_repo.go
    • Line 875: warning: cyclomatic complexity 27 of function errorPath() is high (> 15) (gocyclo)
    • Line 466: warning: cyclomatic complexity 18 of function findDependencies() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell99%

Misspell Finds commonly misspelled English words