metrics.incFileCount();
metrics.incByteCount(file.length());
InputStream in = new BufferedInputStream(new FileInputStream(file), 10240);
JavaParser ncssParser = new JavaParser(in);
ncssParser.CompilationUnit();
metrics.incPackageCount(ncssParser.getPackage());
metrics.incNCSSCount(ncssParser.getNcss());
metrics.incLOCCount(ncssParser.getLOC());
metrics.incJavaDocCount(ncssParser.getJvdc());
metrics.incCycCount(ncssParser.getFunction());
safeClose(in);
return metrics;
}