Method signature and comment are opposite

The documentation of a method is in contradiction with its declaration.

Example: method isNavigateForwardEnabled is in contradiction with its comment documenting ”a back navigation”, as “forward” and “back” are antonyms.

Related smells: Attribute name and type are opposite Method name and return type are opposite Attribute signature and comment are opposite

Reference

Venera Arnaoudova, Massimiliano Di Penta, Giuliano Antoniol. “Linguistic antipatterns: what they are and how developers perceive them". in Empirical Software Engineering (ESEM), 21(1), Feb 2016. 104-158. 10.1007/s10664-014-9350-8


Implementation Smells

Home

All rights reserved (c) Tushar Sharma 2017-23.