Exemplo n.º 1
0
        internal void method7()
        {
            if (File.Exists("ignoreCode.txt"))
            {
                string str;

                using (StreamReader streamReader = new StreamReader("ignoreCode.txt"))
                {
                    str = streamReader.ReadToEnd();
                }

                List <CodeFile> list = method8(str);

                foreach (CodeFile current in list)
                {
                    foreach (CodeFile file in Files)
                    {
                        AllSequences allSequences = Analysis.smethod1(current, file, current.Hashes.Length - 1);
                        method9(file, allSequences);
                    }
                }

                method2(RootDirectories.First <CodeDir>());
                method3();
            }
        }
Exemplo n.º 2
0
        private void method10()
        {
            try
            {
                DirectoryInfo directoryInfo           = new DirectoryInfo(Path);
                int           minSimilarityLineLength = Options.MinSimilarityLineLength;
                FileInfo[]    files          = directoryInfo.GetFiles(Options.FileSearchPattern, SearchOption.AllDirectories);
                int           num            = 0;
                List <Regex>  excludeRegexes = Options.GetExcludeRegexes();
                FileInfo[]    array          = files;
                int           i = 0;
IL_98:

                while (i < array.Length)
                {
                    FileInfo fileInfo = array[i];
                    bool     flag     = false;

                    for (int j = 0; j < excludeRegexes.Count; j++)
                    {
                        if (excludeRegexes[j].IsMatch(fileInfo.FullName))
                        {
                            flag = true;
                            //IL_87:
                            if (!flag)
                            {
                                num++;
                            }
                            i++;
                            goto IL_98;
                        }
                    }
                    //goto IL_87;
                }

                if (num == 0)
                {
                    AlertAction("No " + Options.FileSearchPattern + " Files Found");
                    Done();
                }
                else
                {
                    UpdateProgressAction(0, num, "Loading Files...");
                    CodeDir codeDir = method4(directoryInfo, Options.MinSimilarityLineLength, "");
                    RootDirectories.Add(codeDir);
                    ObservableCollection <CodeFile> codeFiles = Files;
                    UpdateProgressAction(0, codeFiles.Count * codeFiles.Count / 2, "Comparing Files...");
                    int           num2          = 0;
                    StringBuilder stringBuilder = new StringBuilder();

                    for (int j = 0; j < codeFiles.Count; j++)
                    {
                        CodeFile codeFile = codeFiles[j];

                        for (int k = j; k < codeFiles.Count; k++)
                        {
                            num2++;

                            if (num2 % 500 == 0)
                            {
                                this.UpdateProgressValue(num2);
                            }

                            try
                            {
                                CodeFile     codeFile_    = codeFiles[k];
                                AllSequences allSequences = Analysis.smethod1(codeFile, codeFile_, minSimilarityLineLength);

                                foreach (Sequence sequence in allSequences.Sequences)
                                {
                                    Analysis.smethod4(codeFile, codeFile_, sequence);
                                }
                                goto IL_24D;
                            }
                            catch (Exception ex)
                            {
                                stringBuilder.AppendLine(codeFile.Name + " - " + codeFiles[k].Name);
                                goto IL_24D;
                            }
                            break;
                            IL_24D :;
                        }

                        codeFile.method1();
                        codeFile.Similarities.Sort(new Comparison <Similarity>(Analysis.CompareSimilarities));
                    }

                    method2(codeDir);
                    method3();
                    method7();

                    if (stringBuilder.Length > 0)
                    {
                        this.AlertAction("Atomiq experienced an error with the following file combinations: " + stringBuilder.ToString());
                    }

                    bool0 = true;
                    Done();
                }
            }
            catch (Exception ex)
            {
                if (!(ex is ThreadAbortException))
                {
                    CaughtException = ex;
                }

                Done();
            }
        }