Code Duplication    Length = 4-6 lines in 6 locations

src/Ruleset.php 2 locations

@@ 332-337 (lines=6) @@
329
                    // This sniff code has already been turned off, but now
330
                    // it is being explicitly included again, so turn it back on.
331
                    $this->ruleset[(string) $rule['ref']]['severity'] = 5;
332
                    if (PHP_CodeSniffer_VERBOSITY > 1) {
333
                        echo str_repeat("\t", $depth);
334
                        echo "\t\t* disabling sniff exclusion for specific message code *".PHP_EOL;
335
                        echo str_repeat("\t", $depth);
336
                        echo "\t\t=> severity set to 5".PHP_EOL;
337
                    }
338
                } else if (empty($newSniffs) === false) {
339
                    // Including a sniff that hasn't been included higher up, but
340
                    // only including a single message from it. So turn off all messages in
@@ 695-700 (lines=6) @@
692
                return $this->processRuleset($ref.DIRECTORY_SEPARATOR.'ruleset.xml', ($depth + 2));
693
            } else {
694
                // We are referencing a whole directory of sniffs.
695
                if (PHP_CodeSniffer_VERBOSITY > 1) {
696
                    echo str_repeat("\t", $depth);
697
                    echo "\t\t* rule is referencing a directory of sniffs *".PHP_EOL;
698
                    echo str_repeat("\t", $depth);
699
                    echo "\t\tAdding sniff files from directory".PHP_EOL;
700
                }
701
702
                return $this->expandSniffDirectory($ref, ($depth + 1));
703
            }

src/Tokenizers/Tokenizer.php 4 locations

@@ 1175-1178 (lines=4) @@
1172
                            unset($openers[$lastOpener]);
1173
1174
                            $level--;
1175
                            if (PHP_CodeSniffer_VERBOSITY > 1) {
1176
                                echo str_repeat("\t", ($level + 2));
1177
                                echo '* level decreased *'.PHP_EOL;
1178
                            }
1179
                        }//end if
1180
                    }//end if
1181
@@ 1183-1186 (lines=4) @@
1180
                    }//end if
1181
1182
                    $level++;
1183
                    if (PHP_CodeSniffer_VERBOSITY > 1) {
1184
                        echo str_repeat("\t", ($level + 1));
1185
                        echo '* level increased *'.PHP_EOL;
1186
                    }
1187
1188
                    $conditions[$stackPtr] = $this->tokens[$stackPtr]['code'];
1189
                    if (PHP_CodeSniffer_VERBOSITY > 1) {
@@ 1217-1220 (lines=4) @@
1214
                            }
1215
1216
                            $oldCondition = array_pop($conditions);
1217
                            if (PHP_CodeSniffer_VERBOSITY > 1) {
1218
                                echo str_repeat("\t", ($level + 1));
1219
                                echo '* token '.token_name($oldCondition).' removed from conditions array *'.PHP_EOL;
1220
                            }
1221
1222
                            // Make sure this closer actually belongs to us.
1223
                            // Either the condition also has to think this is the
@@ 1270-1273 (lines=4) @@
1267
                            }//end if
1268
1269
                            $level--;
1270
                            if (PHP_CodeSniffer_VERBOSITY > 1) {
1271
                                echo str_repeat("\t", ($level + 2));
1272
                                echo '* level decreased *'.PHP_EOL;
1273
                            }
1274
1275
                            $this->tokens[$i]['level']      = $level;
1276
                            $this->tokens[$i]['conditions'] = $conditions;