Preparing report...

Report for github.com/phpdave11/gofpdi

A    Great!    Found 5 issues across 5 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!


gocyclo40%

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.

    • gofpdi/reader.go
    • Line 808: warning: cyclomatic complexity 60 of function (*PdfReader).readXref() is high (> 15) (gocyclo)
    • Line 229: warning: cyclomatic complexity 44 of function (*PdfReader).readValue() is high (> 15) (gocyclo)
    • Line 592: warning: cyclomatic complexity 23 of function (*PdfReader).resolveObject() is high (> 15) (gocyclo)
    • Line 454: warning: cyclomatic complexity 17 of function (*PdfReader).resolveCompressedObject() is high (> 15) (gocyclo)
    • Line 154: warning: cyclomatic complexity 16 of function (*PdfReader).readToken() is high (> 15) (gocyclo)
    • gofpdi/helper.go
    • Line 9: warning: cyclomatic complexity 31 of function is_numeric() is high (> 15) (gocyclo)
    • gofpdi/writer.go
    • Line 261: warning: cyclomatic complexity 16 of function (*PdfWriter).writeValue() is high (> 15) (gocyclo)
    • Line 341: warning: cyclomatic complexity 16 of function (*PdfWriter).PutFormXobjects() is high (> 15) (gocyclo)

golint0%

Golint is a linter for Go source code.

    • gofpdi/const.go
    • Line 4: warning: exported const PDF_TYPE_NULL should have comment (or a comment on this block) or be unexported (golint)
    • gofpdi/helper.go
    • Line 9: warning: don't use underscores in Go names; func is_numeric should be isNumeric (golint)
    • Line 60: warning: don't use underscores in Go names; func in_array should be inArray (golint)
    • gofpdi/importer.go
    • Line 19: warning: exported type TplInfo should have comment or be unexported (golint)
    • Line 25: warning: exported method Importer.GetReader should have comment or be unexported (golint)
    • Line 25: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 29: warning: exported method Importer.GetWriter should have comment or be unexported (golint)
    • Line 29: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 33: warning: exported method Importer.GetReaderForFile should have comment or be unexported (golint)
    • Line 33: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 41: warning: exported method Importer.GetWriterForFile should have comment or be unexported (golint)
    • Line 41: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 49: warning: exported function NewImporter should have comment or be unexported (golint)
    • Line 56: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 64: warning: exported method Importer.SetSourceFile should have comment or be unexported (golint)
    • Line 64: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 89: warning: exported method Importer.SetSourceStream should have comment or be unexported (golint)
    • Line 89: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 113: warning: exported method Importer.GetNumPages should have comment or be unexported (golint)
    • Line 113: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 123: warning: exported method Importer.GetPageSizes should have comment or be unexported (golint)
    • Line 123: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 133: warning: exported method Importer.ImportPage should have comment or be unexported (golint)
    • Line 133: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 160: warning: exported method Importer.SetNextObjectID should have comment or be unexported (golint)
    • Line 160: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 164: warning: comment on exported method Importer.PutFormXobjects should be of the form "PutFormXobjects ..." (golint)
    • Line 165: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 177: warning: comment on exported method Importer.PutFormXobjectsUnordered should be of the form "PutFormXobjectsUnordered ..." (golint)
    • Line 178: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 191: warning: comment on exported method Importer.GetImportedObjects should be of the form "GetImportedObjects ..." (golint)
    • Line 192: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 201: warning: comment on exported method Importer.GetImportedObjectsUnordered should be of the form "GetImportedObjectsUnordered ..." (golint)
    • Line 204: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 213: warning: comment on exported method Importer.GetImportedObjHashPos should be of the form "GetImportedObjHashPos ..." (golint)
    • Line 215: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 224: warning: comment on exported method Importer.UseTemplate should be of the form "UseTemplate ..." (golint)
    • Line 226: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gofpdi/reader.go
    • Line 17: warning: exported type PdfReader should have comment or be unexported (golint)
    • Line 34: warning: exported function NewPdfReaderFromStream should have comment or be unexported (golint)
    • Line 49: warning: exported function NewPdfReader should have comment or be unexported (golint)
    • Line 71: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 82: warning: exported type PdfValue should have comment or be unexported (golint)
    • Line 100: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 129: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 154: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 191: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 229: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 454: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 592: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 594: warning: don't use underscores in Go names; var old_pos should be oldPos (golint)
    • Line 735: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 743: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 808: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1175: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1190: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1224: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1259: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1288: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 1313: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1344: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1386: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1439: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1447: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1464: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1495: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1495: warning: don't use underscores in Go names; method parameter box_index should be boxIndex (golint)
    • Line 1543: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1553: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 1576: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 1598: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gofpdi/writer.go
    • Line 15: warning: exported type PdfWriter should have comment or be unexported (golint)
    • Line 27: warning: don't use underscores in Go names; struct field obj_stack should be objStack (golint)
    • Line 28: warning: don't use underscores in Go names; struct field don_obj_stack should be donObjStack (golint)
    • Line 29: warning: don't use underscores in Go names; struct field written_objs should be writtenObjs (golint)
    • Line 30: warning: don't use underscores in Go names; struct field written_obj_pos should be writtenObjPos (golint)
    • Line 31: warning: don't use underscores in Go names; struct field current_obj should be currentObj (golint)
    • Line 32: warning: don't use underscores in Go names; struct field current_obj_id should be currentObjID (golint)
    • Line 33: warning: don't use underscores in Go names; struct field tpl_id_offset should be tplIDOffset (golint)
    • Line 34: warning: don't use underscores in Go names; struct field use_hash should be useHash (golint)
    • Line 37: warning: exported type PdfObjectId should have comment or be unexported (golint)
    • Line 42: warning: exported type PdfObject should have comment or be unexported (golint)
    • Line 47: warning: exported method PdfWriter.SetTplIdOffset should have comment or be unexported (golint)
    • Line 47: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 51: warning: exported method PdfWriter.Init should have comment or be unexported (golint)
    • Line 51: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 61: warning: exported method PdfWriter.SetUseHash should have comment or be unexported (golint)
    • Line 61: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 65: warning: exported method PdfWriter.SetNextObjectID should have comment or be unexported (golint)
    • Line 65: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 69: warning: exported function NewPdfWriter should have comment or be unexported (golint)
    • Line 85: warning: comment on exported type PdfTemplate should be of the form "PdfTemplate ..." (with optional leading article) (golint)
    • Line 101: warning: exported method PdfWriter.GetImportedObjects should have comment or be unexported (golint)
    • Line 101: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 105: warning: comment on exported method PdfWriter.GetImportedObjHashPos should be of the form "GetImportedObjHashPos ..." (golint)
    • Line 107: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 111: warning: exported method PdfWriter.ClearImportedObjects should have comment or be unexported (golint)
    • Line 111: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 115: warning: comment on exported method PdfWriter.ImportPage should be of the form "ImportPage ..." (golint)
    • Line 116: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 200: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 221: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 228: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 235: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 250: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 256: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 261: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 339: warning: comment on exported method PdfWriter.PutFormXobjects should be of the form "PutFormXobjects ..." (golint)
    • Line 341: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 464: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 514: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 541: warning: exported method PdfWriter.UseTemplate should have comment or be unexported (golint)
    • Line 541: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (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!


misspell80%

Misspell Finds commonly misspelled English words