Code Duplication    Length = 11-11 lines in 2 locations

code/model/UserDefinedForm.php 2 locations

@@ 501-511 (lines=11) @@
498
                            $expression = ($checkboxField || $radioField) ? '!($(this).is(":checked"))' : '$(this).val() == ""';
499
500
                            break;
501
                        case 'HasValue':
502
                            if ($checkboxField) {
503
                                $expression = '$(this).prop("checked")';
504
                            } elseif ($radioField) {
505
                                // We cannot simply get the value of the radio group, we need to find the checked option first.
506
                                $expression = '$(this).parents(".field, .control-group").find("input:checked").val()=="'. $rule->FieldValue .'"';
507
                            } else {
508
                                $expression = '$(this).val() == "'. $rule->FieldValue .'"';
509
                            }
510
511
                            break;
512
                        case 'ValueLessThan':
513
                            $expression = '$(this).val() < parseFloat("'. $rule->FieldValue .'")';
514
@@ 528-538 (lines=11) @@
525
                            $expression = '$(this).val() >= parseFloat("'. $rule->FieldValue .'")';
526
527
                            break;
528
                        default: // ==HasNotValue
529
                            if ($checkboxField) {
530
                                $expression = '!$(this).prop("checked")';
531
                            } elseif ($radioField) {
532
                                // We cannot simply get the value of the radio group, we need to find the checked option first.
533
                                $expression = '$(this).parents(".field, .control-group").find("input:checked").val()!="'. $rule->FieldValue .'"';
534
                            } else {
535
                                $expression = '$(this).val() != "'. $rule->FieldValue .'"';
536
                            }
537
538
                            break;
539
                    }
540
541
                    if (!isset($watch[$fieldToWatch])) {