public static CommitSelectionExpression AreReleases(this CommitSelectionExpression parentExp)
 {
     return(parentExp.Reselect(s =>
                               from c in s
                               join r in parentExp.Queryable <Release>() on c.ID equals r.CommitID
                               select c
                               ));
 }
Exemplo n.º 2
0
 public static CommitSelectionExpression AreBugFixes(this CommitSelectionExpression parentExp)
 {
     return(parentExp.Reselect(s =>
                               from c in s
                               join bf in parentExp.Queryable <BugFix>() on c.ID equals bf.CommitID
                               select c
                               ));
 }
Exemplo n.º 3
0
 public static CommitSelectionExpression ContainModifications(this CommitSelectionExpression parentExp)
 {
     return(parentExp.Reselect(s =>
                               (
                                   from c in s
                                   join m in parentExp.Selection <Modification>() on c.ID equals m.CommitID
                                   select c
                               ).Distinct()
                               ));
 }
Exemplo n.º 4
0
 public static CommitSelectionExpression AreNotBugFixes(this CommitSelectionExpression parentExp)
 {
     return(parentExp.Reselect(s =>
                               from c in s
                               join bf in parentExp.Queryable <BugFix>() on c.ID equals bf.CommitID into j
                               from x in j.DefaultIfEmpty()
                               where
                               x == null
                               select c
                               ));
 }
Exemplo n.º 5
0
 public static CommitSelectionExpression TouchFiles(this CommitSelectionExpression parentExp)
 {
     return(parentExp.Reselect(s =>
                               (
                                   from c in s
                                   join m in parentExp.Queryable <Modification>() on c.ID equals m.CommitID
                                   join f in parentExp.Selection <ProjectFile>() on m.FileID equals f.ID
                                   select c
                               ).Distinct()
                               ));
 }
 public static CommitSelectionExpression AreRefactorings(this CommitSelectionExpression parentExp)
 {
     return(parentExp.AreNotBugFixes().Reselect(s =>
                                                (
                                                    from c in s
                                                    join m in parentExp.Queryable <Modification>() on c.ID equals m.CommitID
                                                    join cb in parentExp.Queryable <CodeBlock>() on m.ID equals cb.ModificationID
                                                    group cb by c into g
                                                    select new
     {
         Commit = g.Key,
         Added = g.Where(x => x.Size > 0).Sum(x => x.Size),
         Removed = -g.Where(x => x.Size < 0).Sum(x => x.Size)
     }
                                                ).Where(x => x.Removed / x.Added >= 1d / 2).Select(x => x.Commit)
                                                ));
 }