Showing 185 of 185 total issues
Function execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$databases = $input->getArgument('db') ?? \array_keys($this->config->getDatabases());
if (!\is_array($databases)) {
- 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 processFormTypeExtensions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function processFormTypeExtensions(Container $container): array
{
$typeExtensions = $typeExtensionsClasses = [];
foreach ($container->tagged('form.type_extension') as $serviceId => $tag) {
- 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 boot
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function boot(Container $container): void
{
if (!$container->has('translator')) {
return;
}
- 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
Method boot
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot(Container $container): void
{
if (!$container->has('translator')) {
return;
}
Method register
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $container, array $configs = []): void
{
if (!$configs['enabled']) {
return;
}
Method build
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function build(callable $application, array $options = []): Application
{
$a = $options['cacheDir'] ?? \dirname((new \ReflectionClass(\Composer\Autoload\ClassLoader::class))->getFileName(), 2);
$b = 'App_'.\substr(\md5($a), 0, 10).'.php';
Method getConfigNode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getConfigNode(): ArrayNodeDefinition
{
$rootNode = new ArrayNodeDefinition('cors');
$rootNode
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->migrator->configure();
$io = new SymfonyStyle($input, $output);
Method register
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $container, array $configs = []): void
{
if (!\class_exists(Filesystem::class)) {
throw new \LogicException('Flysystem support cannot be enabled as the Flysystem library is not installed. Try running "composer require league/flysystem".');
}
Method describeForeignKeys
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function describeForeignKeys(DatabaseInterface $database, array $foreignKeys, InputInterface $input): void
{
$this->sprintf(
"\n<fg=cyan>Foreign Keys of </fg=cyan><comment>%s.%s</comment>:\n",
$database->getName(),
Method configure
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure(): void
{
$this
->setDefinition([
new InputArgument('addressport', InputArgument::OPTIONAL, 'The address to listen to (can be address:port, address, or port)'),
Function resolveSchema
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function resolveSchema($schema, ?string $cache): TypeSchema
{
if ($schema instanceof TypeSchema) {
return $schema;
}
- 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 register
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function register(Container $container, array $configs = []): void
{
if (!$configs['enabled']) {
return;
}
- 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 register
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function register(Container $container, array $configs = []): void
{
if (!$configs['enabled']) {
return;
}
- 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
Method getConfigTreeBuilder
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(__CLASS__);
$treeBuilder->getRootNode()
Method describeColumns
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function describeColumns(AbstractTable $schema): void
{
$columnsTable = $this->table->setHeaders(
[
'Column:',
Method getGenerators
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getGenerators(Container $container, string $entityPath): array
{
$generators = [new Statement(Generator\ResetTables::class)]; // re-declared table schemas (remove columns)
if (\class_exists(\Cycle\Annotated\Configurator::class)) {
Consider simplifying this complex logical expression. Open
if (
null === ($class = $container->definition($id)->getEntity())
|| !($r = new \ReflectionClass($class))
|| !$r->hasMethod($method)
|| 1 > ($m = $r->getMethod($method))->getNumberOfParameters()
Function boot
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function boot(Container $container): void
{
if (!$container->has('serializer')) {
return;
}
- 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 register
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function register(Container $container, array $configs = []): void
{
if (!\class_exists(Filesystem::class)) {
throw new \LogicException('Flysystem support cannot be enabled as the Flysystem library is not installed. Try running "composer require league/flysystem".');
}
- 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"