Skip to content

Instantly share code, notes, and snippets.

@cleuton
Created March 18, 2014 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleuton/9617726 to your computer and use it in GitHub Desktop.
Save cleuton/9617726 to your computer and use it in GitHub Desktop.
LCOM4 Bad
public class One {
int x;
int y;
void a() {
b();
}
int b() {
return this.x;
}
int c() {
return this.y;
}
int d() {
return e(this.y);
}
int e(int number) {
return number * 2;
}
}
@cleuton
Copy link
Author

cleuton commented Mar 18, 2014

LCOM4 bad sample:

a() - b() - x
c() - y - d() - e()

So, LCOM4 = 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment