public ModuleMetric Calculate(Project project)
        {
            Compilation      compilation      = ProjectExtensions.GetCompilation(project);
            IModuleSymbol    moduleSymbol     = compilation.Assembly.Modules.FirstOrDefault <IModuleSymbol>();
            NamespaceMetrics namespaceMetric  = ModuleMetricsCalculator.CalculateNamespaceMetrics(project, this.IgnoreGeneratedCode);
            NamespaceMetrics namespaceMetric1 = namespaceMetric;

            if (namespaceMetric == null)
            {
                return(null);
            }
            IEnumerable <string> strs = ModuleMetricsCalculator.CalculateClassCoupling(namespaceMetric1);
            double       num          = ModuleMetricsCalculator.CalculateMaintainabilityIndex(namespaceMetric1);
            int          num1         = ModuleMetricsCalculator.CalculateCyclomaticComplexity(namespaceMetric1);
            int          num2         = this.CalculateDepthOfInheritance(namespaceMetric1);
            int          num3         = ModuleMetricsCalculator.CalculateLinesOfCode(namespaceMetric1);
            int          num4         = namespaceMetric1.Results.Count <NamespaceMetric>();
            int          num5         = ModuleMetricsCalculator.CalculateNumberOfTypes(namespaceMetric1);
            int          num6         = ModuleMetricsCalculator.CalculateNumberOfMethods(namespaceMetric1);
            ModuleMetric moduleMetric = new ModuleMetric();

            moduleMetric.ModuleName       = moduleSymbol.Name;
            moduleMetric.ProjectFile      = project.FilePath ?? string.Empty;
            moduleMetric.AssemblyVersion  = string.Empty;
            moduleMetric.FileVersion      = string.Empty;
            moduleMetric.NamespaceMetrics = namespaceMetric1;
            List <MetricResult> metricResults = new List <MetricResult>();

            moduleMetric.AddMetricResult(new MetricResult()
            {
                Name  = "MaintainabilityIndex",
                Value = num
            });

            moduleMetric.AddMetricResult(new MetricResult
            {
                Name  = "CyclomaticComplexity",
                Value = num1
            });
            moduleMetric.AddMetricResult(new ClassCouplingMetricResult
            {
                Name  = "ClassCoupling",
                Value = strs.Count <string>(),
                Types = strs
            });
            moduleMetric.AddMetricResult(new MetricResult
            {
                Name  = "DepthOfInheritance",
                Value = num2
            });
            moduleMetric.AddMetricResult(new MetricResult
            {
                Name  = "LinesOfCode",
                Value = num3
            });
            moduleMetric.AddMetricResult(new MetricResult
            {
                Name  = "NumberOfNamespaces",
                Value = num4
            });
            moduleMetric.AddMetricResult(new MetricResult
            {
                Name  = "NumberOfTypes",
                Value = num5
            });
            moduleMetric.AddMetricResult(new MetricResult
            {
                Name  = "NumberOfMethods",
                Value = num6
            });
            return(moduleMetric);
        }