Versions Compared

Key

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

Explanation

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

  • It should only be used as default value for 1 attribute
  • It should always be called via this 1 attribute, never directly in other expressions

Possible improvements

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

Example

Image Removed

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

It results in this code smell:

counts the number of specializations of an element and reports back an issue when the configured maximum number of specializations per element is exceeded. It is recommended for maintainability purposes to keep the number of specializations of elements below this maximum, otherwise the model is considered to be too complex.

Possible improvements

Avoid specializations because they make the model more complex. Consider introducing a new element in the module instead of specializing it.

Parameter

maxSpecializations

By default the number of specializations per element maximum is one. By settings the maximum value can be increased or decreased.
Default Value:
1

Example

In this model, the value list "Amount" is defined in the "Basic" module and specialized in the "Middle" and "Top" modules. 

Image Added

This results in the following code smell:

Image AddedImage Removed