Skip to content

Ferramenta para avaliar violações de Lei de Demeter.

Notifications You must be signed in to change notification settings

DaveJosef/enclose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enclose

Ferramenta para avaliar violações de Lei de Demeter. [versão do JDK: 11]

// BEFORE
// target class
class A {
  private List<A> elements;
  public List<A> getElements() {
    return this.elements;
  }
}
  
// client class
class C {
  private A a;
  public void m() {
    a.getElements().add(new A());
  }
}
// AFTER
// target class
class A {
  private List<A> elements;
  
  public List<A> getElements() {
    return this.elements;
  }
  
  public boolean newMethod(A newParameter1) {
    return this.getElements().add(newParameter1);
  }
}
  
// client class
class C {
  private A a;
  public void m() {
    a.newMethod(new A());
  }
}

About

Ferramenta para avaliar violações de Lei de Demeter.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages