ml-in-programming / ArchitectureReloaded

Design defects detection plugin for IntelliJ IDEA. Based on BasLeijdekkers/MetricsReloaded plugin.
Other
8 stars 3 forks source link

CCDA doesn't have deterministic output #111

Open RamSaw opened 5 years ago

RamSaw commented 5 years ago

On project ant_modified (from dataset in JB format) output isn't the same all the times when we run. If we run CCDA in the same session (for example second time without closing IDE) the outputs are the same. But if we close IDE and then run, the outputs differ sometimes. Probably the problem is as follows: PSI tree is built each time when we load project and this tree can differ from time to time (different order of processing files for example), CCDA is sensitive to order of entities that passed to it and that is why the output differs.

Ivan-Veselov commented 5 years ago

Possible reasons: EntitySearcher every run produces entities in different order; new version of AlgorithmsUtil.getDominantClass has non-deterministic behaviour in case when dominant class is ambiguous.

Ivan-Veselov commented 5 years ago

New version of EntitySearcher that is introduced in #122 preserves order of entities.