コード例 #1
0
ファイル: Analyzer.cs プロジェクト: ATrefzer/Insight
        private List <Coupling> AnalyzeLogicalComponentChangeCoupling(string mappingFile)
        {
            var couplingAnalyzer = new ChangeCouplingAnalyzer();
            var mapper           = new LogicalComponentMapper();

            mapper.ReadDefinitionFile(mappingFile, true);

            Func <string, string> classifier = localPath => { return(mapper.MapLocalPathToLogicalComponent(localPath)); };

            var classifiedCouplings = couplingAnalyzer.CalculateClassifiedChangeCouplings(_history, classifier);

            Csv.Write(Path.Combine(_outputPath, "classified_change_couplings.csv"), classifiedCouplings);

            return(classifiedCouplings);
        }
コード例 #2
0
ファイル: Analyzer.cs プロジェクト: tlaufkoetter/Insight
        public List <object> ExportSummary(IAliasMapping aliasMapping)
        {
            LoadContributions(true); // silent

            var summary           = _history.GetArtifactSummary(_extendedDisplayFilter, aliasMapping);
            var hotspotCalculator = new HotspotCalculator(summary, _metrics);

            var orderedByLocalPath = summary.OrderBy(x => x.LocalPath).ToList();
            var gridData           = new List <object>();

            foreach (var artifact in orderedByLocalPath)
            {
                gridData.Add(CreateDataGridFriendlyArtifact(artifact, hotspotCalculator, aliasMapping));
            }

            var now = DateTime.Now.ToIsoShort();

            Csv.Write(Path.Combine(_outputPath, $"summary-{now}.csv"), gridData);
            return(gridData);
        }
コード例 #3
0
ファイル: Analyzer.cs プロジェクト: tlaufkoetter/Insight
        public List <Coupling> AnalyzeChangeCoupling()
        {
            // Pair wise couplings
            var couplingAnalyzer = new ChangeCouplingAnalyzer();
            var couplings        = couplingAnalyzer.CalculateChangeCouplings(_history, _extendedDisplayFilter);
            var sortedCouplings  = couplings.OrderByDescending(coupling => coupling.Degree).ToList();

            Csv.Write(Path.Combine(_outputPath, "change_couplings.csv"), sortedCouplings);


            // TODO I removed this from the wiki
            // Same with classified folders (show this one if available)
            var mappingFile = Path.Combine(_outputPath, "logical_components.xml");

            if (File.Exists(mappingFile))
            {
                return(AnalyzeLogicalComponentChangeCoupling(mappingFile));
            }

            return(sortedCouplings);
        }
コード例 #4
0
        public List <Coupling> AnalyzeChangeCoupling()
        {
            LoadHistory();

            // Pair wise couplings
            var couplingAnalyzer = new ChangeCouplingAnalyzer();
            var couplings        = couplingAnalyzer.CalculateChangeCouplings(_history, Project.Filter);
            var sortedCouplings  = couplings.OrderByDescending(coupling => coupling.Degree).ToList();

            Csv.Write(Path.Combine(Project.Cache, "change_couplings.csv"), sortedCouplings);

            // Same with classified folders (show this one if available)
            var mappingFile = Path.Combine(Project.Cache, "logical_components.xml");

            if (File.Exists(mappingFile))
            {
                return(AnalyzeLogicalComponentChangeCoupling(mappingFile));
            }

            return(sortedCouplings);
        }
コード例 #5
0
        public List <object> ExportSummary()
        {
            LoadHistory();
            LoadMetrics();
            LoadContributions(true); // silent

            var summary           = _history.GetArtifactSummary(Project.Filter, new HashSet <string>(_metrics.Keys));
            var hotspotCalculator = new HotspotCalculator(summary, _metrics);

            var orderedByLocalPath = summary.OrderBy(x => x.LocalPath).ToList();
            var gridData           = new List <object>();

            foreach (var artifact in orderedByLocalPath)
            {
                gridData.Add(CreateDataGridFriendlyArtifact(artifact, hotspotCalculator));
            }

            var now = DateTime.Now.ToIsoShort();

            Csv.Write(Path.Combine(Project.Cache, $"summary-{now}.csv"), gridData);
            return(gridData);
        }
コード例 #6
0
ファイル: Analyzer.cs プロジェクト: ATrefzer/Insight
        public List <DataGridFriendlyComment> ExportComments()
        {
            /*
             * R Code
             * library(tm)
             * library(wordcloud)
             *
             * comments = read.csv("d:\\comments.csv", stringsAsFactors=FALSE)
             * names(comments) = c("comment")
             *
             * corpus = Corpus(VectorSource(comments[,1]))
             * corpus = tm_map(corpus, tolower)
             #corpus = tm_map(corpus, PlainTextDocument)
             * corpus = tm_map(corpus, removePunctuation)
             * corpus = tm_map(corpus, removeWords, stopwords("english"))
             * frequencies = DocumentTermMatrix(corpus)
             * sparse = removeSparseTerms(frequencies, 0.99)
             * all = as.data.frame(as.matrix(sparse))
             *
             * wordcloud(colnames(all), colSums(all))
             */

            LoadHistory();
            var result = new List <DataGridFriendlyComment>();

            foreach (var cs in _history.ChangeSets)
            {
                result.Add(new DataGridFriendlyComment
                {
                    Committer = cs.Committer,
                    Comment   = cs.Comment
                });
            }

            Csv.Write(Path.Combine(_outputPath, "comments.csv"), result);
            return(result);
        }