Preparing report...

Report for github.com/lSimul/php2go

A+    Excellent!    Found 13 issues across 23 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!


gocyclo82%

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.

    • php2go/p/p.go
    • Line 1026: warning: cyclomatic complexity 92 of function (*fileParser).expression() is high (> 15) (gocyclo)
    • Line 271: warning: cyclomatic complexity 60 of function (*fileParser).createFunction() is high (> 15) (gocyclo)
    • Line 917: warning: cyclomatic complexity 21 of function (*fileParser).statement() is high (> 15) (gocyclo)
    • Line 753: warning: cyclomatic complexity 19 of function (*fileParser).complexExpression() is high (> 15) (gocyclo)
    • Line 1653: warning: cyclomatic complexity 17 of function (*parser).buildAssignment() is high (> 15) (gocyclo)
    • Line 1574: warning: cyclomatic complexity 17 of function (*fileParser).flowControlExpr() is high (> 15) (gocyclo)
    • Line 852: warning: cyclomatic complexity 16 of function (*fileParser).directAssignment() is high (> 15) (gocyclo)

golint65%

Golint is a linter for Go source code.

    • php2go/lang/expression.go
    • Line 9: warning: exported type Function should have comment or be unexported (golint)
    • Line 23: warning: exported method Function.Parent should have comment or be unexported (golint)
    • Line 27: warning: exported method Function.SetParent should have comment or be unexported (golint)
    • Line 32: warning: exported method Function.HasVariable should have comment or be unexported (golint)
    • Line 42: warning: exported method Function.DefineVariable should have comment or be unexported (golint)
    • Line 87: warning: exported method Function.AddStatement should have comment or be unexported (golint)
    • Line 91: warning: exported method Function.Type should have comment or be unexported (golint)
    • Line 95: warning: exported type VarRef should have comment or be unexported (golint)
    • Line 102: warning: exported method VarRef.Parent should have comment or be unexported (golint)
    • Line 106: warning: exported method VarRef.SetParent should have comment or be unexported (golint)
    • Line 119: warning: exported method VarRef.Type should have comment or be unexported (golint)
    • Line 123: warning: exported method VarRef.ByReference should have comment or be unexported (golint)
    • Line 128: warning: exported function NewVarRef should have comment or be unexported (golint)
    • Line 135: warning: exported type VarDef should have comment or be unexported (golint)
    • Line 143: warning: exported method VarDef.Parent should have comment or be unexported (golint)
    • Line 147: warning: exported method VarDef.SetParent should have comment or be unexported (golint)
    • Line 168: warning: exported type Const should have comment or be unexported (golint)
    • Line 174: warning: exported method Const.Parent should have comment or be unexported (golint)
    • Line 178: warning: exported method Const.SetParent should have comment or be unexported (golint)
    • Line 182: warning: comment on exported method Const.Type should be of the form "Type ..." (golint)
    • Line 191: warning: exported type Goto should have comment or be unexported (golint)
    • Line 197: warning: exported method Goto.Parent should have comment or be unexported (golint)
    • Line 201: warning: exported method Goto.SetParent should have comment or be unexported (golint)
    • Line 205: warning: exported method Goto.Type should have comment or be unexported (golint)
    • Line 213: warning: exported type Return should have comment or be unexported (golint)
    • Line 219: warning: exported method Return.Parent should have comment or be unexported (golint)
    • Line 223: warning: exported method Return.SetParent should have comment or be unexported (golint)
    • Line 227: warning: exported method Return.Type should have comment or be unexported (golint)
    • Line 240: warning: exported type Assign should have comment or be unexported (golint)
    • Line 253: warning: exported method Assign.Parent should have comment or be unexported (golint)
    • Line 257: warning: exported method Assign.SetParent should have comment or be unexported (golint)
    • Line 261: warning: exported method Assign.Type should have comment or be unexported (golint)
    • Line 277: warning: exported method Assign.Left should have comment or be unexported (golint)
    • Line 281: warning: comment on exported function NewAssign should be of the form "NewAssign ..." (golint)
    • Line 301: warning: exported type Number should have comment or be unexported (golint)
    • Line 307: warning: exported method Number.Parent should have comment or be unexported (golint)
    • Line 311: warning: exported method Number.SetParent should have comment or be unexported (golint)
    • Line 315: warning: exported method Number.Type should have comment or be unexported (golint)
    • Line 332: warning: exported method Float.Parent should have comment or be unexported (golint)
    • Line 336: warning: exported method Float.SetParent should have comment or be unexported (golint)
    • Line 340: warning: exported method Float.Type should have comment or be unexported (golint)
    • Line 348: warning: exported type Str should have comment or be unexported (golint)
    • Line 354: warning: exported method Str.Parent should have comment or be unexported (golint)
    • Line 358: warning: exported method Str.SetParent should have comment or be unexported (golint)
    • Line 362: warning: exported method Str.Type should have comment or be unexported (golint)
    • Line 370: warning: exported type UnaryMinus should have comment or be unexported (golint)
    • Line 376: warning: exported method UnaryMinus.Parent should have comment or be unexported (golint)
    • Line 380: warning: exported method UnaryMinus.SetParent should have comment or be unexported (golint)
    • Line 384: warning: exported method UnaryMinus.Type should have comment or be unexported (golint)
    • Line 395: warning: exported type Negation should have comment or be unexported (golint)
    • Line 401: warning: exported method Negation.Parent should have comment or be unexported (golint)
    • Line 405: warning: exported method Negation.SetParent should have comment or be unexported (golint)
    • Line 409: warning: exported method Negation.Type should have comment or be unexported (golint)
    • Line 421: warning: exported type BinaryOp should have comment or be unexported (golint)
    • Line 433: warning: exported method BinaryOp.Parent should have comment or be unexported (golint)
    • Line 437: warning: exported method BinaryOp.SetParent should have comment or be unexported (golint)
    • Line 441: warning: exported method BinaryOp.Type should have comment or be unexported (golint)
    • Line 445: warning: comment on exported method BinaryOp.OperatorPrecedence should be of the form "OperatorPrecedence ..." (golint)
    • Line 494: warning: exported function NewBinaryOp should have comment or be unexported (golint)
    • Line 532: warning: exported type FunctionCall should have comment or be unexported (golint)
    • Line 541: warning: exported method FunctionCall.AddArg should have comment or be unexported (golint)
    • Line 545: warning: exported method FunctionCall.Parent should have comment or be unexported (golint)
    • Line 549: warning: exported method FunctionCall.SetParent should have comment or be unexported (golint)
    • Line 553: warning: exported method FunctionCall.Type should have comment or be unexported (golint)
    • php2go/lang/fluent.go
    • Line 57: warning: exported type Inc should have comment or be unexported (golint)
    • Line 61: warning: exported function NewInc should have comment or be unexported (golint)
    • Line 75: warning: exported type Dec should have comment or be unexported (golint)
    • Line 79: warning: exported function NewDec should have comment or be unexported (golint)
    • php2go/lang/la.go
    • Line 9: warning: exported type GlobalContext should have comment or be unexported (golint)
    • Line 17: warning: exported function NewGlobalContext should have comment or be unexported (golint)
    • Line 24: warning: exported method GlobalContext.Add should have comment or be unexported (golint)
    • Line 28: warning: exported method GlobalContext.DefineVariable should have comment or be unexported (golint)
    • Line 39: warning: exported method GlobalContext.HasVariable should have comment or be unexported (golint)
    • Line 52: warning: exported type File should have comment or be unexported (golint)
    • Line 68: warning: exported function NewFile should have comment or be unexported (golint)
    • Line 87: warning: exported method File.Parent should have comment or be unexported (golint)
    • Line 88: warning: exported method File.SetParent should have comment or be unexported (golint)
    • Line 90: warning: exported method File.DefineVariable should have comment or be unexported (golint)
    • Line 108: warning: exported method File.HasVariable should have comment or be unexported (golint)
    • Line 120: warning: exported method File.Add should have comment or be unexported (golint)
    • Line 124: warning: exported method File.AddImport should have comment or be unexported (golint)
    • Line 290: warning: exported function NewFunc should have comment or be unexported (golint)
    • Line 309: warning: exported type Break should have comment or be unexported (golint)
    • Line 313: warning: exported method Break.Parent should have comment or be unexported (golint)
    • Line 317: warning: exported method Break.SetParent should have comment or be unexported (golint)
    • Line 325: warning: exported type Continue should have comment or be unexported (golint)
    • Line 329: warning: exported method Continue.Parent should have comment or be unexported (golint)
    • Line 333: warning: exported method Continue.SetParent should have comment or be unexported (golint)
    • Line 341: warning: exported type Fallthrough should have comment or be unexported (golint)
    • Line 345: warning: exported method Fallthrough.Parent should have comment or be unexported (golint)
    • Line 349: warning: exported method Fallthrough.SetParent should have comment or be unexported (golint)
    • Line 357: warning: exported type Code should have comment or be unexported (golint)
    • Line 366: warning: exported method Code.Parent should have comment or be unexported (golint)
    • Line 370: warning: exported method Code.SetParent should have comment or be unexported (golint)
    • Line 376: warning: exported method Code.HasVariable should have comment or be unexported (golint)
    • Line 427: warning: exported method Code.DefineVariable should have comment or be unexported (golint)
    • Line 491: warning: exported method Code.AddStatement should have comment or be unexported (golint)
    • Line 511: warning: exported function NewCode should have comment or be unexported (golint)
    • Line 527: warning: exported type For should have comment or be unexported (golint)
    • Line 541: warning: exported method For.SetCond should have comment or be unexported (golint)
    • Line 549: warning: exported method For.Parent should have comment or be unexported (golint)
    • Line 553: warning: exported method For.SetParent should have comment or be unexported (golint)
    • Line 559: warning: exported method For.HasVariable should have comment or be unexported (golint)
    • Line 578: warning: exported method For.DefineVariable should have comment or be unexported (golint)
    • Line 612: warning: exported method For.AddStatement should have comment or be unexported (golint)
    • Line 641: warning: exported function NewFor should have comment or be unexported (golint)
    • Line 656: warning: comment on exported type Foreach should be of the form "Foreach ..." (with optional leading article) (golint)
    • Line 675: warning: exported method Foreach.Parent should have comment or be unexported (golint)
    • Line 679: warning: exported method Foreach.SetParent should have comment or be unexported (golint)
    • Line 685: warning: exported method Foreach.HasVariable should have comment or be unexported (golint)
    • Line 697: warning: exported method Foreach.AddStatement should have comment or be unexported (golint)
    • Line 698: warning: exported method Foreach.DefineVariable should have comment or be unexported (golint)
    • Line 710: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 712: warning: exported function NewForeach should have comment or be unexported (golint)
    • Line 741: warning: exported type Switch should have comment or be unexported (golint)
    • Line 752: warning: exported method Switch.Parent should have comment or be unexported (golint)
    • Line 756: warning: exported method Switch.SetParent should have comment or be unexported (golint)
    • Line 762: warning: exported method Switch.HasVariable should have comment or be unexported (golint)
    • Line 769: warning: exported method Switch.AddStatement should have comment or be unexported (golint)
    • Line 770: warning: exported method Switch.DefineVariable should have comment or be unexported (golint)
    • Line 796: warning: exported type Case should have comment or be unexported (golint)
    • Line 803: warning: exported method Case.Parent should have comment or be unexported (golint)
    • Line 807: warning: exported method Case.SetParent should have comment or be unexported (golint)
    • Line 815: warning: exported method Case.HasVariable should have comment or be unexported (golint)
    • Line 834: warning: exported method Case.AddStatement should have comment or be unexported (golint)
    • Line 835: warning: exported method Case.DefineVariable should have comment or be unexported (golint)
    • Line 839: warning: exported function NewCase should have comment or be unexported (golint)
    • Line 846: warning: exported type Default should have comment or be unexported (golint)
    • Line 852: warning: exported method Default.Parent should have comment or be unexported (golint)
    • Line 856: warning: exported method Default.SetParent should have comment or be unexported (golint)
    • Line 864: warning: exported method Default.HasVariable should have comment or be unexported (golint)
    • Line 873: warning: exported method Default.AddStatement should have comment or be unexported (golint)
    • Line 874: warning: exported method Default.DefineVariable should have comment or be unexported (golint)
    • Line 886: warning: exported function NewDefault should have comment or be unexported (golint)
    • Line 893: warning: exported type If should have comment or be unexported (golint)
    • Line 905: warning: exported method If.SetCond should have comment or be unexported (golint)
    • Line 913: warning: exported method If.Parent should have comment or be unexported (golint)
    • Line 917: warning: exported method If.SetParent should have comment or be unexported (golint)
    • Line 923: warning: exported method If.HasVariable should have comment or be unexported (golint)
    • Line 935: warning: exported method If.DefineVariable should have comment or be unexported (golint)
    • Line 969: warning: exported method If.AddStatement should have comment or be unexported (golint)
    • Line 990: warning: exported function NewIf should have comment or be unexported (golint)
    • php2go/lang/lang.go
    • Line 6: warning: exported const Void should have comment (or a comment on this block) or be unexported (golint)
    • Line 65: warning: exported type Typ should have comment or be unexported (golint)
    • Line 74: warning: exported function NewTyp should have comment or be unexported (golint)
    • Line 78: warning: exported method Typ.Format should have comment or be unexported (golint)
    • Line 110: warning: exported method Typ.Equal should have comment or be unexported (golint)
    • Line 114: warning: exported method Typ.Eq should have comment or be unexported (golint)
    • Line 120: warning: exported type Variable should have comment or be unexported (golint)
    • Line 134: warning: exported method Variable.Type should have comment or be unexported (golint)
    • Line 138: warning: exported function NewVariable should have comment or be unexported (golint)
    • php2go/p/function.go
    • Line 10: warning: exported type Func should have comment or be unexported (golint)
    • Line 16: warning: exported function NewFunc should have comment or be unexported (golint)
    • Line 222: warning: exported type FileFunc should have comment or be unexported (golint)
    • Line 228: warning: comment on exported method FileFunc.Add should be of the form "Add ..." (golint)
    • Line 245: warning: exported method FileFunc.Namespace should have comment or be unexported (golint)
    • Line 245: warning: receiver name f should be consistent with previous receiver name fn for FileFunc (golint)
    • Line 258: warning: exported type FunctionCaller should have comment or be unexported (golint)
    • Line 263: warning: exported method FunctionCaller.NeedsGlobal should have comment or be unexported (golint)
    • Line 273: warning: exported method FunctionCaller.Call should have comment or be unexported (golint)
    • Line 276: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • php2go/p/nameTranslation.go
    • Line 82: warning: exported type NameTranslation should have comment or be unexported (golint)
    • Line 113: warning: exported function NewNameTranslator should have comment or be unexported (golint)
    • Line 137: warning: exported function NewFunctionTranslator should have comment or be unexported (golint)
    • Line 157: warning: exported function NewLabelTranslator should have comment or be unexported (golint)
    • php2go/p/p.go
    • Line 39: warning: exported function NewParser should have comment or be unexported (golint)
    • Line 100: warning: receiver name parser should be consistent with previous receiver name p for parser (golint)
    • Line 229: warning: receiver name parser should be consistent with previous receiver name p for fileParser (golint)
    • Line 271: warning: receiver name parser should be consistent with previous receiver name p for fileParser (golint)
    • Line 677: warning: receiver name parser should be consistent with previous receiver name p for fileParser (golint)
    • Line 753: warning: receiver name parser should be consistent with previous receiver name p for fileParser (golint)
    • Line 852: warning: receiver name parser should be consistent with previous receiver name p for fileParser (golint)
    • Line 917: warning: receiver name parser should be consistent with previous receiver name p for fileParser (golint)
    • Line 1026: warning: receiver name parser should be consistent with previous receiver name p for fileParser (golint)
    • Line 1653: warning: receiver name parser should be consistent with previous receiver name p for parser (golint)
    • php2go/std/conversion.go
    • Line 8: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 13: warning: comment on exported function BoolToFloat64 should be of the form "BoolToFloat64 ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign91%

IneffAssign detects ineffectual assignments in Go code.

    • php2go/serverBoilerplate/main.go
    • Line 17: warning: String not declared by package array (ineffassign)
    • Line 27: warning: NewString not declared by package array (ineffassign)
    • Line 36: warning: NewString not declared by package array (ineffassign)
    • Line 57: warning: NewString not declared by package array (ineffassign)

misspell95%

Misspell Finds commonly misspelled English words