Ejemplo n.º 1
0
        public HierarchicalDataContext AnalyzeKnowledge(IBrushFactory brushFactory, IAliasMapping aliasMapping)
        {
            LoadHistory();
            LoadMetrics();
            LoadContributions(false);

            var localFileToContribution = AliasTransformContribution(_contributions, aliasMapping);

            var summary             = _history.GetArtifactSummary(GetDisplayFilter(), aliasMapping);
            var fileToMainDeveloper = localFileToContribution.ToDictionary(pair => pair.Key, pair => pair.Value.GetMainDeveloper());

            // Assign a color to each developer
            var mainDevelopers = fileToMainDeveloper.Select(pair => pair.Value.Developer).Distinct().ToList();

            var legend = new LegendBitmap(mainDevelopers, brushFactory);

            legend.CreateLegendBitmap(Path.Combine(_outputPath, "knowledge_color.bmp"));

            // Build the knowledge data
            var builder          = new KnowledgeBuilder();
            var hierarchicalData = builder.Build(summary, _metrics, fileToMainDeveloper);

            var dataContext = new HierarchicalDataContext(hierarchicalData, brushFactory);

            dataContext.AreaSemantic   = Strings.LinesOfCode;
            dataContext.WeightSemantic = Strings.NotAvailable;
            return(dataContext);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Same as knowledge but uses a different color scheme
        /// </summary>
        public HierarchicalDataContext AnalyzeKnowledgeLoss(string developer)
        {
            LoadHistory();
            LoadMetrics();
            LoadContributions(false);

            var summary             = _history.GetArtifactSummary(Project.Filter, new HashSet <string>(_metrics.Keys));
            var fileToMainDeveloper = _contributions.ToDictionary(pair => pair.Key, pair => pair.Value.GetMainDeveloper());

            // Assign a color to each developer
            // Include all other developers. So we have a more consistent coloring.
            var mainDevelopers = fileToMainDeveloper.Select(pair => pair.Value.Developer).Distinct();
            var scheme         = new ColorScheme(mainDevelopers.ToArray());

            // Build the knowledge data
            var builder          = new KnowledgeBuilder(developer);
            var hierarchicalData = builder.Build(summary, _metrics, fileToMainDeveloper);

            return(new HierarchicalDataContext(hierarchicalData, scheme));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Same as knowledge but uses a different color scheme
        /// </summary>
        public HierarchicalDataContext AnalyzeKnowledgeLoss(string developer, IBrushFactory brushFactory, IAliasMapping aliasMapping)
        {
            LoadContributions(false);
            var localFileToContribution = AliasTransformContribution(_contributions, aliasMapping);

            developer = aliasMapping.GetAlias(developer);

            var summary             = _history.GetArtifactSummary(_extendedDisplayFilter, aliasMapping);
            var fileToMainDeveloper = localFileToContribution.ToDictionary(pair => pair.Key, pair => pair.Value.GetMainDeveloper());

            // Build the knowledge data
            var builder          = new KnowledgeBuilder(developer);
            var hierarchicalData = builder.Build(summary, _metrics, fileToMainDeveloper);

            var dataContext = new HierarchicalDataContext(hierarchicalData, brushFactory);

            dataContext.AreaSemantic   = Strings.LinesOfCode;
            dataContext.WeightSemantic = Strings.NotAvailable;
            return(dataContext);
        }
Ejemplo n.º 4
0
        public HierarchicalDataContext AnalyzeKnowledge()
        {
            LoadHistory();
            LoadMetrics();
            LoadContributions(false);

            var summary             = _history.GetArtifactSummary(Project.Filter, new HashSet <string>(_metrics.Keys));
            var fileToMainDeveloper = _contributions.ToDictionary(pair => pair.Key, pair => pair.Value.GetMainDeveloper());

            // Assign a color to each developer
            var mainDevelopers = fileToMainDeveloper.Select(pair => pair.Value.Developer).Distinct();
            var scheme         = new ColorScheme(mainDevelopers.ToArray());

            var legend = new LegendBitmap(scheme);

            legend.CreateLegendBitmap(Path.Combine(Project.Cache, "knowledge_color.bmp"));

            // Build the knowledge data
            var builder          = new KnowledgeBuilder();
            var hierarchicalData = builder.Build(summary, _metrics, fileToMainDeveloper);

            return(new HierarchicalDataContext(hierarchicalData, scheme));
        }