use of aserg.gtf.dao.authorship.RepositoryDAO in project Truck-Factor by aserg-ufmg.
the class DOACalculator method persist.
@Override
public void persist(Repository repository) throws IOException {
RepositoryDAO reDAO = new RepositoryDAO();
try {
repository.setStatus(RepositoryStatus.DOA_CALCULATED);
reDAO.persist(repository);
} catch (Exception e) {
LOGGER.error("Persist error in repository " + repository.getFullName(), e);
} finally {
reDAO.clear();
}
}
use of aserg.gtf.dao.authorship.RepositoryDAO in project Truck-Factor by aserg-ufmg.
the class AliasesIdentifier method main.
public static void main(String[] args) {
RepositoryDAO repDAO = new RepositoryDAO();
DeveloperDAO devDAO = new DeveloperDAO();
//StringUtils.getLevenshteinDistance("", "");
for (Repository rep : repDAO.findAll()) {
if (rep.getStatus() != RepositoryStatus.REMOVED) {
joinAlias(rep.getFullName(), devDAO);
List<Developer> developers = devDAO.getAllDevelopers(rep.getFullName());
Map<Developer, List<Developer>> aliases = findAliases(developers, 1, 3);
List<Developer> devAliases = treatAliases(rep.getFullName(), aliases);
updateDeveloperAliases(devDAO, devAliases);
}
}
}
use of aserg.gtf.dao.authorship.RepositoryDAO in project Truck-Factor by aserg-ufmg.
the class FormatDoaDistribution method main.
public static void main(String[] args) {
RepositoryDAO repDAO = new RepositoryDAO();
List<FileAuthors> fileAuthors = repDAO.getFilesAuthorList("activeadmin/activeadmin");
Directory mainDirectory = new Directory("Main");
for (FileAuthors fileAuthor : fileAuthors) {
String[] names = fileAuthor.getFileName().split("/");
insert(mainDirectory, names, fileAuthor.getMainAuthor());
}
System.out.println(mainDirectory.toJson());
}
Aggregations