open-orchestra/open-orchestra-cms-bundle

View on GitHub
BackofficeBundle/DependencyInjection/OpenOrchestraBackofficeExtension.php

Summary

Maintainability
C
7 hrs
Test Coverage

Method load has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Method updateBlockConfiguration has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function updateBlockConfiguration(ContainerBuilder $container, array $config)
    {
        $backOfficeBlockConfiguration = array(
            FooterStrategy::NAME => array(
                'category' => 'open_orchestra_backoffice.block_configuration.category.navigation',

The method load() has 136 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

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

The class OpenOrchestraBackofficeExtension has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
Open

class OpenOrchestraBackofficeExtension extends Extension
{
    /**
     * {@inheritDoc}
     */

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

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

        $container->setParameter('open_orchestra_backoffice.block.fixed_attributes', $config['fixed_attributes']);

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

        $container->setParameter('open_orchestra_backoffice.configuration.roles', $configurationRoles);

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

        if ($container->hasParameter('disallowed_field_names')) {

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

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

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

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

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

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

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

        if ('test' == $container->getParameter('kernel.environment')) {

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\ConfigurableContentStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\ConfigurableContentStrategy)
Open

            ConfigurableContentStrategy::NAME,

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

            $container->getParameter('open_orchestra_backoffice.options'),

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\SubMenuStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\SubMenuStrategy)
Open

            SubMenuStrategy::NAME => array(

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\LanguageListStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\LanguageListStrategy)
Open

            LanguageListStrategy::NAME => array(

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

            $blockConfiguration = $container->getParameter('open_orchestra_backoffice.block_configuration');

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

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

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

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

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

        if ($container->hasParameter('open_orchestra_backoffice.block_configuration')) {

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

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

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

        $container->setParameter('open_orchestra.blocks', $blocks);

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

        $container->setParameter('open_orchestra_backoffice.block_configuration', $blockConfiguration);

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

        $container->setParameter('open_orchestra_user.form_template', 'OpenOrchestraBackofficeBundle::form.html.twig');

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

        $container->setParameter('open_orchestra_backoffice.trash_item_type', $config['trash_item_type']);

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

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

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

class OpenOrchestraBackofficeExtension extends Extension

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

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

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

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

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

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

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

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

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

            $blocksAlreadySet = $container->getParameter('open_orchestra.blocks');

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

            $container->getParameter('open_orchestra_backoffice.field_types'),

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\ConfigurableContentStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\ConfigurableContentStrategy)
Open

            ConfigurableContentStrategy::NAME => array(

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

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

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

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

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

    protected function addApplicationOptions($appOptions, ContainerBuilder $container)

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

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

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

    protected function updateBlockParameter(ContainerBuilder $container, $config)

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\TinyMCEWysiwygStrategy (Did you mean class \OpenOrchestra\Backoffice\DisplayBlock\Strategies\TinyMCEWysiwygStrategy or class \OpenOrchestra\Backoffice\GenerateForm\Strategies\TinyMCEWysiwygStrategy)
Open

            TinyMCEWysiwygStrategy::NAME,

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\VideoStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\VideoStrategy)
Open

            VideoStrategy::NAME,

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\ContentListStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\ContentListStrategy)
Open

            ContentListStrategy::NAME,

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

        $container->setParameter('open_orchestra_backoffice.block_default_configuration', $config['block_default_configuration']);

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

        $container->setParameter('open_orchestra_backoffice.template_set', $config['template_set']);

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

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

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\AudienceAnalysisStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\AudienceAnalysisStrategy)
Open

            AudienceAnalysisStrategy::NAME => array(

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\ContentListStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\ContentListStrategy)
Open

            ContentListStrategy::NAME => array(

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

        $container->setParameter('open_orchestra_backoffice.configuration.front_roles', $configurationFrontRoles);

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

    protected function addApplicationFieldTypes($appFieldTypes, ContainerBuilder $container)

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\Loader\YamlFileLoader
Open

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

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

        $container->setParameter('open_orchestra_backoffice.orchestra_choice.front_language', $config['front_languages']);

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

        $container->setParameter('open_orchestra_backoffice.special_page_name', $config['special_page_name']);

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

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

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

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

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

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

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\ContactStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\ContactStrategy)
Open

            ContactStrategy::NAME,

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

        $container->setParameter('open_orchestra_backoffice.field_types', $fieldTypes);

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

    protected function updateBlockConfiguration(ContainerBuilder $container, array $config)

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\ContentStrategy (Did you mean class \OpenOrchestra\Backoffice\BusinessRules\Strategies\ContentStrategy or class \OpenOrchestra\Backoffice\GenerateForm\Strategies\ContentStrategy)
Open

            ContentStrategy::NAME => array(

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\ContactStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\ContactStrategy)
Open

            ContactStrategy::NAME => array(

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

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

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\FooterStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\FooterStrategy)
Open

            FooterStrategy::NAME => array(

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\VideoStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\VideoStrategy)
Open

            VideoStrategy::NAME => array(

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

        $container->setParameter('open_orchestra_backoffice.disallowed_field_names', $disallowedFieldNames);

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

        if ($container->hasParameter('open_orchestra.blocks')) {

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\MenuStrategy (Did you mean class \OpenOrchestra\Backoffice\GenerateForm\Strategies\MenuStrategy)
Open

            MenuStrategy::NAME => array(

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\TinyMCEWysiwygStrategy (Did you mean class \OpenOrchestra\Backoffice\DisplayBlock\Strategies\TinyMCEWysiwygStrategy or class \OpenOrchestra\Backoffice\GenerateForm\Strategies\TinyMCEWysiwygStrategy)
Open

            TinyMCEWysiwygStrategy::NAME => array(

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

                $container->getParameter('disallowed_field_names')

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

        $container->setParameter('open_orchestra_backoffice.options', $options);

Call to undeclared method \OpenOrchestra\BackofficeBundle\DependencyInjection\OpenOrchestraBackofficeExtension::processConfiguration
Open

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

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

        $container->setParameter('open_orchestra_user.base_layout', 'OpenOrchestraBackofficeBundle::layout.html.twig');

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

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

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

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

Reference to constant NAME from undeclared class \OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\ContentStrategy (Did you mean class \OpenOrchestra\Backoffice\BusinessRules\Strategies\ContentStrategy or class \OpenOrchestra\Backoffice\GenerateForm\Strategies\ContentStrategy)
Open

            ContentStrategy::NAME,

Avoid excessively long variable names like $configurationFrontRoles. Keep variable name length under 20.
Open

        $configurationFrontRoles = $config['front_roles'];

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $backOfficeBlockConfiguration. Keep variable name length under 20.
Open

        $backOfficeBlockConfiguration = array(

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Line exceeds 120 characters; contains 122 characters
Open

        $container->setParameter('open_orchestra_backoffice.orchestra_choice.front_language', $config['front_languages']);

Line exceeds 120 characters; contains 130 characters
Open

        $container->setParameter('open_orchestra_backoffice.block_default_configuration', $config['block_default_configuration']);

Line exceeds 120 characters; contains 126 characters
Open

        $blockConfiguration = array_merge($config['block_configuration'], $blockConfiguration, $backOfficeBlockConfiguration);

Line exceeds 120 characters; contains 164 characters
Open

        $configurationRoles = array_merge_recursive($configurationRoles, array('open_orchestra_backoffice.role.front_access' => array('fourthpackage' => $result)));

There are no issues that match your filters.

Category
Status