Beispiel #1
0
        protected override TableDefinition Content(ReportData reportData, Dictionary <string, string> options)
        {
            #region Required Options
            string moduleIdstr = (options != null && options.ContainsKey("M") ? options["M"] : string.Empty);
            int    moduleId;
            if (string.IsNullOrWhiteSpace(moduleIdstr) || !Int32.TryParse(moduleIdstr, out moduleId))
            {
                moduleId = -1;
            }

            #endregion Required Options

            List <String> rowData = new List <String>();
            rowData.AddRange(new string[] { Labels.TechnicalDebt + " (" + reportData.CurrencySymbol + ")", Labels.TQI, Labels.Size });

            if (reportData != null && reportData.CurrentSnapshot != null)
            {
                double?TQIValue      = 0;
                double?TechDebtValue = 0;
                double?COLValue      = 0;

                if (moduleId > 0)
                {
                    TQIValue      = BusinessCriteriaUtility.GetBusinessCriteriaModuleGrade(reportData.CurrentSnapshot, moduleId, Constants.BusinessCriteria.TechnicalQualityIndex, true);
                    TechDebtValue = MeasureUtility.GetModuleMeasureGrade(reportData.CurrentSnapshot, moduleId, Constants.SizingInformations.TechnicalDebt);
                    COLValue      = MeasureUtility.GetModuleMeasureGrade(reportData.CurrentSnapshot, moduleId, Constants.SizingInformations.CodeLineNumber);
                }
                else
                {
                    TQIValue      = BusinessCriteriaUtility.GetSnapshotBusinessCriteriaGrade(reportData.CurrentSnapshot, Constants.BusinessCriteria.TechnicalQualityIndex, true);
                    TechDebtValue = MeasureUtility.GetSizingMeasure(reportData.CurrentSnapshot, Constants.SizingInformations.TechnicalDebt);
                    COLValue      = MeasureUtility.GetSizingMeasure(reportData.CurrentSnapshot, Constants.SizingInformations.CodeLineNumber);
                }

                rowData.Add(TQIValue.GetValueOrDefault().ToString());
                rowData.Add(TechDebtValue.GetValueOrDefault().ToString());
                rowData.Add(COLValue.GetValueOrDefault().ToString());
            }

            TableDefinition resultTable = new TableDefinition
            {
                HasRowHeaders    = false,
                HasColumnHeaders = true,
                NbRows           = 2,
                NbColumns        = 3,
                Data             = rowData
            };
            return(resultTable);
        }