hudson.plugins.serenitec
Class SerenitecResult

java.lang.Object
  extended by hudson.plugins.serenitec.SerenitecResult
All Implemented Interfaces:
hudson.model.ModelObject, EntriesProvider, java.io.Serializable

public class SerenitecResult
extends java.lang.Object
implements hudson.model.ModelObject, java.io.Serializable, EntriesProvider

Represents the results of the warning analysis. One instance of this class is persisted for each build via an XML file.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
SerenitecResult(hudson.model.AbstractBuild<?,?> build, Project project)
          Creates a new instance of WarningsResult.
SerenitecResult(hudson.model.AbstractBuild<?,?> build, Project project, EntriesContainer previousProject)
          Creates a new instance of SerenitecResult.
SerenitecResult(hudson.model.AbstractBuild<?,?> build, Project project, SerenitecResult previous)
          Creates a new instance of SerenitecResult.
 
Method Summary
 void doErrorBySeverityTrend(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Display the trend graph.
 void doPatternsBySeverityTrend(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Display the trend graph.
static float doPercentage(float _n1, float _n2)
          Compute the percentage ratio between two numbers.
 void doTopFiveTrend(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Display the trend graph.
 java.util.List<ReportEntry> getActiveEntry()
           
 EntriesContainer getContainer()
           
 int getDelta()
           
 java.lang.String getDetails()
          Returns the detail messages for the summary.jelly file.
 java.lang.String getDisplayName()
          
 java.lang.Object getDynamic(java.lang.String link, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Returns the dynamic result of the warnings analysis (a detail page for a module, package or warnings file or a detail object for new or fixed warnings).
 java.util.List<ReportEntry> getEntries()
          return entries
 java.util.List<ReportEntry> getEntriesFixed()
           
 java.util.List<ReportEntry> getEntriesNotFixed()
           
 ResultAction<?> getLastAction()
          Returns the last valid result action.
 hudson.model.AbstractBuild<?,?> getLastFinishedBuild()
          Returns the last finished build.
 int getMaxSeverityDiscovered()
           
 java.util.List<java.lang.String> getModifiedFiles()
           
 java.util.List<ReportEntry> getNewEntries()
           
 float getNumberMoyenneOfPointeursPerEntry()
           
 int getNumberOfEntry()
           
 int getNumberOfEntryBefore()
           
 int getNumberOfFixedEntry()
           
 int getNumberOfFixedEntryBefore()
           
 int getNumberOfFixedEntryPercent()
           
 int getNumberOfModules()
          Returns the number of modules in this project.
 int getNumberOfNewEntry()
           
 int getNumberOfNewEntryBefore()
           
 int getNumberOfNewEntryPercent()
           
 int getNumberOfNotFixedEntry()
           
 int getNumberOfNotFixedEntryBefore()
           
 int getNumberOfNotFixedEntryPercent()
           
 int getNumberOfPointeurs()
           
 int getNumberOfPointeursBefore()
           
 int getNumberOfRules()
           
 int getNumberOfRulesBefore()
           
 int getNumberOfSeverityDesign()
           
 int getNumberOfSeverityDesignBefore()
           
 int getNumberOfSeverityDesignPatterns()
           
 int getNumberOfSeverityDesignPercent()
           
 int getNumberOfSeverityFormatage()
           
 int getNumberOfSeverityFormatageBefore()
           
 int getNumberOfSeverityFormatagePatterns()
           
 int getNumberOfSeverityFormatagePercent()
           
 int getNumberOfSeverityHighSecurity()
           
 int getNumberOfSeverityHighSecurityBefore()
           
 int getNumberOfSeverityHighSecurityPatterns()
           
 int getNumberOfSeverityHighSecurityPercent()
           
 int getNumberOfSeverityLowSecurity()
           
 int getNumberOfSeverityLowSecurityBefore()
           
 int getNumberOfSeverityLowSecurityPatterns()
           
 int getNumberOfSeverityLowSecurityPercent()
           
 int getNumberOfSeverityPerformance()
           
 int getNumberOfSeverityPerformanceBefore()
           
 int getNumberOfSeverityPerformancePatterns()
           
 int getNumberOfSeverityPerformancePercent()
           
 hudson.model.AbstractBuild<?,?> getOwner()
          Returns the build as owner of this action.
 int getPreviousNumberOfWarnings(java.lang.String packageName)
          Returns the number of warnings of the specified package in the previous build.
 Project getPreviousResult()
          Returns the results of the previous build.
 Project getProject()
          Returns the associated project of this result.
 Project getProjectSerenitec()
           
 java.util.List<ReportEntry> getRules()
           
 java.util.List<ReportEntry> getTopFiveEntries()
           
 java.util.List<ReportEntry> getTopFiveEntriesBefore()
           
 boolean hasEntries()
           
 boolean hasError()
          Returns whether a module with an error is part of this project.
 boolean hasPreviousResult()
          Returns whether a previous build result exists.
 boolean hasRules()
           
 void initialize(hudson.model.AbstractBuild<?,?> build, Project project, EntriesContainer previousProject)
           
 boolean isCurrent()
          Returns whether this result belongs to the last build.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerenitecResult

public SerenitecResult(hudson.model.AbstractBuild<?,?> build,
                       Project project)
Creates a new instance of WarningsResult.

Parameters:
build - the current build as owner of this action
project - the parsed warnings result

SerenitecResult

public SerenitecResult(hudson.model.AbstractBuild<?,?> build,
                       Project project,
                       SerenitecResult previous)
Creates a new instance of SerenitecResult.

Parameters:
build - the current build as owner of this action
project - the parsed warnings result
previous - the result of the previous build

SerenitecResult

public SerenitecResult(hudson.model.AbstractBuild<?,?> build,
                       Project project,
                       EntriesContainer previousProject)
Creates a new instance of SerenitecResult.

Parameters:
build - the current build as owner of this action
project - the parsed warnings result
previousProject - the parsed warnings result of the previous build
Method Detail

doPercentage

public static float doPercentage(float _n1,
                                 float _n2)
Compute the percentage ratio between two numbers.

Parameters:
_n1 -
_n2 -
Returns:

initialize

public void initialize(hudson.model.AbstractBuild<?,?> build,
                       Project project,
                       EntriesContainer previousProject)

doErrorBySeverityTrend

public void doErrorBySeverityTrend(org.kohsuke.stapler.StaplerRequest request,
                                   org.kohsuke.stapler.StaplerResponse response)
                            throws java.io.IOException
Display the trend graph. Delegates to the the associated ResultAction.

Parameters:
request - Stapler request
response - Stapler response
Throws:
java.io.IOException - in case of an error in ResultAction.doGraph(StaplerRequest, StaplerResponse, int)

doPatternsBySeverityTrend

public void doPatternsBySeverityTrend(org.kohsuke.stapler.StaplerRequest request,
                                      org.kohsuke.stapler.StaplerResponse response)
                               throws java.io.IOException
Display the trend graph. Delegates to the the associated ResultAction.

Parameters:
request - Stapler request
response - Stapler response
Throws:
java.io.IOException - in case of an error in ResultAction.doGraph(StaplerRequest, StaplerResponse, int)

doTopFiveTrend

public void doTopFiveTrend(org.kohsuke.stapler.StaplerRequest request,
                           org.kohsuke.stapler.StaplerResponse response)
                    throws java.io.IOException
Display the trend graph. Delegates to the the associated ResultAction.

Parameters:
request - Stapler request
response - Stapler response
Throws:
java.io.IOException - in case of an error in ResultAction.doGraph(StaplerRequest, StaplerResponse, int)

getLastAction

public ResultAction<?> getLastAction()
Returns the last valid result action.

Returns:
the last valid result action, or null if no such action is found

getLastFinishedBuild

public hudson.model.AbstractBuild<?,?> getLastFinishedBuild()
Returns the last finished build.

Returns:
the last finished build or null if there is no such build

getModifiedFiles

public java.util.List<java.lang.String> getModifiedFiles()

getContainer

public EntriesContainer getContainer()

getDelta

public int getDelta()
Returns:
the delta

getDetails

public java.lang.String getDetails()
Returns the detail messages for the summary.jelly file.

Returns:
the summary message

getDisplayName

public java.lang.String getDisplayName()

Specified by:
getDisplayName in interface hudson.model.ModelObject

getDynamic

public java.lang.Object getDynamic(java.lang.String link,
                                   org.kohsuke.stapler.StaplerRequest request,
                                   org.kohsuke.stapler.StaplerResponse response)
Returns the dynamic result of the warnings analysis (a detail page for a module, package or warnings file or a detail object for new or fixed warnings).

Parameters:
link - the link to identify the sub page to show
request - Stapler request
response - Stapler response
Returns:
the dynamic result of the warnings analysis (detail page for a package).

getNumberOfRules

public final int getNumberOfRules()
Specified by:
getNumberOfRules in interface EntriesProvider
Returns:
the number of rules

getNumberOfRulesBefore

public int getNumberOfRulesBefore()
Returns:
the number of rules before

getEntries

public java.util.List<ReportEntry> getEntries()
Description copied from interface: EntriesProvider
return entries

Specified by:
getEntries in interface EntriesProvider
Returns:
the entries

getEntriesFixed

public java.util.List<ReportEntry> getEntriesFixed()
Specified by:
getEntriesFixed in interface EntriesProvider
Returns:
the entriesfixed

getEntriesNotFixed

public java.util.List<ReportEntry> getEntriesNotFixed()
Specified by:
getEntriesNotFixed in interface EntriesProvider
Returns:
the entriesnotfixed

getMaxSeverityDiscovered

public int getMaxSeverityDiscovered()
Specified by:
getMaxSeverityDiscovered in interface EntriesProvider
Returns:
the hightest severity entry discovered

getActiveEntry

public java.util.List<ReportEntry> getActiveEntry()

getNewEntries

public java.util.List<ReportEntry> getNewEntries()
Returns:
the newEntries

getNumberMoyenneOfPointeursPerEntry

public float getNumberMoyenneOfPointeursPerEntry()
Returns:
the numberMoyenneOfPointeursPerEntry

getNumberOfEntry

public int getNumberOfEntry()
Specified by:
getNumberOfEntry in interface EntriesProvider
Returns:
the numberOfEntry

getNumberOfEntryBefore

public int getNumberOfEntryBefore()
Returns:
the numberOfEntryBefore

getNumberOfFixedEntry

public int getNumberOfFixedEntry()
Specified by:
getNumberOfFixedEntry in interface EntriesProvider
Returns:
the numberOfFixedEntry

getNumberOfFixedEntryBefore

public int getNumberOfFixedEntryBefore()
Returns:
the numberOfFixedEntryBefore

getNumberOfFixedEntryPercent

public int getNumberOfFixedEntryPercent()
Returns:
the numberOfFixedEntryPercent

getNumberOfModules

public int getNumberOfModules()
Returns the number of modules in this project.

Returns:
the number of modules

getNumberOfNewEntry

public int getNumberOfNewEntry()
Specified by:
getNumberOfNewEntry in interface EntriesProvider
Returns:
the numberOfNewEntry

getNumberOfNewEntryBefore

public int getNumberOfNewEntryBefore()
Returns:
the numberOfNewEntryBefore

getNumberOfNewEntryPercent

public int getNumberOfNewEntryPercent()
Returns:
the numberOfNewEntryPercent

getNumberOfNotFixedEntry

public int getNumberOfNotFixedEntry()
Specified by:
getNumberOfNotFixedEntry in interface EntriesProvider
Returns:
the numberOfNotFixedEntry

getNumberOfNotFixedEntryBefore

public int getNumberOfNotFixedEntryBefore()
Returns:
the numberOfNotFixedEntryBefore

getNumberOfNotFixedEntryPercent

public int getNumberOfNotFixedEntryPercent()
Returns:
the numberOfNotFixedEntryPercent

getNumberOfPointeurs

public int getNumberOfPointeurs()
Specified by:
getNumberOfPointeurs in interface EntriesProvider
Returns:
the numberOfPointeurs

getNumberOfPointeursBefore

public int getNumberOfPointeursBefore()
Returns:
the numberOfPointeursBefore

getNumberOfSeverityDesign

public int getNumberOfSeverityDesign()
Specified by:
getNumberOfSeverityDesign in interface EntriesProvider
Returns:
the numberOfSeverityDesign

getNumberOfSeverityDesignBefore

public int getNumberOfSeverityDesignBefore()
Returns:
the numberOfSeverityDesignBefore

getNumberOfSeverityDesignPercent

public int getNumberOfSeverityDesignPercent()
Returns:
the numberOfSeverityDesignPercent

getNumberOfSeverityFormatage

public int getNumberOfSeverityFormatage()
Specified by:
getNumberOfSeverityFormatage in interface EntriesProvider
Returns:
the numberOfSeverityFormatage

getNumberOfSeverityFormatageBefore

public int getNumberOfSeverityFormatageBefore()
Returns:
the numberOfSeverityFormatageBefore

getNumberOfSeverityFormatagePercent

public int getNumberOfSeverityFormatagePercent()
Returns:
the numberOfSeverityFormatagePercent

getNumberOfSeverityHighSecurity

public int getNumberOfSeverityHighSecurity()
Specified by:
getNumberOfSeverityHighSecurity in interface EntriesProvider
Returns:
the numberOfSeverityHighSecurity

getNumberOfSeverityHighSecurityBefore

public int getNumberOfSeverityHighSecurityBefore()
Returns:
the numberOfSeverityHighSecurityBefore

getNumberOfSeverityHighSecurityPercent

public int getNumberOfSeverityHighSecurityPercent()
Returns:
the numberOfSeverityHighSecurityPercent

getNumberOfSeverityLowSecurity

public int getNumberOfSeverityLowSecurity()
Specified by:
getNumberOfSeverityLowSecurity in interface EntriesProvider
Returns:
the numberOfSeverityLowSecurity

getNumberOfSeverityLowSecurityBefore

public int getNumberOfSeverityLowSecurityBefore()
Returns:
the numberOfSeverityLowSecurityBefore

getNumberOfSeverityLowSecurityPercent

public int getNumberOfSeverityLowSecurityPercent()
Returns:
the numberOfSeverityLowSecurityPercent

getNumberOfSeverityPerformance

public int getNumberOfSeverityPerformance()
Specified by:
getNumberOfSeverityPerformance in interface EntriesProvider
Returns:
the numberOfSeverityPerformance

getNumberOfSeverityPerformanceBefore

public int getNumberOfSeverityPerformanceBefore()
Returns:
the numberOfSeverityPerformanceBefore

getNumberOfSeverityPerformancePercent

public int getNumberOfSeverityPerformancePercent()
Returns:
the numberOfSeverityPerformancePercent

getOwner

public final hudson.model.AbstractBuild<?,?> getOwner()
Returns the build as owner of this action.

Returns:
the owner

getPreviousNumberOfWarnings

public int getPreviousNumberOfWarnings(java.lang.String packageName)
Returns the number of warnings of the specified package in the previous build.

Parameters:
packageName - the package to return the warnings for
Returns:
number of warnings of the specified package.

getPreviousResult

public Project getPreviousResult()
Returns the results of the previous build.

Returns:
the result of the previous build, or null if no such build exists

getProject

public Project getProject()
Returns the associated project of this result.

Returns:
the associated project of this result.

getProjectSerenitec

public Project getProjectSerenitec()

getTopFiveEntries

public java.util.List<ReportEntry> getTopFiveEntries()
Specified by:
getTopFiveEntries in interface EntriesProvider
Returns:
the topFiveEntries

getTopFiveEntriesBefore

public java.util.List<ReportEntry> getTopFiveEntriesBefore()
Returns:
the topFiveEntriesBefore

hasRules

public boolean hasRules()
Returns:
if it has rules

hasEntries

public boolean hasEntries()
Returns:
if it has entries

hasError

public boolean hasError()
Returns whether a module with an error is part of this project.

Returns:
true if at least one module has an error.

hasPreviousResult

public boolean hasPreviousResult()
Returns whether a previous build result exists.

Returns:
true if a previous build result exists.

isCurrent

public final boolean isCurrent()
Returns whether this result belongs to the last build.

Returns:
true if this result belongs to the last build

getRules

public java.util.List<ReportEntry> getRules()
Specified by:
getRules in interface EntriesProvider
Returns:
rules

getNumberOfSeverityDesignPatterns

public int getNumberOfSeverityDesignPatterns()
Specified by:
getNumberOfSeverityDesignPatterns in interface EntriesProvider
Returns:
the numberOfSeverityDesignPatterns

getNumberOfSeverityFormatagePatterns

public int getNumberOfSeverityFormatagePatterns()
Specified by:
getNumberOfSeverityFormatagePatterns in interface EntriesProvider
Returns:
the numberOfSeverityFormatagePatterns

getNumberOfSeverityHighSecurityPatterns

public int getNumberOfSeverityHighSecurityPatterns()
Specified by:
getNumberOfSeverityHighSecurityPatterns in interface EntriesProvider
Returns:
the numberOfSeverityHighSecurityPatterns

getNumberOfSeverityLowSecurityPatterns

public int getNumberOfSeverityLowSecurityPatterns()
Specified by:
getNumberOfSeverityLowSecurityPatterns in interface EntriesProvider
Returns:
the numberOfSeverityLowSecurityPatterns

getNumberOfSeverityPerformancePatterns

public int getNumberOfSeverityPerformancePatterns()
Specified by:
getNumberOfSeverityPerformancePatterns in interface EntriesProvider
Returns:
the numberOfSeverityPerformancePatterns


Copyright © 2008. All Rights Reserved.