Search in sources :

Example 1 with RepositoryDAO

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();
    }
}
Also used : RepositoryDAO(aserg.gtf.dao.authorship.RepositoryDAO) IOException(java.io.IOException)

Example 2 with RepositoryDAO

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);
        }
    }
}
Also used : RepositoryDAO(aserg.gtf.dao.authorship.RepositoryDAO) DeveloperDAO(aserg.gtf.dao.authorship.DeveloperDAO) Repository(aserg.gtf.model.authorship.Repository) Developer(aserg.gtf.model.authorship.Developer) ArrayList(java.util.ArrayList) List(java.util.List) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList)

Example 3 with RepositoryDAO

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());
}
Also used : RepositoryDAO(aserg.gtf.dao.authorship.RepositoryDAO) FileAuthors(aserg.gtf.model.authorship.FileAuthors)

Aggregations

RepositoryDAO (aserg.gtf.dao.authorship.RepositoryDAO)3 DeveloperDAO (aserg.gtf.dao.authorship.DeveloperDAO)1 Developer (aserg.gtf.model.authorship.Developer)1 FileAuthors (aserg.gtf.model.authorship.FileAuthors)1 Repository (aserg.gtf.model.authorship.Repository)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1