Refactor functionality
Refactor functionality

The previous solution was a function that used multiple conditional statements (if/elif) to determine what the value was and what results should be returned. This led to a high cyclomatic complexity (cc) number because of the many paths.

The new solution uses an class based solution where an object contains the list of possible options. Each item in the list has a corresponding function that returns the result based off the option picked. I've also created a function called 'checkTag'. This basically replaces the previous functionality in that it traverses across the object and compares the value with each tag in the object.  Depending on the result of the comparison, the method of the chosen conditional is called, which produces the according result.
ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public