Files
DependencyCheck/dependency-check-core/cpd.html
2016-03-05 16:23:56 -05:00

445 lines
17 KiB
HTML

<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.7 at 2016-03-05
| Rendered using Apache Maven Fluido Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Date-Revision-yyyymmdd" content="20160305" />
<meta http-equiv="Content-Language" content="en" />
<title>dependency-check-core &#x2013; CPD Results</title>
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
<script type="text/javascript" src="./js/apache-maven-fluido-1.5.min.js"></script>
<style type="text/css">
#bannerLeft { margin-top:-20px;margin-bottom:5px !important }
</style>
</head>
<body class="topBarDisabled">
<a href="https://github.com/jeremylong/DependencyCheck">
<img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"
alt="Fork me on GitHub">
</a>
<div class="container-fluid">
<div id="banner">
<div class="pull-left">
<div id="bannerLeft">
<img src="images/dc-core.svg" alt="OWASP dependency-check-core"/>
</div>
</div>
<div class="pull-right"> </div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li class="">
<a href="../../../../../../target/site/1.3.5/#" title="">
</a>
<span class="divider">/</span>
</li>
<li class="">
<a href="../index.html" title="dependency-check">
dependency-check</a>
<span class="divider">/</span>
</li>
<li class="active ">CPD Results</li>
<li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2016-03-05</li>
<li id="projectVersion" class="pull-right">
Version: 1.3.5
</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li>
<a href="index.html" title="About">
<span class="none"></span>
About</a>
</li>
<li class="nav-header">Project Documentation</li>
<li>
<a href="project-info.html" title="Project Information">
<span class="icon-chevron-right"></span>
Project Information</a>
</li>
<li>
<a href="project-reports.html" title="Project Reports">
<span class="icon-chevron-down"></span>
Project Reports</a>
<ul class="nav nav-list">
<li>
<a href="dependency-analysis.html" title="Dependency Analysis">
<span class="none"></span>
Dependency Analysis</a>
</li>
<li>
<a href="apidocs/index.html" title="JavaDocs">
<span class="none"></span>
JavaDocs</a>
</li>
<li>
<a href="xref/index.html" title="Source Xref">
<span class="none"></span>
Source Xref</a>
</li>
<li>
<a href="xref-test/index.html" title="Test Source Xref">
<span class="none"></span>
Test Source Xref</a>
</li>
<li>
<a href="surefire-report.html" title="Surefire Report">
<span class="none"></span>
Surefire Report</a>
</li>
<li>
<a href="failsafe-report.html" title="Failsafe Report">
<span class="none"></span>
Failsafe Report</a>
</li>
<li>
<a href="cobertura/index.html" title="Cobertura Test Coverage">
<span class="none"></span>
Cobertura Test Coverage</a>
</li>
<li>
<a href="findbugs.html" title="FindBugs">
<span class="none"></span>
FindBugs</a>
</li>
<li>
<a href="taglist.html" title="Tag List">
<span class="none"></span>
Tag List</a>
</li>
<li>
<a href="dependency-updates-report.html" title="Dependency Updates Report">
<span class="none"></span>
Dependency Updates Report</a>
</li>
<li>
<a href="plugin-updates-report.html" title="Plugin Updates Report">
<span class="none"></span>
Plugin Updates Report</a>
</li>
<li>
<a href="checkstyle.html" title="Checkstyle">
<span class="none"></span>
Checkstyle</a>
</li>
<li class="active">
<a href="#"><span class="none"></span>CPD</a>
</li>
<li>
<a href="pmd.html" title="PMD">
<span class="none"></span>
PMD</a>
</li>
</ul>
</li>
</ul>
<hr />
<div id="poweredBy">
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<div class="g-plusone" data-href="https://github.com/jeremylong/DependencyCheck.git/dependency-check-core" data-size="tall" ></div>
<div class="clear"></div>
<div class="clear"></div>
<div id="twitter">
<a href="https://twitter.com/ctxt" class="twitter-follow-button" data-show-count="true" data-align="left" data-size="medium" data-show-screen-name="true" data-lang="en">Follow ctxt</a>
<script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Maven" class="builtBy">
<img class="builtBy" alt="built with maven" src="http://jeremylong.github.io/DependencyCheck/images/logos/maven-feather.png" />
</a>
<a href="http://www.jetbrains.com/idea/" title="IntelliJ" class="builtBy">
<img class="builtBy" alt="developed using" src="http://jeremylong.github.io/DependencyCheck/images/logos/logo_intellij_idea.png" width="170px" />
</a>
<a href="http://www.cloudbees.com/" title="Cloudbees" class="builtBy">
<img class="builtBy" alt="built on cloudbees" src="http://jeremylong.github.io/DependencyCheck/images/logos/Button-Built-on-CB-1.png" />
</a>
</div>
</div>
</div>
<div id="bodyColumn" class="span10" >
<div class="section">
<h2><a name="CPD_Results"></a>CPD Results</h2>
<p>The following document contains the results of PMD's <a class="externalLink" href="http://pmd.sourceforge.net/cpd.html">CPD</a> 5.3.5.</p></div>
<div class="section">
<h2><a name="Duplications"></a>Duplications</h2>
<table border="0" class="table table-striped">
<tr class="a">
<th>File</th>
<th>Line</th></tr>
<tr class="b">
<td>org\owasp\dependencycheck\data\update\CpeUpdater.java</td>
<td><a href="./xref/org/owasp/dependencycheck/data/update/CpeUpdater.html#L147">147</a></td></tr>
<tr class="a">
<td>org\owasp\dependencycheck\data\update\nvd\DownloadTask.java</td>
<td><a href="./xref/org/owasp/dependencycheck/data/update/nvd/DownloadTask.html#L267">267</a></td></tr>
<tr class="b"><td colspan='2'>
<div>
<pre> }
/**
* Extracts the file contained in a gzip archive. The extracted file is placed in the exact same path as the file specified.
*
* @param file the archive file
* @throws FileNotFoundException thrown if the file does not exist
* @throws IOException thrown if there is an error extracting the file.
*/
private void extractGzip(File file) throws FileNotFoundException, IOException {
//TODO - move this to a util class as it is duplicative of (copy of) code in the DownloadTask
final String originalPath = file.getPath();
final File gzip = new File(originalPath + &quot;.gz&quot;);
if (gzip.isFile() &amp;&amp; !gzip.delete()) {
gzip.deleteOnExit();
}
if (!file.renameTo(gzip)) {
throw new IOException(&quot;Unable to rename '&quot; + file.getPath() + &quot;'&quot;);
}
final File newfile = new File(originalPath);
final byte[] buffer = new byte[4096];
GZIPInputStream cin = null;
FileOutputStream out = null;
try {
cin = new GZIPInputStream(new FileInputStream(gzip));
out = new FileOutputStream(newfile);
int len;
while ((len = cin.read(buffer)) &gt; 0) {
out.write(buffer, 0, len);
}
} finally {
if (cin != null) {
try {
cin.close();
} catch (IOException ex) {
LOGGER.trace(&quot;ignore&quot;, ex);
}
}
if (out != null) {
try {
out.close();
} catch (IOException ex) {
LOGGER.trace(&quot;ignore&quot;, ex);
}
}
if (gzip.isFile()) {
FileUtils.deleteQuietly(gzip);
}
}
}
}</pre></div></td></tr></table>
<table border="0" class="table table-striped">
<tr class="a">
<th>File</th>
<th>Line</th></tr>
<tr class="b">
<td>org\owasp\dependencycheck\analyzer\JarAnalyzer.java</td>
<td><a href="./xref/org/owasp/dependencycheck/analyzer/JarAnalyzer.html#L895">895</a></td></tr>
<tr class="a">
<td>org\owasp\dependencycheck\analyzer\PythonDistributionAnalyzer.java</td>
<td><a href="./xref/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.html#L235">235</a></td></tr>
<tr class="b"><td colspan='2'>
<div>
<pre> public void initializeFileTypeAnalyzer() throws Exception {
final File baseDir = Settings.getTempDirectory();
tempFileLocation = File.createTempFile(&quot;check&quot;, &quot;tmp&quot;, baseDir);
if (!tempFileLocation.delete()) {
final String msg = String.format(&quot;Unable to delete temporary file '%s'.&quot;, tempFileLocation.getAbsolutePath());
throw new AnalysisException(msg);
}
if (!tempFileLocation.mkdirs()) {
final String msg = String.format(&quot;Unable to create directory '%s'.&quot;, tempFileLocation.getAbsolutePath());
throw new AnalysisException(msg);
}
}
/**
* Deletes any files extracted from the JAR during analysis.
*/
@Override
public void close() {
if (tempFileLocation != null &amp;&amp; tempFileLocation.exists()) {
LOGGER.debug(&quot;Attempting to delete temporary files&quot;);
final boolean success = FileUtils.delete(tempFileLocation);
if (!success) {
LOGGER.warn(&quot;Failed to delete some temporary files, see the log for more details&quot;);
}
}
}
/**
* Determines if the key value pair from the manifest is for an &quot;import&quot; type entry for package names.
*
* @param key the key from the manifest
* @param value the value from the manifest
* @return true or false depending on if it is believed the entry is an &quot;import&quot; entry
*/
private boolean isImportPackage(String key, String value) {</pre></div></td></tr></table>
<table border="0" class="table table-striped">
<tr class="a">
<th>File</th>
<th>Line</th></tr>
<tr class="b">
<td>org\owasp\dependencycheck\analyzer\ArchiveAnalyzer.java</td>
<td><a href="./xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html#L174">174</a></td></tr>
<tr class="a">
<td>org\owasp\dependencycheck\analyzer\JarAnalyzer.java</td>
<td><a href="./xref/org/owasp/dependencycheck/analyzer/JarAnalyzer.html#L894">894</a></td></tr>
<tr class="b"><td colspan='2'>
<div>
<pre> @Override
public void initializeFileTypeAnalyzer() throws Exception {
final File baseDir = Settings.getTempDirectory();
tempFileLocation = File.createTempFile(&quot;check&quot;, &quot;tmp&quot;, baseDir);
if (!tempFileLocation.delete()) {
final String msg = String.format(&quot;Unable to delete temporary file '%s'.&quot;, tempFileLocation.getAbsolutePath());
throw new AnalysisException(msg);
}
if (!tempFileLocation.mkdirs()) {
final String msg = String.format(&quot;Unable to create directory '%s'.&quot;, tempFileLocation.getAbsolutePath());
throw new AnalysisException(msg);
}
}
/**
* The close method deletes any temporary files and directories created during analysis.
*
* @throws Exception thrown if there is an exception deleting temporary files
*/
@Override
public void close() throws Exception {</pre></div></td></tr></table>
<table border="0" class="table table-striped">
<tr class="a">
<th>File</th>
<th>Line</th></tr>
<tr class="b">
<td>org\owasp\dependencycheck\analyzer\ArchiveAnalyzer.java</td>
<td><a href="./xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html#L175">175</a></td></tr>
<tr class="a">
<td>org\owasp\dependencycheck\analyzer\PythonDistributionAnalyzer.java</td>
<td><a href="./xref/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.html#L235">235</a></td></tr>
<tr class="b"><td colspan='2'>
<div>
<pre> public void initializeFileTypeAnalyzer() throws Exception {
final File baseDir = Settings.getTempDirectory();
tempFileLocation = File.createTempFile(&quot;check&quot;, &quot;tmp&quot;, baseDir);
if (!tempFileLocation.delete()) {
final String msg = String.format(&quot;Unable to delete temporary file '%s'.&quot;, tempFileLocation.getAbsolutePath());
throw new AnalysisException(msg);
}
if (!tempFileLocation.mkdirs()) {
final String msg = String.format(&quot;Unable to create directory '%s'.&quot;, tempFileLocation.getAbsolutePath());
throw new AnalysisException(msg);
}
}
/**
* The close method deletes any temporary files and directories created during analysis.
*
* @throws Exception thrown if there is an exception deleting temporary files
*/
@Override
public void close() throws Exception {</pre></div></td></tr></table></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row-fluid">
<p >Copyright &copy; 2012&#x2013;2016
<a href="http://www.owasp.org">OWASP</a>.
All rights reserved.
</p>
</div>
</div>
</footer>
</body>
</html>