org.codehaus.mojo.findbugs
Class Reporter

java.lang.Object
  extended by edu.umd.cs.findbugs.AbstractBugReporter
      extended by org.codehaus.mojo.findbugs.Reporter
All Implemented Interfaces:
edu.umd.cs.findbugs.ba.ClassObserver, edu.umd.cs.findbugs.ba.RepositoryLookupFailureCallback, edu.umd.cs.findbugs.BugReporter

public final class Reporter
extends edu.umd.cs.findbugs.AbstractBugReporter

The reporter controls the generation of the FindBugs report. It contains call back methods which gets called by FindBugs if a bug is found.

Version:
$Id: Reporter.java 2285 2006-08-28 18:19:09Z carlos $
Author:
$Author: cyrill $, Cyrill Ruettimann

Field Summary
 
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
 
Constructor Summary
Reporter(org.codehaus.doxia.sink.Sink pSink, ResourceBundle pBundle, org.apache.maven.plugin.logging.Log pLog, ThresholdParameter pThreshold, boolean pIsJXRReportEnabled, EffortParameter pEffort)
          Default constructor.
 
Method Summary
protected  void addBugReport(edu.umd.cs.findbugs.BugInstance pBugInstance)
          Adds a bug to the report.
protected  String assembleJXRHyperlink(edu.umd.cs.findbugs.SourceLineAnnotation pLine, String pLineNumber)
          Assembles the hyperlink to point to the source code.
protected  void closeClassReportSection()
          Closes the class report section.
protected  void doReportBug(edu.umd.cs.findbugs.BugInstance pBugInstance)
           
 void finish()
           
protected  String getDetailsLink(String pType)
          Gets the link to details description on findbugs site.
protected  String getEffortTitle()
          Gets the effort title of the report.
protected  String getFilesTitle()
          Gets the title for the files title.
protected  String getFindBugsLink()
          Gets the link to FindBugs.
protected  String getFindBugsName()
          Gets the name of FindBugs.
protected  String getFindBugsVersion()
          Gets the Findbugs Version of the report.
 edu.umd.cs.findbugs.BugReporter getRealBugReporter()
          Get the real bug reporter at the end of a chain of delegating bug reporters.
protected  String getReportLinkTitle()
          Gets the name of the link to FindBugs.
protected  String getReportTitle()
          Gets the report title.
protected  String getThresholdTitle()
          Gets the threshold title of the report.
protected  String getVersionTitle()
          Gets the Findbugs Version title of the report.
 void observeClass(org.apache.bcel.classfile.JavaClass clazz)
          Observe a class.
protected  void openClassReportSection()
          Initialised a bug report section in the report for a particular class.
 void reportAnalysisError(edu.umd.cs.findbugs.AnalysisError pAnalysisError)
          Report a queued error.
 void reportMissingClass(String pMissingClass)
          Report a missing class.
protected  String valueForLine(edu.umd.cs.findbugs.SourceLineAnnotation pLine)
          Return the value to display.
 
Methods inherited from class edu.umd.cs.findbugs.AbstractBugReporter
addObserver, getEngine, getMissingClassName, getProjectStats, logError, logError, notifyObservers, reportBug, reportMissingClass, reportQueuedErrors, reportSkippedAnalysis, setEngine, setErrorVerbosity, setPriorityThreshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reporter

public Reporter(org.codehaus.doxia.sink.Sink pSink,
                ResourceBundle pBundle,
                org.apache.maven.plugin.logging.Log pLog,
                ThresholdParameter pThreshold,
                boolean pIsJXRReportEnabled,
                EffortParameter pEffort)
Default constructor.

Parameters:
pSink - The sink to generate the report.
pBundle - The resource bundle to get the messages from.
pLog - The logger.
pThreshold - The threshold for the report.
pIsJXRReportEnabled - Is the jxr report plugin enabled.
pEffort - The used effort.
Method Detail

doReportBug

