Method run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run($files)
{
try {
$resultFile = tempnam(sys_get_temp_dir(), 'phpcodesniffer');
Function queuePaths
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function queuePaths($dir, $prefix = '', $exclusions = []) {
$dir = rtrim($dir, '\\/');
foreach (scandir($dir) as $f) {
if (in_array("$prefix$f", $exclusions)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function run($files)
{
try {
$resultFile = tempnam(sys_get_temp_dir(), 'phpcodesniffer');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function queueWithIncludePaths
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function queueWithIncludePaths() {
foreach ($this->config['include_paths'] as $f) {
if ($f !== '.' and $f !== '..') {
if (is_dir($f)) {
$this->queuePaths("$f", "$f/");
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Runner
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if(isset($this->config['include_paths'])) {
- Exclude checks
Opening brace should be on a new line Open
private function fileExtensions() {
- Exclude checks
Opening brace should be on a new line Open
public function queuePaths($dir, $prefix = '', $exclusions = []) {
- Exclude checks
Opening brace should be on a new line Open
public function filterByExtension($f, $prefix = '') {
- Exclude checks
Opening brace should be on a new line Open
public function queueWithIncludePaths() {
- Exclude checks