Code Duplication    Length = 12-12 lines in 2 locations

src/main/php/PHPMD/RuleSetFactory.php 2 locations

@@ 371-382 (lines=12) @@
368
            $rule->setSince((string) $ruleNode['since']);
369
        }
370
371
        foreach ($ruleNode->children() as $node) {
372
            /** @var $node \SimpleXMLElement */
373
            if ($node->getName() === 'description') {
374
                $rule->setDescription((string) $node);
375
            } elseif ($node->getName() === 'example') {
376
                $rule->addExample((string) $node);
377
            } elseif ($node->getName() === 'priority') {
378
                $rule->setPriority((integer) $node);
379
            } elseif ($node->getName() === 'properties') {
380
                $this->parsePropertiesNode($rule, $node);
381
            }
382
        }
383
384
        if ($rule->getPriority() <= $this->minimumPriority && $rule->getPriority() >= $this->maximumPriority) {
385
            $ruleSet->addRule($rule);
@@ 421-432 (lines=12) @@
418
            $rule->setExternalInfoUrl((string) $ruleNode['externalInfoUrl']);
419
        }
420
421
        foreach ($ruleNode->children() as $node) {
422
            /** @var $node \SimpleXMLElement */
423
            if ($node->getName() === 'description') {
424
                $rule->setDescription((string) $node);
425
            } elseif ($node->getName() === 'example') {
426
                $rule->addExample((string) $node);
427
            } elseif ($node->getName() === 'priority') {
428
                $rule->setPriority((integer) $node);
429
            } elseif ($node->getName() === 'properties') {
430
                $this->parsePropertiesNode($rule, $node);
431
            }
432
        }
433
434
        if ($rule->getPriority() <= $this->minimumPriority && $rule->getPriority() >= $this->maximumPriority) {
435
            $ruleSet->addRule($rule);