Source:
<code>public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; SymbolMetadata symbolMetadata = methodTree.symbol().metadata(); boolean hasIgnoreAnnotation = isSilentlyIgnored(symbolMetadata, "org.junit.Ignore"); boolean hasDisabledAnnotation = isSilentlyIgnored(symbolMetadata, "org.junit.jupiter.api.Disabled"); if (hasIgnoreAnnotation || hasDisabledAnnotation) { reportIssue(methodTree.simpleName(), String.format("Either add an explanation about why this test is skipped or remove the " + "\"@%s\" annotation.", hasIgnoreAnnotation ? "Ignore" : "Disabled")); } BlockTree block = methodTree.block(); if (block != null) { block.body().stream() .filter(s -> s.is(Tree.Kind.EXPRESSION_STATEMENT)) .map(s -> ((ExpressionStatementTree) s).expression()) .filter(s -> s.is(Tree.Kind.METHOD_INVOCATION)) .map(MethodInvocationTree.class::cast) .filter(ASSUME_METHODS::matches) .filter(IgnoredTestsCheck::hasConstantOppositeArg) <START> .forEach(mit -> reportIssue(mit, "Either remove this assumption or use an @Ignore or @Disabled annotation in combination with " + <END> "an explanation about why this test is skipped.")); } }</code><technical_language>a general observation, tree is reported, define is highlighted in products, if tree is big, result in ugly. This is especially true for method invocation: arguments unusually long, a huge lambda for example! In this case, true false, wrong... it? First, more literals, if line 78, .asConstant(Boolean.class); checks if tree is a reference a constant. this code: java private static final boolean ignoreTest = false; // ... assumeTrue(ignoreTest); report issue. Then, if is strange formatting, fully qualified name... Putting together, end that: java org.junit.Assume.assumeTrue( // assumeTrue ignore test ... MyLongTestHelperClass.IGNORE_TEST_WITH_ASSUME_TRUE ); highlighted! I agree this is happen, illustrates wrong! I reporting method name is enough here. way, ExpressionUtils::methodName for this purpose</technical_language>

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; SymbolMetadata symbolMetadata = methodTree.symbol().metadata(); boolean hasIgnoreAnnotation = isSilentlyIgnored(symbolMetadata, "org.junit.Ignore"); boolean hasDisabledAnnotation = isSilentlyIgnored(symbolMetadata, "org.junit.jupiter.api.Disabled"); if (hasIgnoreAnnotation || hasDisabledAnnotation) { reportIssue(methodTree.simpleName(), String.format("Either add an explanation about why this test is skipped or remove the " + "\"@%s\" annotation.", hasIgnoreAnnotation ? "Ignore" : "Disabled")); } BlockTree block = methodTree.block(); if (block != null) { block.body().stream() .filter(s -> s.is(Tree.Kind.EXPRESSION_STATEMENT)) .map(s -> ((ExpressionStatementTree) s).expression()) .filter(s -> s.is(Tree.Kind.METHOD_INVOCATION)) .map(MethodInvocationTree.class::cast) .filter(ASSUME_METHODS::matches) .filter(IgnoredTestsCheck::hasConstantOppositeArg) .forEach(mit -> { List<JavaFileScannerContext.Location> secondaryLocation = Collections.singletonList(new JavaFileScannerContext.Location( "A constant boolean value is passed as argument, causing this test to always be skipped.", mit.arguments())); reportIssue(ExpressionUtils.methodName(mit), "This assumption is called with a constant boolean. Either remove it or, to skip " + "this test, use an @Ignore or @Disabled annotation in combination with an explanation about why this test is skipped.", secondaryLocation, null); }); } }