Versions Compared

Key

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

...

This noncompliant example shows how side-effects in expressions can lead to unanticipated outcomes. The programmer intends to write access control logic based on different threshold levels. Each user has a rating that must be above the threshold, to be granted appropriate access. As shown, a simple function is used to calculate the rating. The get() method has been is used to provide a non-zero factor when the user is authorized and a zero value, when not.

...