Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想收集哪些方法可以安全地从超类下推到子类,特别是当您只有一个子类并且没有理由在超类中维护该方法时。
可能是动态地发现这些方法(在执行期间)以检查哪些方法在超类中执行,并且鉴于只有一个子类,它们可以被推下?有人做过这个吗?可能有工具吗?
重构引擎包含各种代码评论规则,用于检测可能由您描述的问题引起的情况,例如“未引用的变量”、“实用方法”、“引用抽象类”、“未引用的类”……
重构引擎当然也可以下推检测到的方法,并从层次结构中删除未使用的类。