Documentation ¶
Overview ¶
Package findbugs is the Findbugs static analysis tool's implementation of an Imendulo tool. See http://findbugs.sourceforge.net/ for more information.
Index ¶
- Constants
- type BugCategory
- type BugInstance
- type BugPattern
- type Class
- type ClassStats
- type DummyReport
- type Field
- type FileStats
- type LocalVariable
- type Method
- type PackageStats
- type Property
- type Report
- type Result
- func (r *Result) ChartVals() []*result.ChartVal
- func (r *Result) GetFileId() bson.ObjectId
- func (r *Result) GetId() bson.ObjectId
- func (r *Result) GetName() string
- func (this *Result) GetTestId() bson.ObjectId
- func (r *Result) GetType() string
- func (r *Result) Lines() []*result.Line
- func (r *Result) OnGridFS() bool
- func (r *Result) Reporter() result.Reporter
- func (r *Result) SetReport(report result.Reporter)
- func (r *Result) String() string
- func (r *Result) Template() string
- type SourceLine
- type Summary
- type Tool
Constants ¶
const (
NAME = "Findbugs"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BugCategory ¶
type BugCategory struct { Name string `xml:"category,attr"` Description string `xml:"Description"` }
BugCategory describes a category in which bugs may fall.
type BugInstance ¶
type BugInstance struct { Id bson.ObjectId Type string `xml:"type,attr"` Priority int `xml:"priority,attr"` Abbreviation string `xml:"abbrev,attr"` Category string `xml:"category,attr"` Rank int `xml:"rank,attr"` ShortMessage string `xml:"ShortMessage"` LongMessage string `xml:"LongMessage"` Class *Class `xml:"Class"` Method *Method `xml:"Method"` Field *Field `xml:"Field"` Var *LocalVariable `xml:"LocalVariable"` Line *SourceLine `xml:"SourceLine"` Properties []*Property `xml:"Property"` }
BugInstance describes a particular bug detected by Findbugs. It contains information describing its location and state as well as its category, severity and type.
type BugPattern ¶
type BugPattern struct { Type string `xml:"type,attr"` Abbreviation string `xml:"abbrev,attr"` Category string `xml:"category,attr"` Description string `xml:"ShortDescription"` Details template.HTML `xml:"Details"` }
BugPattern describes a pattern associated with a BugCategory.
type Class ¶
type Class struct { Name string `xml:"classname,attr"` IsPrimary bool `xml:"primary,attr"` Line *SourceLine `xml:"SourceLine"` Message string `xml:"Message"` }
Class describes a Java Class in which a bug was found.
type ClassStats ¶
type ClassStats struct { Name string `xml:"class,attr"` Source string `xml:"sourceFile,attr"` IsInterface bool `xml:"interface,attr"` BugCount int `xml:"bugs,attr"` Size int `xml:"size,attr"` Priority1 int `xml:"priority_1,attr"` Priority2 int `xml:"priority_2,attr"` Priority3 int `xml:"priority_3,attr"` }
ClassStats provides Findbugs statistics about a specific class within a package.
type DummyReport ¶
type DummyReport struct { Time int `xml:"analysisTimestamp,attr"` Summary *Summary `xml:"FindBugsSummary"` //Instances is all the bugs found by Findbugs Instances []*BugInstance `xml:"BugInstance"` //Categories is the bug categories found by Findbugs. Categories []*BugCategory `xml:"BugCategory"` //Patterns is the bug patterns found by Findbugs. Patterns []*BugPattern `xml:"BugPattern"` }
type Field ¶
type Field struct { Name string `xml:"name,attr"` Class string `xml:"classname,attr"` Signature string `xml:"signature,attr"` IsStatic bool `xml:"isStatic,attr"` IsPrimary bool `xml:"primary,attr"` Role string `xml:"role,attr"` Line *SourceLine `xml:"SourceLine"` Message string `xml:"Message"` }
Field describes a global variable within a Java Class.
type FileStats ¶
type FileStats struct { Path string `xml:"path,attr"` BugCount int `xml:"bugCount,attr"` Size int `xml:"size,attr"` }
FileStats provides Findbugs statistics about a specific source file.
type LocalVariable ¶
type LocalVariable struct { Name string `xml:"name,attr"` Register int `xml:"register,attr"` PC string `xml:"pc,attr"` Role string `xml:"role,attr"` Message string `xml:"Message"` }
LocalVariable describes a local variable within a Java Class.
type Method ¶
type Method struct { Name string `xml:"name,attr"` Class string `xml:"classname,attr"` Signature string `xml:"signature,attr"` IsStatic bool `xml:"isStatic,attr"` IsPrimary bool `xml:"primary,attr"` Line *SourceLine `xml:"SourceLine"` Message string `xml:"Message"` }
Method describes a method within a Java Class.
type PackageStats ¶
type PackageStats struct { Name string `xml:"package,attr"` ClassCount int `xml:"total_types,attr"` BugCount int `xml:"total_bugs,attr"` Size int `xml:"total_size,attr"` Priority1 int `xml:"priority_1,attr"` Priority2 int `xml:"priority_2,attr"` Priority3 int `xml:"priority_3,attr"` Classes []*ClassStats `xml:"ClassStats"` }
PackageStats provides Findbugs statistics about a specific package as well as the classes found within it.
type Report ¶
type Report struct { Id bson.ObjectId Time int Summary *Summary //Instances is all the bugs found by Findbugs Instances []*BugInstance //CategoryMap and PatternMap make it easier to use the bug categories and patterns. CategoryMap map[string]*BugCategory PatternMap map[string]*BugPattern }
Report stores the results of running Findbugs. It is populated from XML output produced by findbugs.
type Result ¶
type Result struct { Id bson.ObjectId `bson:"_id"` FileId bson.ObjectId `bson:"fileid"` Name string `bson:"name"` Report *Report `bson:"report"` GridFS bool `bson:"gridfs"` Type string `bson:"type"` }
type SourceLine ¶
type SourceLine struct { Class string `xml:"classname,attr"` Start int `xml:"start,attr"` End int `xml:"end,attr"` StartBC int `xml:"startBytecode,attr"` EndBC int `xml:"endBytecode,attr"` File string `xml:"sourcefile,attr"` Path string `xml:"sourcepath,attr"` Message string `xml:"Message"` }
Sourceline describes a line inside a Java Class.
type Summary ¶
type Summary struct { ClassCount int `xml:"total_classes,attr"` ReferenceCount int `xml:"referenced_classes,attr"` BugCount int `xml:"total_bugs,attr"` Size int `xml:"total_size,attr"` PackageCount int `xml:"num_packages,attr"` SecondsCPU int `xml:"cpu_seconds,attr"` SecondsClock int `xml:"clock_seconds,attr"` SecondsGC int `xml:"gc_seconds,attr"` PeakMB int `xml:"peak_mbytes,attr"` AllocMB int `xml:"alloc_mbytes,attr"` Priority1 int `xml:"priority_1,attr"` Priority2 int `xml:"priority_2,attr"` Priority3 int `xml:"priority_3,attr"` Files []*FileStats `xml:"FileStats"` Packages []*PackageStats `xml:"PackageStats"` }
Summary provides statistics about Findbugs's execution on a package and file level. Furthermore it gives performance information such as memory usage and where time was spent.
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Findbugs is a tool.T used to run Findbugs on Java classes.
func New ¶
New creates a new instance of the Findbugs tool. If an error is returned, it will be due Findbugs not being configured correctly.