java - Does Sonar's complexity metric include equals() and hashCode() methods -


when sonar calculates cyclomatic complexity equals() , hashcode() methods included?

if there way exclude them?

yes, every method used compute overall complexity of enclosing class.

i guess understand why you're asking such question: modern ides generate #equals() , #hashcode() methods you, , generated method tend quite complex. however, part of code, , add complexity: should tested - other method, prevent regression.


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -