Try   HackMD

Speculative Generality

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

徵兆與症狀

有未用到的類別、方法、欄位或參數。

出現原因

在設計跟實作時,過度思考未來擴充的彈性,但這些擴充從來沒有出現過。

處理方法

  • 移除不必要的抽象類別,可以用 Collapse Hierarchy
  • 非必要的委派,可以用 Inline FunctionInline Class
  • 未用到的參數或非必要的參數傳遞,可以用 Change Function Declaration 來移除。
  • 一個方法的呼叫端只有測試案例的話,可以用 Remove Dead Code 直接移除。