Code Duplication    Length = 11-11 lines in 2 locations

src/main/php/PHPMD/Rule/Naming/LongVariable.php 1 location

@@ 141-151 (lines=11) @@
138
     * @param string $type
139
     * @return boolean
140
     */
141
    protected function isChildOf(AbstractNode $node, $type)
142
    {
143
        $parent = $node->getParent();
144
        while (is_object($parent)) {
145
            if ($parent->isInstanceOf($type)) {
146
                return true;
147
            }
148
            $parent = $parent->getParent();
149
        }
150
151
        return false;
152
    }
153
154
    /**

src/main/php/PHPMD/Rule/Naming/ShortVariable.php 1 location

@@ 239-249 (lines=11) @@
236
     * @param string $type
237
     * @return boolean
238
     */
239
    protected function isChildOf(AbstractNode $node, $type)
240
    {
241
        $parent = $node->getParent();
242
        while (is_object($parent)) {
243
            if ($parent->isInstanceOf($type)) {
244
                return true;
245
            }
246
            $parent = $parent->getParent();
247
        }
248
249
        return false;
250
    }
251
252
    /**