Code Duplication    Length = 6-7 lines in 3 locations

code/converters/thirdparty/Services_JSON.php 3 locations

@@ 711-716 (lines=6) @@
708
                            // odd number of backslashes at the end of the string so far
709
                            array_pop($stk);
710
                        // print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
711
                        } elseif (($chrs{$c} == '[') &&
712
                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
713
                            // found a left-bracket, and we are in an array, object, or slice
714
                            array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
715
                        // print("Found start of array at {$c}\n");
716
                        } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
717
                            // found a right-bracket, and we're in an array
718
                            array_pop($stk);
719
                        // print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
@@ 720-725 (lines=6) @@
717
                            // found a right-bracket, and we're in an array
718
                            array_pop($stk);
719
                        // print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
720
                        } elseif (($chrs{$c} == '{') &&
721
                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
722
                            // found a left-brace, and we are in an array, object, or slice
723
                            array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
724
                        //print("Found start of object at {$c}\n");
725
                        } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
726
                            // found a right-brace, and we're in an object
727
                            array_pop($stk);
728
                        //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
@@ 729-735 (lines=7) @@
726
                            // found a right-brace, and we're in an object
727
                            array_pop($stk);
728
                        //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
729
                        } elseif (($substr_chrs_c_2 == '/*') &&
730
                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
731
                            // found a comment start, and we are in an array, object, or slice
732
                            array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
733
                            $c++;
734
                        // print("Found start of comment at {$c}\n");
735
                        } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
736
                            // found a comment end, and we're in one now
737
                            array_pop($stk);
738
                            $c++;