Preparing report...

Report for github.com/go-interpreter/wagon

A+    Excellent!    Found 38 issues across 98 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!


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.

    • wagon/disasm/disasm.go
    • Line 92: warning: cyclomatic complexity 44 of function NewDisassembly() is high (> 15) (gocyclo)
    • Line 344: warning: cyclomatic complexity 35 of function Disassemble() is high (> 15) (gocyclo)
    • wagon/wasm/init_expr.go
    • Line 93: warning: cyclomatic complexity 24 of function (*Module).ExecInitExpr() is high (> 15) (gocyclo)
    • Line 40: warning: cyclomatic complexity 16 of function readInitExpr() is high (> 15) (gocyclo)
    • wagon/exec/exec_test.go
    • Line 258: warning: cyclomatic complexity 30 of function runTest() is high (> 15) (gocyclo)
    • Line 48: warning: cyclomatic complexity 16 of function parseFloat() is high (> 15) (gocyclo)
    • wagon/exec/vm.go
    • Line 397: warning: cyclomatic complexity 24 of function (*VM).execCode() is high (> 15) (gocyclo)
    • Line 334: warning: cyclomatic complexity 16 of function (*VM).ExecCode() is high (> 15) (gocyclo)

golint71%

Golint is a linter for Go source code.

    • wagon/wasm/types.go
    • Line 16: warning: exported type Marshaler should have comment or be unexported (golint)
    • Line 21: warning: exported type Unmarshaler should have comment or be unexported (golint)
    • Line 30: warning: exported const ValueTypeI32 should have comment (or a comment on this block) or be unexported (golint)
    • Line 54: warning: exported method ValueType.UnmarshalWASM should have comment or be unexported (golint)
    • Line 63: warning: exported method ValueType.MarshalWASM should have comment or be unexported (golint)
    • Line 70: warning: exported const BlockTypeEmpty should have comment or be unexported (golint)
    • Line 84: warning: exported method ElemType.UnmarshalWASM should have comment or be unexported (golint)
    • Line 96: warning: exported method ElemType.MarshalWASM should have comment or be unexported (golint)
    • Line 121: warning: exported type InvalidTypeConstructorError should have comment or be unexported (golint)
    • Line 130: warning: exported method FunctionSig.UnmarshalWASM should have comment or be unexported (golint)
    • Line 171: warning: exported method FunctionSig.MarshalWASM should have comment or be unexported (golint)
    • Line 207: warning: exported method GlobalVar.UnmarshalWASM should have comment or be unexported (golint)
    • Line 229: warning: exported method GlobalVar.MarshalWASM should have comment or be unexported (golint)
    • Line 247: warning: exported method Table.UnmarshalWASM should have comment or be unexported (golint)
    • Line 260: warning: exported method Table.MarshalWASM should have comment or be unexported (golint)
    • Line 270: warning: exported type Memory should have comment or be unexported (golint)
    • Line 274: warning: exported method Memory.UnmarshalWASM should have comment or be unexported (golint)
    • Line 278: warning: exported method Memory.MarshalWASM should have comment or be unexported (golint)
    • Line 286: warning: exported const ExternalFunction should have comment (or a comment on this block) or be unexported (golint)
    • Line 306: warning: exported method External.UnmarshalWASM should have comment or be unexported (golint)
    • Line 314: warning: exported method External.MarshalWASM should have comment or be unexported (golint)
    • Line 326: warning: exported method ResizableLimits.UnmarshalWASM should have comment or be unexported (golint)
    • Line 353: warning: exported method ResizableLimits.MarshalWASM should have comment or be unexported (golint)
    • wagon/internal/stack/stack.go
    • Line 8: warning: exported type Stack should have comment or be unexported (golint)
    • Line 12: warning: exported method Stack.Push should have comment or be unexported (golint)
    • Line 16: warning: exported method Stack.Pop should have comment or be unexported (golint)
    • Line 22: warning: exported method Stack.SetTop should have comment or be unexported (golint)
    • Line 26: warning: exported method Stack.Top should have comment or be unexported (golint)
    • Line 30: warning: exported method Stack.Get should have comment or be unexported (golint)
    • Line 34: warning: exported method Stack.Set should have comment or be unexported (golint)
    • Line 38: warning: exported method Stack.Len should have comment or be unexported (golint)
    • wagon/wast/token.go
    • Line 9: warning: exported type Token should have comment or be unexported (golint)
    • Line 17: warning: exported method Token.Copy should have comment or be unexported (golint)
    • Line 44: warning: exported type TokenKind should have comment or be unexported (golint)
    • Line 47: warning: exported const NAT should have comment (or a comment on this block) or be unexported (golint)
    • Line 126: warning: don't use underscores in Go names; const LT_S should be LTS (golint)
    • Line 127: warning: don't use underscores in Go names; const LT_U should be LTU (golint)
    • Line 128: warning: don't use underscores in Go names; const LE_S should be LES (golint)
    • Line 129: warning: don't use underscores in Go names; const LE_U should be LEU (golint)
    • Line 130: warning: don't use underscores in Go names; const GT_S should be GTS (golint)
    • Line 131: warning: don't use underscores in Go names; const GT_U should be GTU (golint)
    • Line 132: warning: don't use underscores in Go names; const GE_S should be GES (golint)
    • Line 133: warning: don't use underscores in Go names; const GE_U should be GEU (golint)
    • wagon/wasm/index.go
    • Line 14: warning: exported type OutsizeError should have comment or be unexported (golint)
    • Line 24: warning: exported type InvalidTableIndexError should have comment or be unexported (golint)
    • Line 30: warning: exported type UninitializedTableEntryError should have comment or be unexported (golint)
    • Line 36: warning: exported type InvalidValueTypeInitExprError should have comment or be unexported (golint)
    • Line 45: warning: exported type InvalidLinearMemoryIndexError should have comment or be unexported (golint)
    • Line 129: warning: exported method Module.GetFunctionSig should have comment or be unexported (golint)
    • Line 179: warning: exported method Module.GetGlobalType should have comment or be unexported (golint)
    • Line 303: warning: exported method Module.GetLinearMemoryData should have comment or be unexported (golint)
    • wagon/wasm/imports.go
    • Line 34: warning: exported type FuncImport should have comment or be unexported (golint)
    • Line 39: warning: exported method FuncImport.Kind should have comment or be unexported (golint)
    • Line 42: warning: exported method FuncImport.MarshalWASM should have comment or be unexported (golint)
    • Line 47: warning: exported type TableImport should have comment or be unexported (golint)
    • Line 52: warning: exported method TableImport.Kind should have comment or be unexported (golint)
    • Line 55: warning: exported method TableImport.MarshalWASM should have comment or be unexported (golint)
    • Line 59: warning: exported type MemoryImport should have comment or be unexported (golint)
    • Line 64: warning: exported method MemoryImport.Kind should have comment or be unexported (golint)
    • Line 67: warning: exported method MemoryImport.MarshalWASM should have comment or be unexported (golint)
    • Line 71: warning: exported type GlobalVarImport should have comment or be unexported (golint)
    • Line 76: warning: exported method GlobalVarImport.Kind should have comment or be unexported (golint)
    • Line 79: warning: exported method GlobalVarImport.MarshalWASM should have comment or be unexported (golint)
    • Line 84: warning: exported var ErrImportMutGlobal should have comment or be unexported (golint)
    • Line 88: warning: exported type InvalidExternalError should have comment or be unexported (golint)
    • Line 94: warning: exported type ExportNotFoundError should have comment or be unexported (golint)
    • Line 99: warning: exported type KindMismatchError should have comment or be unexported (golint)
    • Line 114: warning: exported type InvalidFunctionIndexError should have comment or be unexported (golint)
    • wagon/wasm/init_expr.go
    • Line 26: warning: exported var ErrEmptyInitExpr should have comment or be unexported (golint)
    • Line 28: warning: exported type InvalidInitExprOpError should have comment or be unexported (golint)
    • Line 34: warning: exported type InvalidGlobalIndexError should have comment or be unexported (golint)
    • wagon/tests/spec_test_runner.go
    • Line 22: warning: exported type Config should have comment or be unexported (golint)
    • Line 27: warning: exported type Command should have comment or be unexported (golint)
    • Line 38: warning: exported type CmdAction should have comment or be unexported (golint)
    • Line 46: warning: exported type ValueInfo should have comment or be unexported (golint)
    • Line 51: warning: exported function LoadConfigFromFile should have comment or be unexported (golint)
    • Line 64: warning: exported method Config.Run should have comment or be unexported (golint)
    • wagon/validate/error.go
    • Line 52: warning: comment on exported type InvalidLabelError should be of the form "InvalidLabelError ..." (with optional leading article) (golint)
    • wagon/wasm/module.go
    • Line 16: warning: exported var ErrInvalidMagic should have comment or be unexported (golint)
    • Line 19: warning: exported const Magic should have comment (or a comment on this block) or be unexported (golint)
    • wagon/wasm/section.go
    • Line 36: warning: exported const SectionIDCustom should have comment (or a comment on this block) or be unexported (golint)
    • Line 80: warning: exported method RawSection.SectionID should have comment or be unexported (golint)
    • Line 84: warning: exported method RawSection.GetRawSection should have comment or be unexported (golint)
    • Line 88: warning: exported type InvalidSectionIDError should have comment or be unexported (golint)
    • Line 94: warning: exported type InvalidCodeIndexError should have comment or be unexported (golint)
    • Line 100: warning: exported var ErrUnsupportedSection should have comment or be unexported (golint)
    • Line 102: warning: exported type MissingSectionError should have comment or be unexported (golint)
    • Line 131: warning: receiver name sr should be consistent with previous receiver name s for sectionsReader (golint)
    • Line 250: warning: exported type SectionCustom should have comment or be unexported (golint)
    • Line 256: warning: exported method SectionCustom.SectionID should have comment or be unexported (golint)
    • Line 260: warning: exported method SectionCustom.ReadPayload should have comment or be unexported (golint)
    • Line 274: warning: exported method SectionCustom.WritePayload should have comment or be unexported (golint)
    • Line 290: warning: exported method SectionTypes.SectionID should have comment or be unexported (golint)
    • Line 294: warning: exported method SectionTypes.ReadPayload should have comment or be unexported (golint)
    • Line 311: warning: exported method SectionTypes.WritePayload should have comment or be unexported (golint)
    • Line 332: warning: exported method SectionImports.SectionID should have comment or be unexported (golint)
    • Line 336: warning: exported method SectionImports.ReadPayload should have comment or be unexported (golint)
    • Line 353: warning: exported method SectionImports.WritePayload should have comment or be unexported (golint)
    • Line 367: warning: exported method ImportEntry.UnmarshalWASM should have comment or be unexported (golint)
    • Line 433: warning: comment on exported type SectionFunctions should be of the form "SectionFunctions ..." (with optional leading article) (golint)
    • Line 440: warning: exported method SectionFunctions.SectionID should have comment or be unexported (golint)
    • Line 444: warning: exported method SectionFunctions.ReadPayload should have comment or be unexported (golint)
    • Line 460: warning: exported method SectionFunctions.WritePayload should have comment or be unexported (golint)
    • Line 478: warning: exported method SectionTables.SectionID should have comment or be unexported (golint)
    • Line 482: warning: exported method SectionTables.ReadPayload should have comment or be unexported (golint)
    • Line 499: warning: exported method SectionTables.WritePayload should have comment or be unexported (golint)
    • Line 517: warning: exported method SectionMemories.SectionID should have comment or be unexported (golint)
    • Line 521: warning: exported method SectionMemories.ReadPayload should have comment or be unexported (golint)
    • Line 537: warning: exported method SectionMemories.WritePayload should have comment or be unexported (golint)
    • Line 555: warning: exported method SectionGlobals.SectionID should have comment or be unexported (golint)
    • Line 559: warning: exported method SectionGlobals.ReadPayload should have comment or be unexported (golint)
    • Line 577: warning: exported method SectionGlobals.WritePayload should have comment or be unexported (golint)
    • Line 595: warning: exported method GlobalEntry.UnmarshalWASM should have comment or be unexported (golint)
    • Line 606: warning: exported method GlobalEntry.MarshalWASM should have comment or be unexported (golint)
    • Line 621: warning: exported method SectionExports.SectionID should have comment or be unexported (golint)
    • Line 625: warning: exported method SectionExports.ReadPayload should have comment or be unexported (golint)
    • Line 648: warning: exported method SectionExports.WritePayload should have comment or be unexported (golint)
    • Line 672: warning: exported type DuplicateExportError should have comment or be unexported (golint)
    • Line 685: warning: exported method ExportEntry.UnmarshalWASM should have comment or be unexported (golint)
    • Line 701: warning: exported method ExportEntry.MarshalWASM should have comment or be unexported (golint)
    • Line 720: warning: exported method SectionStartFunction.SectionID should have comment or be unexported (golint)
    • Line 724: warning: exported method SectionStartFunction.ReadPayload should have comment or be unexported (golint)
    • Line 730: warning: exported method SectionStartFunction.WritePayload should have comment or be unexported (golint)
    • Line 741: warning: exported method SectionElements.SectionID should have comment or be unexported (golint)
    • Line 745: warning: exported method SectionElements.ReadPayload should have comment or be unexported (golint)
    • Line 762: warning: exported method SectionElements.WritePayload should have comment or be unexported (golint)
    • Line 781: warning: exported method ElementSegment.UnmarshalWASM should have comment or be unexported (golint)
    • Line 807: warning: exported method ElementSegment.MarshalWASM should have comment or be unexported (golint)
    • Line 832: warning: exported method SectionCode.SectionID should have comment or be unexported (golint)
    • Line 836: warning: exported method SectionCode.ReadPayload should have comment or be unexported (golint)
    • Line 855: warning: exported method SectionCode.WritePayload should have comment or be unexported (golint)
    • Line 867: warning: exported var ErrFunctionNoEnd should have comment or be unexported (golint)
    • Line 869: warning: exported type FunctionBody should have comment or be unexported (golint)
    • Line 875: warning: exported method FunctionBody.UnmarshalWASM should have comment or be unexported (golint)
    • Line 917: warning: exported method FunctionBody.MarshalWASM should have comment or be unexported (golint)
    • Line 934: warning: exported type LocalEntry should have comment or be unexported (golint)
    • Line 939: warning: exported method LocalEntry.UnmarshalWASM should have comment or be unexported (golint)
    • Line 955: warning: exported method LocalEntry.MarshalWASM should have comment or be unexported (golint)
    • Line 971: warning: exported method SectionData.SectionID should have comment or be unexported (golint)
    • Line 975: warning: exported method SectionData.ReadPayload should have comment or be unexported (golint)
    • Line 991: warning: exported method SectionData.WritePayload should have comment or be unexported (golint)
    • Line 1010: warning: exported method DataSegment.UnmarshalWASM should have comment or be unexported (golint)
    • Line 1023: warning: exported method DataSegment.MarshalWASM should have comment or be unexported (golint)
    • Line 1047: warning: exported const NameModule should have comment (or a comment on this block) or be unexported (golint)
    • Line 1058: warning: exported method NameSection.UnmarshalWASM should have comment or be unexported (golint)
    • Line 1075: warning: exported method NameSection.MarshalWASM should have comment or be unexported (golint)
    • Line 1137: warning: exported method ModuleName.UnmarshalWASM should have comment or be unexported (golint)
    • Line 1143: warning: exported method ModuleName.MarshalWASM should have comment or be unexported (golint)
    • Line 1154: warning: exported method FunctionNames.UnmarshalWASM should have comment or be unexported (golint)
    • Line 1159: warning: exported method FunctionNames.MarshalWASM should have comment or be unexported (golint)
    • Line 1171: warning: exported method LocalNames.UnmarshalWASM should have comment or be unexported (golint)
    • Line 1191: warning: exported method LocalNames.MarshalWASM should have comment or be unexported (golint)
    • Line 1222: warning: exported method NameMap.UnmarshalWASM should have comment or be unexported (golint)
    • Line 1240: warning: exported method NameMap.MarshalWASM should have comment or be unexported (golint)
    • wagon/wasm/operators/op.go
    • Line 33: warning: exported method Op.IsValid should have comment or be unexported (golint)
    • Line 67: warning: exported type InvalidOpcodeError should have comment or be unexported (golint)
    • wagon/wast/scanner.go
    • Line 20: warning: exported type Scanner should have comment or be unexported (golint)
    • Line 36: warning: exported function NewScanner should have comment or be unexported (golint)
    • Line 126: warning: exported method Scanner.Next 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!


misspell95%

Misspell Finds commonly misspelled English words