Commit 10805821 authored by Johannes Salentin's avatar Johannes Salentin
Browse files

alternative for weakened modularity

based on cluster method, but may be inaccurate due to many unimportant relations
parent 32f30627
Pipeline #159613 passed with stages
in 1 minute and 23 seconds
......@@ -39,8 +39,6 @@ public class EASmellDetector {
String totalTime = calculateTimeConsumption(startTotalTime);
System.out.println("\nFinished detection in " + totalTime);
System.out.println(model.getCluster(model.getElementByIdentifier("id-7281a6e6-6586-4fa5-8d27-6cb69cfc1e93")));
}
private static void printSmells(List<EASmell> smells) {
......
......@@ -31,4 +31,27 @@ public class WeakenedModularity extends Detector {
}
return result;
}
// cluster scope
// public List<EASmell> detect() {
// for (ElementType element : model.getElements()) {
// Set<ElementType> cluster = model.getCluster(element);
// int internal = 0;
// int external = 0;
// for (RelationshipType relationship : model.getRelationships()) {
// ElementType target = (ElementType) relationship.getTarget();
// ElementType source = (ElementType) relationship.getSource();
// if (cluster.contains(source) && cluster.contains(target)) {
// internal++;
// } else if ((cluster.contains(source) && !cluster.contains(target)) || (cluster.contains(target) && !cluster.contains(source))) {
// external++;
// }
// }
// double mr = (double) internal / (double) external;
// if (mr < MODULARITY_RATIO && mr > 0) {
// addToSmells(new EASmell("Weakened Modularity", element, " with a modularity ratio of " + mr));
// }
// }
// return result;
// }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment