open-orchestra/open-orchestra-cms-bundle

View on GitHub
ModelLogBundle/DependencyInjection/OpenOrchestraModelLogExtension.php

Summary

Maintainability
A
25 mins
Test Coverage

Function load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

Severity: Minor
Found in ModelLogBundle/DependencyInjection/OpenOrchestraModelLogExtension.php - About 25 mins to fix

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

Call to method __construct from undeclared class \Symfony\Component\DependencyInjection\Definition
Open

                $definition = new Definition($content['repository'], array($content['class']));

Call to method __construct from undeclared class \Symfony\Component\DependencyInjection\Reference
Open

                $definition->setFactory(array(new Reference('object_manager'), 'getRepository'));

Call to method addMethodCall from undeclared class \Symfony\Component\DependencyInjection\Definition
Open

                $definition->addMethodCall('setAggregationQueryBuilder', array(

Parameter $container has undeclared type \Symfony\Component\DependencyInjection\ContainerBuilder
Open

    public function load(array $configs, ContainerBuilder $container)

Call to method setDefinition from undeclared class \Symfony\Component\DependencyInjection\ContainerBuilder
Open

                $container->setDefinition('open_orchestra_log.repository.' . $class, $definition);

Call to method addMethodCall from undeclared class \Symfony\Component\DependencyInjection\Definition
Open

                    $definition->addMethodCall('setFilterTypeManager', array(

Call to method load from undeclared class \Symfony\Component\DependencyInjection\Loader\YamlFileLoader
Open

        $loader->load('services.yml');

Call to method setParameter from undeclared class \Symfony\Component\DependencyInjection\ContainerBuilder
Open

                $container->setParameter('open_orchestra_log.document.' . $class . '.class', $content['class']);

Call to method __construct from undeclared class \Symfony\Component\DependencyInjection\Reference
Open

                    new Reference('doctrine_mongodb.odm.default_aggregation_query')

Call to undeclared method \OpenOrchestra\ModelLogBundle\DependencyInjection\OpenOrchestraModelLogExtension::processConfiguration
Open

        $config = $this->processConfiguration($configuration, $configs);

Call to method __construct from undeclared class \Symfony\Component\Config\FileLocator
Open

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

Call to method __construct from undeclared class \Symfony\Component\DependencyInjection\Reference
Open

                        new Reference('open_orchestra_pagination.filter_type.manager')

Class extends undeclared class \Symfony\Component\HttpKernel\DependencyInjection\Extension
Open

class OpenOrchestraModelLogExtension extends Extension

Call to method setFactory from undeclared class \Symfony\Component\DependencyInjection\Definition
Open

                $definition->setFactory(array(new Reference('object_manager'), 'getRepository'));

Call to method __construct from undeclared class \Symfony\Component\DependencyInjection\Loader\YamlFileLoader
Open

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

No space found after comma in function call
Open

                if (method_exists($content['repository'],'setFilterTypeManager')) {

There are no issues that match your filters.

Category
Status