Code Duplication    Length = 11-11 lines in 2 locations

code/model/UserDefinedForm.php 2 locations

@@ 469-479 (lines=11) @@
466
							$expression = ($checkboxField || $radioField) ? '!($(this).is(":checked"))' : '$(this).val() == ""';
467
468
							break;
469
						case 'HasValue':
470
							if ($checkboxField) {
471
								$expression = '$(this).prop("checked")';
472
							} else if ($radioField) {
473
								// We cannot simply get the value of the radio group, we need to find the checked option first.
474
								$expression = '$(this).parents(".field, .control-group").find("input:checked").val()=="'. $rule->FieldValue .'"';
475
							} else {
476
								$expression = '$(this).val() == "'. $rule->FieldValue .'"';
477
							}
478
479
							break;
480
						case 'ValueLessThan':
481
							$expression = '$(this).val() < parseFloat("'. $rule->FieldValue .'")';
482
@@ 496-506 (lines=11) @@
493
							$expression = '$(this).val() >= parseFloat("'. $rule->FieldValue .'")';
494
495
							break;
496
						default: // ==HasNotValue
497
							if ($checkboxField) {
498
								$expression = '!$(this).prop("checked")';
499
							} else if ($radioField) {
500
								// We cannot simply get the value of the radio group, we need to find the checked option first.
501
								$expression = '$(this).parents(".field, .control-group").find("input:checked").val()!="'. $rule->FieldValue .'"';
502
							} else {
503
								$expression = '$(this).val() != "'. $rule->FieldValue .'"';
504
							}
505
506
							break;
507
					}
508
509
					if(!isset($watch[$fieldToWatch])) {