private void createIssue(AtKeywordTree tree) { PreciseIssue issue = addPreciseIssue( tree, "Move this @import rule before all the other at-rules and style rules."); precedingRules.stream().forEach(t -> issue.secondary(t, "Preceding rule")); }
private void addIssues() { for (Map.Entry<String, List<UriTree>> url : urls.entrySet()) { if (url.getValue().size() > 1) { PreciseIssue issue = addPreciseIssue(url.getValue().get(0), "Keep only one definition of those duplicated background images."); for (int i = 1; i < url.getValue().size(); i++) { issue.secondary(url.getValue().get(i), "Duplicated background image"); } } } }
private void createIssue(Map.Entry<String, List<Tree>> entry) { PreciseIssue issue = addPreciseIssue(entry.getValue().get(0), "Remove this duplicated font family."); for (int i = 1; i < entry.getValue().size(); i++) { issue.secondary(entry.getValue().get(i), "Duplicated font family"); } }
private void addIssues() { for (Map.Entry<String, List<UriTree>> url : urls.entrySet()) { if (url.getValue().size() > 1) { PreciseIssue issue = addPreciseIssue(url.getValue().get(0), "Keep only one definition of those duplicated background images."); for (int i = 1; i < url.getValue().size(); i++) { issue.secondary(url.getValue().get(i), "Duplicated background image"); } } } }
private void createIssue(AtKeywordTree tree) { PreciseIssue issue = addPreciseIssue( tree, "Move this @import rule before all the other at-rules and style rules."); precedingRules.stream().forEach(t -> issue.secondary(t, "Preceding rule")); }
private void createIssue(Map.Entry<String, List<Tree>> entry) { PreciseIssue issue = addPreciseIssue(entry.getValue().get(0), "Remove this duplicated font family."); for (int i = 1; i < entry.getValue().size(); i++) { issue.secondary(entry.getValue().get(i), "Duplicated font family"); } }
private void addIssue(StatementBlockTree statementBlockTree, PropertyTree propertyTree) { PreciseIssue issue = addPreciseIssue(statementBlockTree, "Alphabetically order these rule's properties."); issue.secondary(propertyTree, "First unproperly ordered property"); }
private void addIssue(StatementBlockTree statementBlockTree, PropertyTree propertyTree) { PreciseIssue issue = addPreciseIssue(statementBlockTree, "Alphabetically order these rule's properties."); issue.secondary(propertyTree, "First unproperly ordered property"); }
private void increaseAndCheckNestedLevel(Tree tree) { if (stack.size() == max) { PreciseIssue issue = addPreciseIssue(tree, String.format("Refactor this code to not nest more than %s rulesets.", max)); stack.forEach(t -> issue.secondary(t, "+1")); } stack.push(tree); }
private void increaseAndCheckNestedLevel(Tree tree) { if (stack.size() == max) { PreciseIssue issue = addPreciseIssue(tree, String.format("Refactor this code to not nest more than %s rulesets.", max)); stack.forEach(t -> issue.secondary(t, "+1")); } stack.push(tree); }
private void createIssues(Map<String, List<StatementBlockTree>> blocks) { for (Map.Entry<String, List<StatementBlockTree>> block : blocks.entrySet()) { if (block.getValue().size() > 1) { for (int i = 1; i < block.getValue().size(); i++) { PreciseIssue issue = addPreciseIssue( block.getValue().get(i), "This block duplicates the one at line " + block.getValue().get(0).openCurlyBrace().getLine() + "." + " Either update the block or the condition."); issue.secondary(block.getValue().get(0), "Duplicated block"); } } } }
private void increaseAndCheckNestedLevel(Tree tree) { if (stack.size() == max) { PreciseIssue issue = addPreciseIssue(tree, String.format("Refactor this code to not nest more than %s rulesets.", max)); stack.forEach(t -> issue.secondary(t, "+1")); } stack.push(tree); }
private void increaseAndCheckNestedLevel(Tree tree) { if (stack.size() == max) { PreciseIssue issue = addPreciseIssue(tree, String.format("Refactor this code to not nest more than %s rulesets.", max)); stack.forEach(t -> issue.secondary(t, "+1")); } stack.push(tree); }
private void createIssues(Map<String, List<ScssConditionTree>> conditions) { for (Map.Entry<String, List<ScssConditionTree>> condition : conditions.entrySet()) { if (condition.getValue().size() > 1) { for (int i = 1; i < condition.getValue().size(); i++) { PreciseIssue issue = addPreciseIssue( condition.getValue().get(i), "This condition duplicates the one at line " + condition.getValue().get(0).condition().firstValueElement().getLine() + "." + " Either remove or update this condition."); issue.secondary(condition.getValue().get(0), "Duplicated condition"); } } } }
private void createIssue(List<Usage> usages) { PreciseIssue issue = addPreciseIssue(usages.get(0).identifierTree(), "Merge those multiple variable declarations within the same scope."); for (int i = 1; i < usages.size(); i++) { issue.secondary(usages.get(i).identifierTree(), "Same variable declaration"); } }
private void createIssue(List<Usage> usages) { PreciseIssue issue = addPreciseIssue(usages.get(0).identifierTree(), "Merge those multiple variable declarations within the same scope."); for (int i = 1; i < usages.size(); i++) { issue.secondary(usages.get(i).identifierTree(), "Same variable declaration"); } }
private void increaseAndCheckNestedLevel(Tree tree) { if (stack.size() == max && !(tree instanceof ScssElseIfTree) && !(tree instanceof ScssElseTree)) { PreciseIssue issue = addPreciseIssue( ((ScssDirectiveConditionBlockTree) tree).directive(), String.format("Refactor this code to not nest more than %s control flow directives.", max)); stack.forEach(t -> issue.secondary( t instanceof ScssDirectiveConditionBlockTree ? ((ScssDirectiveConditionBlockTree) t).directive() : ((ScssElseTree) t).directive(), "+1")); } stack.push(tree); }
private void increaseAndCheckNestedLevel(Tree tree) { if (stack.size() == max && !(tree instanceof ScssElseIfTree) && !(tree instanceof ScssElseTree)) { PreciseIssue issue = addPreciseIssue( ((ScssDirectiveConditionBlockTree) tree).directive(), String.format("Refactor this code to not nest more than %s control flow directives.", max)); stack.forEach(t -> issue.secondary( t instanceof ScssDirectiveConditionBlockTree ? ((ScssDirectiveConditionBlockTree) t).directive() : ((ScssElseTree) t).directive(), "+1")); } stack.push(tree); }
private void addIssues(List<PropertyDeclarationTree> propertyDeclarationTrees, List<String> propertiesToNotUse) { for (PropertyDeclarationTree declaration : propertyDeclarationTrees) { String propertyName = declaration.property().standardProperty().getName(); if (propertiesToNotUse.contains(propertyName) && !isFloatNone(declaration)) { PreciseIssue issue = addPreciseIssue( declaration, "Remove this \"" + propertyName + "\" declaration that does not work with the \"display\" declaration."); issue.secondary(displayDeclaration, "\"display\" property declaration"); } } }
private void addIssues(List<PropertyDeclarationTree> propertyDeclarationTrees, List<String> propertiesToNotUse) { for (PropertyDeclarationTree declaration : propertyDeclarationTrees) { String propertyName = declaration.property().standardProperty().getName(); if (propertiesToNotUse.contains(propertyName) && !isFloatNone(declaration)) { PreciseIssue issue = addPreciseIssue( declaration, "Remove this \"" + propertyName + "\" declaration that does not work with the \"display\" declaration."); issue.secondary(displayDeclaration, "\"display\" property declaration"); } } }