cqfn / jpeek

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

LCOM4 returns values less than 1? #483

Open Mathias83 opened 4 years ago

Mathias83 commented 4 years ago

Hello, everyone, when evaluating one of my projects using the LCOM4 metric I come across values that are implausible for me. Basically LCOM4 should be at least 1, because here the connected components are calculated in the graph. But I usually get values smaller than 1. Even with files where I assume that they have more than one component.

Did I misunderstand the metrics or is there really a mistake here?

0crat commented 4 years ago

@paulodamaso/z please, pay attention to this issue

paulodamaso commented 4 years ago

@0crat in

lyriccoder commented 4 years ago

LCOM4 is the number of components, isn't it? The value must be an integer. Why does it have float value? Do u divide the value by anything? I wanted to create an issue, but I see that @Mathias83 has the same problem.

Moreover, I see a negative value. How is it possible?

Here is the project I checked:

classes.zip

Could you please fix it?

FireShot Capture 104 - LCOM4 -