Showing 181 of 185 total issues
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 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 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 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)'),
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(),
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
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
Method getConfigTreeBuilder
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(__CLASS__);
$treeBuilder->getRootNode()
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)) {
Method describeColumns
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function describeColumns(AbstractTable $schema): void
{
$columnsTable = $this->table->setHeaders(
[
'Column:',
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 registerRetryableHttpClient
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function registerRetryableHttpClient(array $options, string $name, Container $container): void
{
if (!\class_exists(RetryableHttpClient::class)) {
throw new \LogicException('Support for retrying failed requests requires symfony/http-client 5.2 or higher, try upgrading.');
}
- 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
{
// The default configs ...
$container->parameters['default_locale'] = $configs['locale'] ?? 'en';
self::setPath($container, $this->rootDir, $configs['var_path'] ?? null, $configs['cache_path'] ?? null);
- 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"
Further reading
Function createRequestMatcher
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function createRequestMatcher(Container $container, string $path = null, string $host = null, int $port = null, array $methods = [], array $ips = null, array $attributes = []): Statement
{
if ($methods) {
$methods = \array_map('strtoupper', $methods);
}
- 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 handleThrowable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function handleThrowable(\Throwable $e, ServerRequestInterface $request): ResponseInterface
{
if ($request instanceof Request) {
$this->get('request_stack')->push($request->getRequest());
}
- 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"