Code Duplication    Length = 4-4 lines in 2 locations

lib/modules/mod_isbn/ISBN.php 2 locations

@@ 634-637 (lines=4) @@
631
            return false;
632
        }
633
        $sum = 0;
634
        for ($i = 0; $i < 10; $i++) {
635
            $v    = intval(substr($isbnbody, $i, 1));
636
            $sum += $v * (10 - $i);
637
        }
638
        $remainder  = $sum % 11;
639
        $checkdigit = 11 - $remainder;
640
        if ($remainder == 0) {
@@ 676-679 (lines=4) @@
673
        */
674
        $ii = 1;
675
        $sum = 0;
676
        for ($i = 0; $i < 13; $i++) {
677
            $ii   = 1 - $ii;
678
            $sum += intval(substr($t, $i, 1)) * ($ii * 2 + 1);
679
        }
680
        /* Step 2: Divide the sum of the weighted products of the first 12
681
         * digits of the ISBN calculated in step 1 by 10, determining the
682
         * remainder. (see p.11 2005 handbook)