private static void AnalyzePropertie(ProjectAnalysisData prj, ClassAnalysisData cls, ClassMetrics clsMetrics) { foreach (var prop in cls.Properties) { break; } }
public void Calculate(ProjectAnalysisData prj, ClassMetrics clsMetrics, ClassAnalysisData cls) { clsMetrics.Classname = cls.ClassDeclarationSyntax.Identifier.ValueText; clsMetrics.Classdocpath = cls.ClassDeclarationSyntax.SyntaxTree.FilePath; clsMetrics.Namespacename = cls.Namespace.Namespacedeclaration.Name.ToString(); SemanticModel sclsmodel = prj.CompiledProject.GetSemanticModel(cls.ClassDeclarationSyntax.SyntaxTree); foreach (var rule in _rulesList) { rule.CalculateClassMetrics(prj, clsMetrics, cls, sclsmodel); } }
public void Calculate(ProjectAnalysisData prj, ClassMetrics clsMetrics, ClassAnalysisData cls) { SemanticModel smtdmodel = prj.CompiledProject.GetSemanticModel(cls.ClassDeclarationSyntax.SyntaxTree); foreach (var mtd in cls.Methods) { MethodMetrics mtdMetrics = new MethodMetrics(); foreach (var rule in _rulesList) { rule.CalculateMethodMetrics(prj, clsMetrics, cls, mtdMetrics, mtd.MethodDeclarationSyntax, smtdmodel); } clsMetrics.MethodMetricses.Add(mtdMetrics); } }
public IList <ClassAnalysisData> Analysis(Compilation compiledProject) { var result = new List <ClassAnalysisData>(); var classes = _modelListGetter.GetModelList(compiledProject); foreach (var item in classes) { var mtdModelList = _methodAnalyser.Analyze(item); var classModel = new ClassAnalysisData { ClassDeclarationSyntax = item, Methods = mtdModelList.ToList(), Namespace = _namespaceAnalyser.Analyse(item) }; result.Add(classModel); } return(result); }
public void CalculateMethodMetrics(ProjectAnalysisData prj, ClassMetrics clsMetrics, ClassAnalysisData cls, MethodMetrics mtdMetrics, MethodDeclarationSyntax mtd, SemanticModel sclsmodel) { LocRule loc = new LocRule(); mtdMetrics.Loc = loc.GetLocCount(mtd); }
public void CalculateClassMetrics(ProjectAnalysisData prj, ClassMetrics clsMetrics, ClassAnalysisData cls, SemanticModel sclsmodel) { CyclomaticComplexityRule cc = new CyclomaticComplexityRule(); clsMetrics.CyclomaticComplexity = cc.Calculate(cls.ClassDeclarationSyntax, sclsmodel); }
public void CalculateClassMetrics(ProjectAnalysisData prj, ClassMetrics clsMetrics, ClassAnalysisData cls, SemanticModel sclsmodel) { DepthOfInheritanceRule depthOfInheritance = new DepthOfInheritanceRule(sclsmodel); clsMetrics.DOI = depthOfInheritance.Calculate(cls.ClassDeclarationSyntax); }
public void CalculateClassMetrics(ProjectAnalysisData prj, ClassMetrics clsMetrics, ClassAnalysisData cls, SemanticModel sclsmodel) { LocRule loc = new LocRule(); clsMetrics.Loc = loc.GetLocCount(cls.ClassDeclarationSyntax); }
private static void AnalyzeMethod(ProjectAnalysisData prj, ClassAnalysisData cls, ClassMetrics clsMetrics) { MethodMetricscalculator mmc = new MethodMetricscalculator(); mmc.Calculate(prj, clsMetrics, cls); }
private static void CalculateClassMetrics(ProjectAnalysisData prj, ClassMetrics clsMetrics, ClassAnalysisData cls) { ClassMetricscalculator calculate = new ClassMetricscalculator(); calculate.Calculate(prj, clsMetrics, cls); }
public void CalculateMethodMetrics(ProjectAnalysisData prj, ClassMetrics clsMetrics, ClassAnalysisData cls, MethodMetrics mtdMetrics, MethodDeclarationSyntax mtd, SemanticModel sclsmodel) { CyclomaticComplexityRule cc = new CyclomaticComplexityRule(); mtdMetrics.CyclomaticComplexity = cc.Calculate(mtd, sclsmodel); }
public void CalculateMethodMetrics(ProjectAnalysisData prj, ClassMetrics clsMetrics, ClassAnalysisData cls, MethodMetrics mtdMetrics, MethodDeclarationSyntax mtd, SemanticModel sclsmodel) { Rule.MethodparametersRule mtdprmrule = new Rule.MethodparametersRule(); mtdMetrics.Methodparameters = mtdprmrule.GetMethodparametersCount(mtd); }