Jump to content

Software Design/Code smells/Function is used in many places

From Wikiversity

Checklist questions:

  • Could an abstraction or an aspect be extracted so that a function defined in the project is used in fewer places?

This code smell is a lead to applying practice Don't repeat logic in several places.

A non-library function used in many different places may be a sign that some abstractions are missing, or the repetition is not removed vigorously enough, for example, in unit test code.

If the calls to the function are refactored in two parallel commits, it leads to large, not automatically mergeable conflict.

Why not

[edit | edit source]

Widely used library functions, especially operations on collections.