protected void doReportBug(edu.umd.cs.findbugs.BugInstance pBugInstance)
Specified by:
doReportBug in class edu.umd.cs.findbugs.AbstractBugReporter
Parameters:
pBugInstance - the bug to report
See Also:
#doReportBug(edu.umd.cs.findbugs.BugInstance)

reportAnalysisError

public void reportAnalysisError(edu.umd.cs.findbugs.AnalysisError pAnalysisError)
Report a queued error.

Specified by:
reportAnalysisError in class edu.umd.cs.findbugs.AbstractBugReporter
Parameters:
pAnalysisError - the queued error
See Also:
#reportAnalysisError(edu.umd.cs.findbugs.AnalysisError)

reportMissingClass

public void reportMissingClass(String pMissingClass)
Report a missing class.

Specified by:
reportMissingClass in class edu.umd.cs.findbugs.AbstractBugReporter
Parameters:
pMissingClass - the name of the class
See Also:
#reportMissingClass(java.lang.String)

finish

public void finish()
See Also:
BugReporter.finish()

getRealBugReporter

public edu.umd.cs.findbugs.BugReporter getRealBugReporter()
Get the real bug reporter at the end of a chain of delegating bug reporters. All non-delegating bug reporters should simply "return this".

Returns:
the real bug reporter at the end of the chain, or this object if there is no delegation
See Also:
BugReporter.getRealBugReporter()

observeClass

public void observeClass(org.apache.bcel.classfile.JavaClass clazz)
Observe a class.

Parameters:
clazz - the class
See Also:
#observeClass(org.apache.bcel.classfile.JavaClass)

closeClassReportSection

protected void closeClassReportSection()
Closes the class report section.


getVersionTitle

protected String getVersionTitle()
Gets the Findbugs Version title of the report.

Returns:
The Findbugs Version used on the report.

getFindBugsVersion

protected String getFindBugsVersion()
Gets the Findbugs Version of the report.

Returns:
The Findbugs Version used on the report.

getReportTitle

protected String getReportTitle()
Gets the report title.

Returns:
The report title.

getReportLinkTitle

protected String getReportLinkTitle()
Gets the name of the link to FindBugs.

Returns:
The report link title.

getFindBugsLink

protected String getFindBugsLink()
Gets the link to FindBugs.

Returns:
The report link.

getFindBugsName

protected String getFindBugsName()
Gets the name of FindBugs.

Returns:
The name of FindBugs.

getFilesTitle

protected String getFilesTitle()
Gets the title for the files title.

Returns:
The name of FindBugs.

getThresholdTitle

protected String getThresholdTitle()
Gets the threshold title of the report.

Returns:
The threshold title of the report.

getEffortTitle

protected String getEffortTitle()
Gets the effort title of the report.

Returns:
The effort title of the report.

getDetailsLink

protected String getDetailsLink(String pType)
Gets the link to details description on findbugs site.

Parameters:
pType - the bug type
Returns:
The report link.

addBugReport

protected void addBugReport(edu.umd.cs.findbugs.BugInstance pBugInstance)
Adds a bug to the report. A call to initialiseClassReport is needed prior to call addBugReport.

Parameters:
pBugInstance - The bug to add.

valueForLine

protected String valueForLine(edu.umd.cs.findbugs.SourceLineAnnotation pLine)
Return the value to display. If FindBugs does not provide a line number, a default message is returned. The line number otherwise.

Parameters:
pLine - The line to get the value from.
Returns:
The line number the bug appears or a statement that there is no source line available.

assembleJXRHyperlink

protected String assembleJXRHyperlink(edu.umd.cs.findbugs.SourceLineAnnotation pLine,
                                      String pLineNumber)
Assembles the hyperlink to point to the source code.

Parameters:
pLine - The line number object with the bug.
pLineNumber - The line number to show in the hyperlink.
Returns:
The hyperlink which points to the code.

openClassReportSection

protected void openClassReportSection()
Initialised a bug report section in the report for a particular class.



Copyright © 2006 null. All Rights Reserved.