CPD Results

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

Duplications

File Line
org/sentrysoftware/maven/skin/ImageTool.java 344
org/sentrysoftware/maven/skin/ImageTool.java 536
) throws IOException {

		// basedir path
		Path basedirPath = Paths.get(basedir).toAbsolutePath();

		// First, calculate the real path of the current document
		Path documentPath = Paths.get(basedir, currentDocument);

		Path parentPath = documentPath.getParent();
		if (parentPath == null) {
			throw new IOException("Couldn't get parent path of " + currentDocument);
		}

		// Select all images
		List<Element> elements = body.select(selector);

		// For each image
		for (Element element : elements) {

			// Get the SRC attribute (the path)
			String imageSrc = element.attr("src");
			if (imageSrc.isEmpty()) {
				continue;
			}

			// Skip absolute URLs
			if (isAbsoluteUrl(imageSrc)) {
				continue;
			}
File Line
org/sentrysoftware/maven/skin/ImageTool.java 128
org/sentrysoftware/maven/skin/ImageTool.java 358
List<Element> elements = body.select("img");

		// For each image
		for (Element element : elements) {

			// Get the SRC attribute (the path)
			String imageSrc = element.attr("src");
			if (imageSrc.isEmpty()) {
				continue;
			}

			// Skip absolute URLs
			if (isAbsoluteUrl(imageSrc)) {
				continue;
			}

			// Calculate the path to the actual picture file
			Path sourcePath = documentPath.resolveSibling(imageSrc);
			File sourceFile = sourcePath.toFile();

			// Skip external URLs
			if (!sourcePath.toAbsolutePath().startsWith(basedirPath)) {
				continue;
			}
File Line
org/sentrysoftware/maven/skin/ImageTool.java 463
org/sentrysoftware/maven/skin/ImageTool.java 570
Path sourcePath = documentPath.resolveSibling(imageSrc);
			File sourceFile = sourcePath.toFile();

			// Skip external URLs
			if (!sourcePath.toAbsolutePath().startsWith(basedirPath)) {
				continue;
			}

			// Sanity check
			if (!sourceFile.isFile()) {
				throw new IOException(sourceFile.getAbsolutePath() + " (referenced as " + imageSrc + ") does not exist");
			}

			// Read the image
			BufferedImage sourceImage = ImageIO.read(sourceFile);
File Line
org/sentrysoftware/maven/skin/ImageTool.java 370
org/sentrysoftware/maven/skin/ImageTool.java 458
if (isAbsoluteUrl(imageSrc)) {
				continue;
			}

			// Calculate the path to the actual picture file
			Path sourcePath = documentPath.resolveSibling(imageSrc);
			File sourceFile = sourcePath.toFile();

			// Skip external URLs
			if (!sourcePath.toAbsolutePath().startsWith(basedirPath)) {
				continue;
			}

			// Sanity check
			if (!sourceFile.isFile()) {
				throw new IOException(sourceFile.getAbsolutePath() + " (referenced as " + imageSrc + ") does not exist");
			}
File Line
org/sentrysoftware/maven/skin/ImageTool.java 375
org/sentrysoftware/maven/skin/ImageTool.java 570
Path sourcePath = documentPath.resolveSibling(imageSrc);
			File sourceFile = sourcePath.toFile();

			// Skip external URLs
			if (!sourcePath.toAbsolutePath().startsWith(basedirPath)) {
				continue;
			}

			// Sanity check
			if (!sourceFile.isFile()) {
				throw new IOException(sourceFile.getAbsolutePath() + " (referenced as " + imageSrc + ") does not exist");
			}
File Line
org/sentrysoftware/maven/skin/HtmlTool.java 245
org/sentrysoftware/maven/skin/HtmlTool.java 275
org/sentrysoftware/maven/skin/HtmlTool.java 306
org/sentrysoftware/maven/skin/HtmlTool.java 360
public Element wrap(final Element body, final String selector, final String wrapHtml, final int amount) {

		List<Element> elements = body.select(selector);
		if (amount >= 0) {
			// limit to the indicated amount
			elements = elements.subList(0, Math.min(amount, elements.size()));
		}

		for (Element element : elements) {
			element.wrap(wrapHtml);
File Line
org/sentrysoftware/maven/skin/HtmlTool.java 178
org/sentrysoftware/maven/skin/HtmlTool.java 245
org/sentrysoftware/maven/skin/HtmlTool.java 275
org/sentrysoftware/maven/skin/HtmlTool.java 306
org/sentrysoftware/maven/skin/HtmlTool.java 360
public Element addClass(final Element body, final String selector, final List<String> classNames, final int amount) {

		List<Element> elements = body.select(selector);
		if (amount >= 0) {
			// limit to the indicated amount
			elements = elements.subList(0, Math.min(amount, elements.size()));
		}

		for (Element element : elements) {
File Line
org/sentrysoftware/maven/skin/ImageTool.java 358
org/sentrysoftware/maven/skin/ImageTool.java 439
org/sentrysoftware/maven/skin/ImageTool.java 550
List<Element> elements = body.select(selector);

		// For each image
		for (Element element : elements) {

			// Get the SRC attribute (the path)
			String imageSrc = element.attr("src");
			if (imageSrc.isEmpty()) {
				continue;
			}

			// Skip absolute URLs
			if (isAbsoluteUrl(imageSrc)) {
				continue;
			}
No results.