1 /*
2 ClassFanOutComplexity
3 max = 0
4 excludedClasses = (default)ArrayIndexOutOfBoundsException, ArrayList, Boolean, Byte, \
5 Character, Class, Collection, Deprecated, Deque, Double, DoubleStream, \
6 EnumSet, Exception, Float, FunctionalInterface, HashMap, HashSet, \
7 IllegalArgumentException, IllegalStateException, IndexOutOfBoundsException, \
8 IntStream, Integer, LinkedHashMap, LinkedHashSet, LinkedList, List, Long, \
9 LongStream, Map, NullPointerException, Object, Optional, OptionalDouble, \
10 OptionalInt, OptionalLong, Override, Queue, RuntimeException, SafeVarargs, \
11 SecurityException, Set, Short, SortedMap, SortedSet, Stream, String, \
12 StringBuffer, StringBuilder, SuppressWarnings, Throwable, TreeMap, TreeSet, \
13 UnsupportedOperationException, Void, boolean, byte, char, double, float, \
14 int, long, short, var, void
15 excludedPackages = (default)
16
17
18 */
19
20 package com.puppycrawl.tools.checkstyle.checks.metrics.classfanoutcomplexity;
21
22 import java.util.List;
23 import java.util.Map;
24 import java.util.ArrayList;
25 import java.io.File;
26 import java.util.Random;
27
28 public class InputClassFanOutComplexityLambdaNew { // violation 'Complexity is 2'
29 public void testMethod(Map<String, List<String>> entry) {
30 List<File> files = new ArrayList<>();
31 String string = "";
32 Random random = new Random();
33 entry.values().stream()
34 .flatMap(List::stream)
35 .map(File::new)
36 .forEach(files::add);
37 }
38 }