/** * <p> * Returns the total effort points in all of the {@link InlineHintModel}s * associated with the {@link FileModel} instances in the given {@link ProjectModelTraversal}. * </p> * <p> * If set to recursive, then also include the effort points from child projects. * </p> * <p> * The result is a Map, the key contains the effort level and the value contains the number of incidents. * </p> */ public Map<Integer, Integer> getMigrationEffortByPoints( ProjectModelTraversal traversal, Set<String> includeTags, Set<String> excludeTags, Set<String> issueCategoryIDs, boolean recursive, boolean includeZero) { MapSumEffortAccumulatorFunction<Integer> accumulator = new MapSumEffortAccumulatorFunction(){ public Object vertexToKey(Vertex effortReportVertex) { Integer migrationEffort = (Integer)effortReportVertex.property(EffortReportModel.EFFORT).value(); return migrationEffort; } }; getMigrationEffortDetails(traversal, includeTags, excludeTags, issueCategoryIDs, recursive, includeZero, accumulator); return accumulator.getResults(); }
/** * Returns the total incidents in all of the {@link InlineHintModel}s associated with the files in this project by severity. */ public Map<IssueCategoryModel, Integer> getMigrationEffortBySeverity(GraphRewrite event, ProjectModelTraversal traversal, Set<String> includeTags, Set<String> excludeTags, Set<String> issueCategoryIDs, boolean recursive) { MapSumEffortAccumulatorFunction<IssueCategoryModel> accumulator = new MapSumEffortAccumulatorFunction<IssueCategoryModel>() { public IssueCategoryModel vertexToKey(Vertex effortReportVertex) { return frame(effortReportVertex).getIssueCategory(); } @Override public void accumulate(Vertex effortReportVertex) { /* * If it is a detail only issue, then summaries should not include it in the count. */ if (frame(effortReportVertex).getIssueDisplayMode() == IssueDisplayMode.DETAIL_ONLY) return; super.accumulate(effortReportVertex); } }; this.getMigrationEffortDetails(traversal, includeTags, excludeTags, issueCategoryIDs, recursive, true, accumulator); return accumulator.getResults(); }
/** * <p> * Returns the total effort points in all of the {@link InlineHintModel}s * associated with the {@link FileModel} instances in the given {@link ProjectModelTraversal}. * </p> * <p> * If set to recursive, then also include the effort points from child projects. * </p> * <p> * The result is a Map, the key contains the effort level and the value contains the number of incidents. * </p> */ public Map<Integer, Integer> getMigrationEffortByPoints( ProjectModelTraversal traversal, Set<String> includeTags, Set<String> excludeTags, Set<String> issueCategoryIDs, boolean recursive, boolean includeZero) { MapSumEffortAccumulatorFunction<Integer> accumulator = new MapSumEffortAccumulatorFunction(){ public Object vertexToKey(Vertex effortReportVertex) { Integer migrationEffort = (Integer)effortReportVertex.property(EffortReportModel.EFFORT).value(); return migrationEffort; } }; getMigrationEffortDetails(traversal, includeTags, excludeTags, issueCategoryIDs, recursive, includeZero, accumulator); return accumulator.getResults(); }
/** * Returns the total incidents in all of the {@link InlineHintModel}s associated with the files in this project by severity. */ public Map<IssueCategoryModel, Integer> getMigrationEffortBySeverity(GraphRewrite event, ProjectModelTraversal traversal, Set<String> includeTags, Set<String> excludeTags, Set<String> issueCategoryIDs, boolean recursive) { MapSumEffortAccumulatorFunction<IssueCategoryModel> accumulator = new MapSumEffortAccumulatorFunction<IssueCategoryModel>() { public IssueCategoryModel vertexToKey(Vertex effortReportVertex) { return frame(effortReportVertex).getIssueCategory(); } @Override public void accumulate(Vertex effortReportVertex) { /* * If it is a detail only issue, then summaries should not include it in the count. */ if (frame(effortReportVertex).getIssueDisplayMode() == IssueDisplayMode.DETAIL_ONLY) return; super.accumulate(effortReportVertex); } }; this.getMigrationEffortDetails(traversal, includeTags, excludeTags, issueCategoryIDs, recursive, true, accumulator); return accumulator.getResults(); }