CPD Results

The following document contains the results of PMD's CPD 6.42.0.

Duplications

File Line
com\randomnoun\common\db\explain\layout\ExplaineratorLayout.java 310
com\randomnoun\common\db\explain\layout\ExplaineratorLayout.java 350
private Shape layout(AttachedSubqueriesNode n) {
		List<QuerySpecificationNode> qsnList = n.getQuerySpecifications();
		
		Shape outer = new Shape(); // outer shape
		Shape connector = new Shape(); // connector shape
		
		List<Shape> qsShapes = reverseStream(qsnList)
			.map(c -> layout(c, "subquery"))
			.collect(Collectors.toList());
		
		List<Integer> tableWidths = qsShapes.stream().map(Shape::getWidth).collect(Collectors.toList());
		List<Integer> tableHeights = qsShapes.stream().map(Shape::getHeight).collect(Collectors.toList());
		int totalWidth = tableWidths.stream().mapToInt(i -> i).sum() 
			+ (qsShapes.size() - 1) * 50; // 50px padding
		int maxHeight = tableHeights.stream().mapToInt(i -> i).max().orElse(0);

		int w = Math.max(totalWidth, 150);
		
		outer.setSize(w,  50 + maxHeight);
		
		connector.setParentAndPosition(outer, 0, 0);
		connector.setSize(w,  30); 
		
		Shape attachedSubqueries = new Shape();
		attachedSubqueries.setCssClass("attachedSubqueries");
File Line
com\randomnoun\common\db\explain\layout\ExplaineratorLayout.java 310
com\randomnoun\common\db\explain\layout\ExplaineratorLayout.java 350
com\randomnoun\common\db\explain\layout\ExplaineratorLayout.java 391
private Shape layout(AttachedSubqueriesNode n) {
		List<QuerySpecificationNode> qsnList = n.getQuerySpecifications();
		
		Shape outer = new Shape(); // outer shape
		Shape connector = new Shape(); // connector shape
		
		List<Shape> qsShapes = reverseStream(qsnList)
			.map(c -> layout(c, "subquery"))
			.collect(Collectors.toList());
		
		List<Integer> tableWidths = qsShapes.stream().map(Shape::getWidth).collect(Collectors.toList());
		List<Integer> tableHeights = qsShapes.stream().map(Shape::getHeight).collect(Collectors.toList());
		int totalWidth = tableWidths.stream().mapToInt(i -> i).sum() 
			+ (qsShapes.size() - 1) * 50; // 50px padding
		int maxHeight = tableHeights.stream().mapToInt(i -> i).max().orElse(0);

		int w = Math.max(totalWidth, 150);
		
		outer.setSize(w,  50 + maxHeight);
		
		connector.setParentAndPosition(outer, 0, 0);
		connector.setSize(w,  30); 
		
		Shape attachedSubqueries = new Shape();
File Line
com\randomnoun\common\db\explain\layout\ExplaineratorLayout.java 278
com\randomnoun\common\db\explain\layout\ExplaineratorLayout.java 317
com\randomnoun\common\db\explain\layout\ExplaineratorLayout.java 357
com\randomnoun\common\db\explain\layout\ExplaineratorLayout.java 398
.map(c -> layout(c, "query_block"))
			.collect(Collectors.toList());
		
		List<Integer> tableWidths = qsShapes.stream().map(Shape::getWidth).collect(Collectors.toList());
		List<Integer> tableHeights = qsShapes.stream().map(Shape::getHeight).collect(Collectors.toList());
		int totalWidth = tableWidths.stream().mapToInt(i -> i).sum() 
			+ (qsShapes.size() - 1) * 50; // 50px padding
		int maxHeight = tableHeights.stream().mapToInt(i -> i).max().orElse(0);