@Override public boolean process(AbstractDecoration result) { Matcher matcher = regexPattern.matcher(result.getPattern()); while (matcher.find()) { LOG.debug("Matched: " + result.getPattern() + " as whitelist. "); return true; } return false; } }
protected List<AbstractDecoration> matchResults(FileMetadata meta) { List<AbstractDecoration> results = new LinkedList<AbstractDecoration>(); for (AbstractDecoration rst : meta.getDecorations()) { if (regexPattern.matcher(rst.getPattern()).find()) { results.add(rst); } } return results; }
protected static int calcTotalChanges(JavaMetadata result) { int totalChanges = 0; Set<String> blkTemp = new HashSet<String>(); for (AbstractDecoration dr : result.getDecorations()) { if (dr instanceof JavaLine) { blkTemp.add("Blacklisted: " + dr.getPattern()); totalChanges++; } } return totalChanges; }
public static Map<String, Integer> extractData(ArchiveReport ar, Map<String, Integer> data) { // summarize results. String pattern; int val = 0; String[] keyArray; for (ResourceReport report : ar.getResourceReports()) { for (AbstractDecoration result : report.getDecorations()) { if (result instanceof Line) { val = 1; pattern = result.getPattern(); keyArray = pattern.split("\\."); pattern = (keyArray.length > 1) ? keyArray[0] + "." + keyArray[1] + ".*" : pattern; if (data.containsKey(pattern)) { val = data.get(pattern); val++; } data.put(pattern, val); } } } return data; }
@Override public void processMeta(FileMetadata file) { for (AbstractDecoration dr : file.getDecorations()) { if (LOG.isDebugEnabled()) { LOG.debug("Applying notification to: " + matchingProcessors.size() + " for decoration: " + dr.getPattern()); } for (MatchingProcessor hp : matchingProcessors) { // if it matches, set it. if (hp.process(dr)) { if (LOG.isDebugEnabled()) { LOG.debug("Matched. Setting Notification: " + notificationLevel); } dr.setLevel(notificationLevel); } } } } }
@Override protected List<AbstractDecoration> matchResults(FileMetadata meta) { List<AbstractDecoration> results = new LinkedList<AbstractDecoration>(); for (AbstractDecoration dr : meta.getDecorations()) { if (dr instanceof JavaLine) { JavaLine result = (JavaLine) dr; if (sourceType != null) { if (result.getSourceType() != sourceType) { // not of interest. continue; } } if (regexPattern.matcher(dr.getPattern()).find()) { results.add(dr); } } } return results; } }
@Override public void processMeta(FileMetadata file) { for (AbstractDecoration dr : file.getDecorations()) { if (LOG.isDebugEnabled()) { LOG.debug("Applying notification to: " + matchingProcessors.size() + " for decoration: " + dr.getPattern()); } for (MatchingProcessor hp : matchingProcessors) { // if it matches, set it. if (hp.process(dr)) { if (LOG.isDebugEnabled()) { LOG.debug("Matched. Setting Notification: " + notificationLevel); } dr.setLevel(notificationLevel); } } } } }
@Override public void process(AbstractDecoration result) { if (regexPattern.matcher(result.getPattern()).find()) { MarkdownHint sh = new MarkdownHint(); sh.setMarkdown(hint); result.getHints().add(sh); if (notificationLevel != null) { result.setLevel(notificationLevel); } if (effort != null) { result.setEffort(effort); } } } }
@Override protected List<AbstractDecoration> matchResults(FileMetadata meta) { // only process classification. List<AbstractDecoration> matched = super.matchResults(meta); List<AbstractDecoration> results = new ArrayList<AbstractDecoration>(1); if (matched != null && matched.size() > 0) { // create classification, with the same pattern. Classification cr = new Classification(); cr.setDescription(matchDescription); cr.setEffort(effort); cr.setPattern(matched.get(0).getPattern()); meta.getDecorations().add(cr); results.add(cr); } return results; } }
description.append("<ul class='notifications'>"); for (AbstractDecoration blkList : blkTemp) { description.append("<li class='" + blkList.getLevel().toString().toLowerCase() + "'>" + blkList.getPattern() + "</li>");