You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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:


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:

  • No labels