YetiForceCompany/YetiForceCRM

View on GitHub
.php-cs-fixer.dist.php

Summary

Maintainability
A
0 mins
Test Coverage

Call to method __construct from undeclared class \PhpCsFixer\Config (Did you mean class \App\Config or class \Tests\App\Config)
Open

$config = new PhpCsFixer\Config();
Severity: Critical
Found in .php-cs-fixer.dist.php by phan

Call to method create from undeclared class \PhpCsFixer\Finder
Open

        PhpCsFixer\Finder::create()
Severity: Critical
Found in .php-cs-fixer.dist.php by phan

Call to method setRiskyAllowed from undeclared class \PhpCsFixer\Config (Did you mean class \App\Config or class \Tests\App\Config)
Open

$config->setRiskyAllowed(true)
Severity: Critical
Found in .php-cs-fixer.dist.php by phan

Define a constant instead of duplicating this literal "elements" 3 times.
Open

        'class_attributes_separation' => ['elements' => ['method' => 'one']],
Severity: Critical
Found in .php-cs-fixer.dist.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Line exceeds 120 characters; contains 270 characters
Open

        'phpdoc_separation' => ['groups' => [['deprecated', 'link', 'see', 'since'], ['author', 'copyright', 'license'], ['category', 'package', 'subpackage'], ['property', 'property-read', 'property-write'], ['param'], ['return']], 'skip_unlisted_annotations' => true],
Severity: Minor
Found in .php-cs-fixer.dist.php by phpcodesniffer

Line exceeds 120 characters; contains 175 characters
Open

        'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
Severity: Minor
Found in .php-cs-fixer.dist.php by phpcodesniffer

There are no issues that match your filters.

Category
Status