Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Explenation:

This rule analyses all expressions and determines wether they are using TODAY in a correct manner:

  • It may only be used as defaultvalue for 1 attribute
  • It must always be called via this 1 attribute, never directly in other expressions

Possible improvements

Make an attribute which contains TODAY and use references to this attribute everywhere you currently have "TODAY". This attribute can then easily be used for time travelling.

Example:


Image Added

This expression compares a date with TODAY to calculate the age of a child. This can lead to issues when testing requires timetravelling. By replacing using a reference attribute only this 1 attribute will need to be changed whenever time-travelling is required instead of having to change every expression mentioning TODAY.

It results in this code smell:

Image Added