This repository has been archived by the owner on Feb 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:jenkinsci/pmd-plugin
- Loading branch information
Showing
5 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/hudson/plugins/pmd/dashboard/WarningsUserGraphPortlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package hudson.plugins.pmd.dashboard; | ||
|
||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
import hudson.Extension; | ||
import hudson.model.Descriptor; | ||
import hudson.plugins.analysis.core.AbstractProjectAction; | ||
import hudson.plugins.analysis.dashboard.AbstractWarningsGraphPortlet; | ||
import hudson.plugins.analysis.graph.AnnotationsByUserGraph; | ||
import hudson.plugins.analysis.graph.BuildResultGraph; | ||
import hudson.plugins.pmd.Messages; | ||
import hudson.plugins.pmd.PmdProjectAction; | ||
import hudson.plugins.view.dashboard.DashboardPortlet; | ||
|
||
/** | ||
* A portlet that shows the warnings of the last build by user and priority. | ||
* | ||
* @author Ulli Hafner | ||
*/ | ||
public final class WarningsUserGraphPortlet extends AbstractWarningsGraphPortlet { | ||
/** | ||
* Creates a new instance of {@link WarningsUserGraphPortlet}. | ||
* | ||
* @param name | ||
* the name of the portlet | ||
* @param width | ||
* width of the graph | ||
* @param height | ||
* height of the graph | ||
* @param dayCountString | ||
* number of days to consider | ||
*/ | ||
@DataBoundConstructor | ||
public WarningsUserGraphPortlet(final String name, final String width, final String height, final String dayCountString) { | ||
super(name, width, height, dayCountString); | ||
|
||
configureGraph(getGraphType()); | ||
} | ||
|
||
@Override | ||
protected Class<? extends AbstractProjectAction<?>> getAction() { | ||
return PmdProjectAction.class; | ||
} | ||
|
||
@Override | ||
protected String getPluginName() { | ||
return "pmd"; | ||
} | ||
|
||
@Override | ||
protected BuildResultGraph getGraphType() { | ||
return new AnnotationsByUserGraph(); | ||
} | ||
|
||
/** | ||
* Extension point registration. | ||
* | ||
* @author Ulli Hafner | ||
*/ | ||
@Extension(optional = true) | ||
public static class WarningsGraphDescriptor extends Descriptor<DashboardPortlet> { | ||
@Override | ||
public String getDisplayName() { | ||
return Messages.Portlet_WarningsUserGraph(); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters