-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create bean.
- Loading branch information
Showing
28 changed files
with
312 additions
and
1,464 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
/.project | ||
/.classpath | ||
/target | ||
/work |
55 changes: 55 additions & 0 deletions
55
src/main/java/org/jenkinsci/plugins/vs_code_metrics/AbstractReport.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,55 @@ | ||
package org.jenkinsci.plugins.vs_code_metrics; | ||
|
||
import hudson.model.AbstractBuild; | ||
import hudson.model.ModelObject; | ||
|
||
import java.io.Serializable; | ||
|
||
import org.kohsuke.stapler.StaplerRequest; | ||
import org.kohsuke.stapler.StaplerResponse; | ||
|
||
public abstract class AbstractReport implements Serializable, ModelObject { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private AbstractBuild<?,?> build; | ||
private String name; | ||
private boolean depthOfInheritance = true; | ||
|
||
public void setBuild(AbstractBuild<?, ?> build) { | ||
this.build = build; | ||
} | ||
|
||
public AbstractBuild<?, ?> getBuild() { | ||
return build; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDisplayName() { | ||
return name; | ||
} | ||
|
||
public boolean isDepthOfInheritance() { | ||
return depthOfInheritance; | ||
} | ||
|
||
public void setDepthOfInheritance(boolean depthOfInheritance) { | ||
this.depthOfInheritance = depthOfInheritance; | ||
} | ||
|
||
public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) { | ||
return getReport(token); | ||
} | ||
|
||
public abstract Object getReport(String token); | ||
|
||
public abstract Object getChildren(); | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/org/jenkinsci/plugins/vs_code_metrics/CodeMetricsReport.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,35 @@ | ||
package org.jenkinsci.plugins.vs_code_metrics; | ||
|
||
import hudson.model.AbstractBuild; | ||
|
||
import org.jenkinsci.plugins.vs_code_metrics.bean.CodeMetrics; | ||
|
||
|
||
public final class CodeMetricsReport extends AbstractReport { | ||
|
||
private final CodeMetrics result; | ||
|
||
/** | ||
* | ||
* @param build | ||
* @param result | ||
*/ | ||
public CodeMetricsReport(AbstractBuild<?,?> build, CodeMetrics result) { | ||
this.result = result; | ||
setBuild(build); | ||
setName("VsCodeMetrics"); | ||
} | ||
|
||
@Override | ||
public Object getReport(String token) { | ||
if (result.getChildren().containsKey(token)) | ||
return null; | ||
else | ||
return null; | ||
} | ||
|
||
@Override | ||
public Object getChildren() { | ||
return result.getChildren(); | ||
} | ||
} |
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
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
17 changes: 17 additions & 0 deletions
17
src/main/java/org/jenkinsci/plugins/vs_code_metrics/bean/AbstractBean.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,17 @@ | ||
package org.jenkinsci.plugins.vs_code_metrics.bean; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public abstract class AbstractBean<CHILD extends Metrics> extends Metrics { | ||
|
||
private Map<String, CHILD> children = new HashMap<String, CHILD>(); | ||
|
||
public void addChild(CHILD child) { | ||
children.put(child.getName(), child); | ||
} | ||
|
||
public Map<String, CHILD> getChildren() { | ||
return children; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/org/jenkinsci/plugins/vs_code_metrics/bean/CodeMetrics.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,5 @@ | ||
package org.jenkinsci.plugins.vs_code_metrics.bean; | ||
|
||
public final class CodeMetrics extends AbstractBean<Module> { | ||
|
||
} |
91 changes: 0 additions & 91 deletions
91
src/main/java/org/jenkinsci/plugins/vs_code_metrics/bean/CodeMetricsReport.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.