Showing 181 of 185 total issues
Function register
has a Cognitive Complexity of 17 (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 17 (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 17 (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 configureOptions
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function configureOptions(OptionsResolver $resolver): void
{
$choiceLoader = function (Options $options) {
// Unless the choices are given explicitly, load them on demand
if (null === $options['choices']) {
Method getConfigTreeBuilder
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(__CLASS__);
$treeBuilder->getRootNode()
Method addProvidersSection
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addProvidersSection(ArrayNodeDefinition $rootNode): void
{
$providerNodeBuilder = $rootNode
->fixXmlConfig('provider')
->children()
Method getConfigTreeBuilder
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(__CLASS__);
$treeBuilder->getRootNode()
Method boot
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot(Container $container): void
{
if (!$container->typed(Application::class)) {
return;
}
Method register
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $container, array $configs = []): void
{
if (!$configs['enabled']) {
return;
}
Method register
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $container, array $configs = []): void
{
if (!$configs['enabled']) {
return;
}
Method register
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $container, array $configs = []): void
{
if (!\class_exists(AnnotationLoader::class)) {
throw new \LogicException('Annotations/Attributes support cannot be enabled as the Annotation component is not installed. Try running "composer require biurad/annotations".');
}
Method getConfigTreeBuilder
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(__CLASS__);
$treeBuilder->getRootNode()
Method getConfigTreeBuilder
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(__CLASS__);
$treeBuilder->getRootNode()
Method runBlockingServer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function runBlockingServer(SymfonyStyle $io, InputInterface $input, OutputInterface $output): int
{
$callback = null;
$disableOutput = false;
Method execute
has 46 lines of code (exceeds 25 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)) {
Method getEntitiesByIds
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getEntitiesByIds(string $identifier, array $values): array
{
if (null !== $this->queryBuilder->getMaxResults() || 0 < (int) $this->queryBuilder->getFirstResult()) {
// an offset or a limit would apply on results including the where clause with submitted id values
// that could make invalid choices valid
Method register
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Container $container, array $configs = []): void
{
if (!\interface_exists(DatabaseProviderInterface::class)) {
throw new \LogicException('Cycle Database support cannot be enabled as the Database component is not installed. Try running "composer require cycle/database".');
}
Function boot
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function boot(Container $container): void
{
if (!$container->has('validator')) {
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 14 (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 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(__CLASS__);
$treeBuilder->getRootNode('notifier')