lcom

Why Does Lack of Cohesion Of Methods (LCOM) Include Getters and Setters

独自空忆成欢 提交于 2019-12-03 08:35:52
问题 I am looking at the LCOM metric as shown here, http://www.ndepend.com/Metrics.aspx So we are saying a few things, 1) A class is utterly cohesive if all its methods use all its instance fields 2) Both static and instance methods are counted, it includes also constructors, properties getters/setters, events add/remove methods If I look at a class such as this, public class Assessment { public int StartMetres { get; set; } public int EndMetres { get; set; } public decimal? NumericResponse { get;

Why Does Lack of Cohesion Of Methods (LCOM) Include Getters and Setters

三世轮回 提交于 2019-12-03 00:05:44
I am looking at the LCOM metric as shown here, http://www.ndepend.com/Metrics.aspx So we are saying a few things, 1) A class is utterly cohesive if all its methods use all its instance fields 2) Both static and instance methods are counted, it includes also constructors, properties getters/setters, events add/remove methods If I look at a class such as this, public class Assessment { public int StartMetres { get; set; } public int EndMetres { get; set; } public decimal? NumericResponse { get; set; } public string FreeResponse { get; set; } public string Responsetype { get; set; } public string