private void sub_vec_seman_lit_id(Compilation compilation, int minDepth, Logger logger) { var source = new MethodFragmentsInCompilation(compilation, minDepth); var information = new OncePerTreeInformation(compilation); var analyzer = new MeasuredSimilarityFinder <SyntaxPair <NodeWithVector>, NodeWithVector, OncePerTreeInformation>( source, withVector, new List <ISyntaxComparator <SyntaxPair <NodeWithVector>, NodeWithVector, OncePerTreeInformation> >() { vectorComparator, subComparatorWithVector, semanticComparator, literalComparator, identifierComparator, }, information); var sv = new Stopwatch(); sv.Start(); var similarities = analyzer.FindAll().ToList(); sv.Stop(); logger.SetRuntime(sv.ElapsedMilliseconds); logger.SetCompletionDate(DateTime.Now); logger.LogMeasures(analyzer.Measure); logger.LogSimilarities(similarities); }
private void sub_vec_comp_df_refact(Compilation compilation, int minDepth, Logger logger) { var source = new MethodFragmentsInCompilation(compilation, minDepth); var information = new OncePerTreeInformation(compilation); var analyzer = new MeasuredSimilarityFinder <SyntaxPair <NodeWithVector>, NodeWithVector, OncePerTreeInformation>( source, withVector, new List <ISyntaxComparator <SyntaxPair <NodeWithVector>, NodeWithVector, OncePerTreeInformation> >() { vectorComparator, subComparatorWithVector, compatibleComparator, dataflowComparator, refactorInvocationsComparator, refactorMembersComparator }, information); var sv = new Stopwatch(); sv.Start(); var similarities = analyzer.FindAll().ToList(); sv.Stop(); logger.SetRuntime(sv.ElapsedMilliseconds); logger.SetCompletionDate(DateTime.Now); logger.LogMeasures(analyzer.Measure); logger.LogSimilarities(similarities); }
private void sub(Compilation compilation, int minDepth, Logger logger) { var source = new MethodFragmentsInCompilation(compilation, minDepth); var information = new OncePerTreeInformation(compilation); var analyzer = new MeasuredSimilarityFinder <SyntaxPair <NodeAsRepresentation>, NodeAsRepresentation, OncePerTreeInformation>(source, identity, Enumerable.Repeat(subComparator, 1).ToList(), information); var sv = new Stopwatch(); sv.Start(); var similarities = analyzer.FindAll().ToList(); sv.Stop(); logger.SetRuntime(sv.ElapsedMilliseconds); logger.SetCompletionDate(DateTime.Now); logger.LogMeasures(analyzer.Measure); logger.LogSimilarities(similarities); }