mirror of
https://github.com/nidebr/as-stats-gui.git
synced 2025-02-20 11:23:18 +08:00
136 lines
5.5 KiB
PHP
136 lines
5.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use NunoMaduro\PhpInsights\Domain\Insights\CyclomaticComplexityIsHigh;
|
|
use NunoMaduro\PhpInsights\Domain\Insights\ForbiddenDefineFunctions;
|
|
use NunoMaduro\PhpInsights\Domain\Insights\ForbiddenNormalClasses;
|
|
use NunoMaduro\PhpInsights\Domain\Insights\ForbiddenTraits;
|
|
use NunoMaduro\PhpInsights\Domain\Sniffs\ForbiddenSetterSniff;
|
|
use PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UselessOverridingMethodSniff;
|
|
use PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff;
|
|
use PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff;
|
|
use PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff;
|
|
use PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff;
|
|
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
|
|
use PhpCsFixer\Fixer\ReturnNotation\ReturnAssignmentFixer;
|
|
use SlevomatCodingStandard\Sniffs\Classes\ForbiddenPublicPropertySniff;
|
|
use SlevomatCodingStandard\Sniffs\Classes\SuperfluousAbstractClassNamingSniff;
|
|
use SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff;
|
|
use SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff;
|
|
use SlevomatCodingStandard\Sniffs\Classes\SuperfluousTraitNamingSniff;
|
|
use SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff;
|
|
use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff;
|
|
use SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff;
|
|
use SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff;
|
|
use SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff;
|
|
use SlevomatCodingStandard\Sniffs\TypeHints\DisallowArrayTypeHintSyntaxSniff;
|
|
use SlevomatCodingStandard\Sniffs\TypeHints\DisallowMixedTypeHintSniff;
|
|
use SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff;
|
|
use SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff;
|
|
use SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff;
|
|
|
|
return [
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Default Preset
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This option controls the default preset that will be used by PHP Insights
|
|
| to make your code reliable, simple, and clean. However, you can always
|
|
| adjust the `Metrics` and `Insights` below in this configuration file.
|
|
|
|
|
| Supported: "default", "laravel", "symfony", "magento2", "drupal"
|
|
|
|
|
*/
|
|
|
|
'preset' => 'symfony',
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| IDE
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This options allow to add hyperlinks in your terminal to quickly open
|
|
| files in your favorite IDE while browsing your PhpInsights report.
|
|
|
|
|
| Supported: "textmate", "macvim", "emacs", "sublime", "phpstorm",
|
|
| "atom", "vscode".
|
|
|
|
|
| If you have another IDE that is not in this list but which provide an
|
|
| url-handler, you could fill this config with a pattern like this:
|
|
|
|
|
| myide://open?url=file://%f&line=%l
|
|
|
|
|
*/
|
|
|
|
'ide' => null,
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Configuration
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here you may adjust all the various `Insights` that will be used by PHP
|
|
| Insights. You can either add, remove or configure `Insights`. Keep in
|
|
| mind, that all added `Insights` must belong to a specific `Metric`.
|
|
|
|
|
*/
|
|
|
|
'exclude' => [
|
|
'Kernel.php',
|
|
],
|
|
|
|
|
|
'remove' => [
|
|
DisallowYodaComparisonSniff::class,
|
|
ForbiddenSetterSniff::class,
|
|
ForbiddenNormalClasses::class,
|
|
SuperfluousExceptionNamingSniff::class,
|
|
SuperfluousTraitNamingSniff::class,
|
|
SuperfluousAbstractClassNamingSniff::class,
|
|
SuperfluousInterfaceNamingSniff::class,
|
|
FunctionLengthSniff::class,
|
|
SpaceAfterNotSniff::class,
|
|
OrderedClassElementsFixer::class,
|
|
LineLengthSniff::class,
|
|
DocCommentSpacingSniff::class,
|
|
ForbiddenTraits::class,
|
|
UselessOverridingMethodSniff::class, // Parfois nécessaire notamment sur les Enum
|
|
DisallowMixedTypeHintSniff::class,
|
|
UnusedParameterSniff::class,
|
|
ForbiddenPublicPropertySniff::class,
|
|
InlineDocCommentDeclarationSniff::class,
|
|
ReturnAssignmentFixer::class,
|
|
ForbiddenDefineFunctions::class, // Todo A supprimer quand https://github.com/nunomaduro/phpinsights/issues/577 sera corrigé
|
|
SideEffectsSniff::class, // TODO À supprimer quand les classes readonly seront prise en charge
|
|
DisallowArrayTypeHintSyntaxSniff::class,
|
|
PropertyTypeHintSniff::class,
|
|
ParameterTypeHintSniff::class,
|
|
ReturnTypeHintSniff::class,
|
|
UpperCaseConstantNameSniff::class,
|
|
],
|
|
|
|
'config' => [
|
|
CyclomaticComplexityIsHigh::class => [
|
|
'maxComplexity' => 100,
|
|
],
|
|
],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Requirements
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here you may define a level you want to reach per `Insights` category.
|
|
| When a score is lower than the minimum level defined, then an error
|
|
| code will be returned. This is optional and individually defined.
|
|
|
|
|
*/
|
|
|
|
'requirements' => [
|
|
'min-quality' => 100,
|
|
'min-complexity' => 0,
|
|
'min-architecture' => 100,
|
|
'min-style' => 100,
|
|
],
|
|
];
|