CPD Report

Found a 46 line (233 tokens) duplication in the following files: 
Starting at line 74 of C:\project\statcvs\src\net\sf\statcvs\output\CvswebIntegration.java
Starting at line 74 of C:\project\statcvs\src\net\sf\statcvs\output\ViewCvsIntegration.java

    protected String getFileUrl(final VersionedFile file, final String parameter) {
        String filename;
        if (isInAttic(file)) {
            final String path = file.getDirectory().getPath();
            filename = "/" + path + "Attic/" + file.getFilename();

        } else {
            filename = "/" + file.getFilenameWithPath();
        }

        String append = parameter;
        if (this.postfix != null) {
            append += (append.length() > 0) ? "&" + this.postfix : "?" + this.postfix;
        }
        return this.baseURL + filename + append;
    }

    /**
     * @see net.sf.statcvs.output.WebRepositoryIntegration#getFileHistoryUrl
     */
    public String getFileHistoryUrl(final VersionedFile file) {
        return getFileUrl(file, "");
    }

    /**
     * @see net.sf.statcvs.output.WebRepositoryIntegration#getFileViewUrl(VersionedFile)
     */
    public String getFileViewUrl(final VersionedFile file) {
        return getFileUrl(file, "?rev=HEAD&content-type=text/vnd.viewcvs-markup");
    }

    /**
     * @see net.sf.statcvs.output.WebRepositoryIntegration#getFileViewUrl(VersionedFile)
     */
    public String getFileViewUrl(final Revision revision) {
        return getFileUrl(revision.getFile(), "?rev=" + revision.getRevisionNumber() + "&content-type=text/vnd.viewcvs-markup");
    }

    /**
     * @see net.sf.statcvs.output.WebRepositoryIntegration#getDiffUrl
     */
    public String getDiffUrl(final Revision oldRevision, final Revision newRevision) {
        if (!oldRevision.getFile().equals(newRevision.getFile())) {
            throw new IllegalArgumentException("revisions must be of the same file");
        }
        return getFileUrl(oldRevision.getFile(), ".diff?r1=" + oldRevision.getRevisionNumber() + "&r2=" + newRevision.getRevisionNumber());
=====================================================================
Found a 20 line (175 tokens) duplication in the following files: 
Starting at line 262 of C:\project\statcvs\src\net\sf\statcvs\charts\LOCChartMaker.java
Starting at line 351 of C:\project\statcvs\src\net\sf\statcvs\charts\LOCChartMaker.java

        private static int getImportance(final Module dir, final Date start, final Date end) {
            final long timeRange = end.getTime() - start.getTime();
            double maxImportance = 0;
            int currentLines = 0;
            final Iterator it = dir.getRevisions().iterator();
            while (it.hasNext()) {
                final Revision revision = (Revision) it.next();
                currentLines += revision.getLinesDelta();
                final long timeInRange = revision.getDate().getTime() - start.getTime();
                final double timeFraction = (timeInRange / (double) timeRange) * 0.9 + 0.1;
                maxImportance = Math.max(maxImportance, (currentLines) * (timeFraction));
            }
            return (int) (maxImportance * 10);
        }

        private static List firstN(final List list, final int n) {
            return list.subList(0, Math.min(list.size(), n));
        }

        private static List createAllModulesLOCSeries(final Repository repository, final int max) {
=====================================================================
Found a 24 line (170 tokens) duplication in the following files: 
Starting at line 49 of C:\project\statcvs\src\net\sf\statcvs\pages\xml\AllDevelopersXml.java
Starting at line 74 of C:\project\statcvs\src\net\sf\statcvs\pages\xml\FilesXml.java

        final String[] str = new String[NO_OF_COLS_IN_EXT_TABLE];
        for (int j = 0; j < table.getRowCount(); j++) {
            Element col = null;
            int i = 0;
            final Iterator it = table.getColumnIterator();
            final Iterator itr = table.getColumnIterator();
            while (it.hasNext()) {
                final Column column = (Column) it.next();
                column.renderHead(renderer);
                str[i] = renderer.getColumnHead();
                if (i == 0) {
                    col = new Element(str[i]);
                } else {
                    col.addContent(new Element(str[i]));
                }
                i++;
            }
            boolean isFirstColumn = true;
            int k = 0;
            while (itr.hasNext()) {
                final Column column = (Column) itr.next();
                column.renderCell(j, renderer);
                if (isFirstColumn && table.hasKeysInFirstColumn()) {
                    col.setAttribute("ext", renderer.getRowHead().toLowerCase());
=====================================================================
Found a 45 line (170 tokens) duplication in the following files: 
Starting at line 55 of C:\project\statcvs\src\net\sf\statcvs\pages\FileSizesPageMaker.java
Starting at line 201 of C:\project\statcvs\src\net\sf\statcvs\pages\xml\FilesXml.java

    }

    /**
     * returns Integer of the number of files
     *
     * @returns int
     */
    private int getCurrentFileCount() {
        int result = 0;
        final Iterator it = this.repository.getFiles().iterator();
        while (it.hasNext()) {
            final VersionedFile file = (VersionedFile) it.next();
            if (!file.isDead()) {
                result++;
            }
        }
        return result;
    }

    /**
     * returns the average size of a file in terms of LOC
     *
     * @returns double
     */
    private double getCurrentAverageFileSize() {
        return ((double) this.repository.getCurrentLOC()) / getCurrentFileCount();
    }

    /**
     * returns number of revisions done on average
     *
     * @returns double
     */
    private double getCurrentAverageRevisionCount() {
        int revisions = 0;
        final Iterator it = this.repository.getFiles().iterator();
        while (it.hasNext()) {
            final VersionedFile file = (VersionedFile) it.next();
            if (!file.isDead()) {
                revisions += file.getRevisions().size();
            }
        }
        return ((double) revisions) / getCurrentFileCount();
    }
}
=====================================================================
Found a 18 line (127 tokens) duplication in the following files: 
Starting at line 21 of C:\project\statcvs\src\net\sf\statcvs\pages\xml\LogXmlMaker.java
Starting at line 28 of C:\project\statcvs\src\net\sf\statcvs\pages\xml\RevisedFilesXml.java

public class RevisedFilesXml {
    private final static String[] MONTH_TWO_CHARACTERS = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" };

    public static String getAnchor(final SymbolicName tag) {
        return "tag-" + tag.getName();
    }

    public static String getURL(final Date date) {
        final Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        return getFileName(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)) + ".html";
    }

    private static String getFileName(final int year, final int month) {
        return year + "-" + MONTH_TWO_CHARACTERS[month];
    }

    private final Repository repo;
=====================================================================
Found a 21 line (121 tokens) duplication in the following files: 
Starting at line 130 of C:\project\statcvs\src\net\sf\statcvs\pages\xml\FilesXml.java
Starting at line 177 of C:\project\statcvs\src\net\sf\statcvs\pages\xml\FilesXml.java

                    col = new Element(str[i]);
                } else {
                    str[i] = renderer.getColumnHead().replaceAll(" ", "_");
                    //col.addContent(new Element (str[i]));
                }
                i++;
            }

            boolean isFirstColumn = true;
            int k = 0;
            while (itr.hasNext()) {
                final Column column = (Column) itr.next();
                column.renderCell(j, renderer);
                if (isFirstColumn && table.hasKeysInFirstColumn()) {
                    col.setText(/*removeHTML(*/renderer.getRowHead());
                    isFirstColumn = false;
                } else {
                    col.setAttribute(str[k].toLowerCase(), renderer.getTableCell());
                }
                k++;
            }
=====================================================================
Found a 13 line (101 tokens) duplication in the following files: 
Starting at line 49 of C:\project\statcvs\src\net\sf\statcvs\pages\xml\AllDevelopersXml.java
Starting at line 119 of C:\project\statcvs\src\net\sf\statcvs\pages\xml\FilesXml.java

        final String[] str = new String[NO_OF_COLS_IN_LARG_TABLE];
        for (int j = 0; j < table.getRowCount(); j++) {
            Element col = null;
            int i = 0;
            final Iterator it = table.getColumnIterator();
            final Iterator itr = table.getColumnIterator();
            while (it.hasNext()) {
                final Column column = (Column) it.next();
                column.renderHead(renderer);
                str[i] = renderer.getColumnHead();
                if (i == 0) {
                    col = new Element(str[i]);
                } else {