cqfn / jpeek

Hosted and command-line calculator of cohesion metrics for Java code
https://i.jpeek.org
MIT License
207 stars 81 forks source link

Wrong SCOM metric #493

Open iMaks99 opened 3 years ago

iMaks99 commented 3 years ago

According to paper by [Fernandez, 06] SCOM:

As a consequence, the metric is normalized to the range [0..1], where the two extreme values are:

  • Value zero: there is no cohesion at all, i.e. every method deals with an independent set of attributes.
  • Value one: full cohesion, i.e. every method uses all the attributes of the class.

But jpeek generates result more than 1. In realisation I noticed that calculating of connection intensity is it wrong. In jpeek this value is calculating by total number of attributes of the class (which is evaluation of Class Cohesion (CC) suggested by [Perk, 98]) instead of dividing by the minimum of their cardinalities

paulodamaso commented 3 years ago

@0crat in