protected Effort buildEffort(T meta) { Effort effort = this.calculateEffort(meta.getDecorations()); return effort; }
protected void populateResourceData(T meta, File reportDirectory, ResourceData data) { if(data == null) { throw new IllegalArgumentException("ResourceData must not be null."); } File file = meta.getFilePointer(); data.setSyntax(buildSyntax()); data.setDecorations(meta.getDecorations()); data.setRelativePathToRoot(ReportUtil.calculateRelativePathToRoot(reportDirectory, file)); data.setRelativePathFromRoot(ReportUtil.calculateRelativePathFromRoot(reportDirectory, file)); }
protected String buildTitle(T meta, File rootDirectory) { String title = StringUtils.removeStart(meta.getFilePointer().getAbsolutePath(), rootDirectory.getAbsolutePath()); title = StringUtils.replace(title, "\\", "/"); title = StringUtils.removeStart(title, "/"); if(meta instanceof FileMetadata) { String starter = ((FileMetadata)meta).getArchiveMeta().getRelativePath(); if(LOG.isDebugEnabled()) { LOG.debug("Removing: " + starter + " from "+title); } title = StringUtils.removeStart(title, starter); } title = StringUtils.removeStart(title, "/"); return title; }
for (AbstractDecoration result : meta.getDecorations()) { if (result instanceof Line && result.getLevel().isLevel(NotificationLevel.WARNING)) { lrs.add((Line) result); int numLines = FileUtils.readLines(meta.getFilePointer()).size(); int twentyPercent = (int) Math.floor(numLines * 0.2); LOG.debug("File: " + meta.getFilePointer().getAbsolutePath()); LOG.debug("Number of lines: " + numLines); LOG.debug("20 Percent: " + twentyPercent);
protected String buildSummary(T meta) { StringBuilder summary = new StringBuilder(); for (AbstractDecoration result : meta.getDecorations()) { if (result instanceof Classification) { summary.append("Classification: "+result.getDescription() + "<br />"); } if (result instanceof Summary) { summary.append(result.getDescription() + "<br />"); } } return summary.toString(); }