open-orchestra/open-orchestra-cms-bundle

View on GitHub

Showing 318 of 14,363 total issues

File VideoStrategy.php has 398 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace OpenOrchestra\Backoffice\GenerateForm\Strategies;

use OpenOrchestra\DisplayBundle\DisplayBlock\Strategies\VideoStrategy as BaseVideoStrategy;
Severity: Minor
Found in Backoffice/GenerateForm/Strategies/VideoStrategy.php - About 5 hrs to fix

Method buildForm has 138 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nodeId', 'hidden', array(
                'disabled' => true,
Severity: Major
Found in Backoffice/Form/Type/NodeType.php - About 5 hrs to fix

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);

File NodeController.php has 365 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace OpenOrchestra\ApiBundle\Controller;

use Doctrine\Common\Collections\ArrayCollection;
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 4 hrs to fix

Method addYoutubeForm has 115 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function addYoutubeForm(FormBuilderInterface $builder)
    {

        $builder
            ->add('youtubeVideoId', 'oo_video', array(
Severity: Major
Found in Backoffice/GenerateForm/Strategies/VideoStrategy.php - About 4 hrs to fix

Method addDailyMotionForm has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function addDailyMotionForm($builder)
    {
        $builder
            ->add('dailymotionVideoId', 'oo_video', array(
                'label' => 'open_orchestra_backoffice.block.video.dailymotion.video_id',
Severity: Major
Found in Backoffice/GenerateForm/Strategies/VideoStrategy.php - About 4 hrs to fix

Function reverseTransform has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function reverseTransform($value)
    {
        $result = new ArrayCollection();
        if (is_array($value)) {
            foreach ($value as $type => $perimeters) {
Severity: Minor
Found in GroupBundle/Form/DataTransformer/GroupPerimeterTransformer.php - About 4 hrs 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

Method provideOptions has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function provideOptions()
    {
        return array(
            array(false, array(), array(), array(), array(), array()),
            array(true, array(), array(), array(), array(), array()),
Severity: Major
Found in Backoffice/Tests/Form/Type/Extension/FormTypeGroupExtensionTest.php - About 4 hrs to fix

Method addVimeoForm has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function addVimeoForm($builder)
    {
        $builder
            ->add('vimeoVideoId', 'oo_video', array(
                'label' => 'open_orchestra_backoffice.block.video.vimeo.video_id',
Severity: Major
Found in Backoffice/GenerateForm/Strategies/VideoStrategy.php - About 4 hrs to fix

Method testDefaultConfig has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testDefaultConfig()
    {
        $container = $this->loadContainerFromFile('empty');

        $defaultLanguage = array(

Function buildForm has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $configuration = array();
        $maxColumns = 0;

Severity: Minor
Found in GroupBundle/Form/Type/GroupRoleType.php - About 3 hrs 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

File ContentController.php has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace OpenOrchestra\ApiBundle\Controller;

use OpenOrchestra\ApiBundle\Controller\ControllerTrait\ListStatus;
Severity: Minor
Found in ApiBundle/Controller/ContentController.php - About 3 hrs to fix

Function execute has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);
        $aliasId = $input->getArgument('aliasId');
        $limit = 20;
Severity: Minor
Found in BackofficeBundle/Command/OrchestraDeleteAliasCommand.php - About 3 hrs 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

Method addTemplateSetConfiguration has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function addTemplateSetConfiguration()
    {
        $builder = new TreeBuilder();
        $templateSet = $builder->root('template_set');

Severity: Major
Found in BackofficeBundle/DependencyInjection/Configuration.php - About 3 hrs to fix

File Configuration.php has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace OpenOrchestra\BackofficeBundle\DependencyInjection;

use OpenOrchestra\ModelInterface\Model\ContentInterface;
Severity: Minor
Found in BackofficeBundle/DependencyInjection/Configuration.php - About 3 hrs to fix

Method buildForm has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('names', 'oo_multi_languages', array(
                'label' => 'open_orchestra_backoffice.form.content_type.names',
Severity: Major
Found in Backoffice/Form/Type/ContentTypeType.php - About 3 hrs to fix

Method buildForm has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('scheme', 'choice', array(
                'choices' => $this->schemeChoices,
Severity: Major
Found in Backoffice/Form/Type/SiteAliasType.php - About 3 hrs to fix

Method buildForm has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $sitesId = array();
        $disabled = false;
        if (array_key_exists('data', $options) && ($user = $options['data']) instanceof UserInterface) {
Severity: Major
Found in UserAdminBundle/Form/Type/UserType.php - About 2 hrs to fix

Function findUsageReferenceInOtherSite has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function findUsageReferenceInOtherSite($siteId, $entities)
    {
        $usedOtherSite = array();
        $supportedEntities = array(BlockInterface::ENTITY_TYPE, ContentInterface::ENTITY_TYPE);
        /** @var UseTrackableInterface $entity */
Severity: Minor
Found in Backoffice/Command/OrchestraDeleteSiteTools.php - About 2 hrs 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

Function reverseTransform has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function reverseTransform($value)
    {
        $result = new ArrayCollection();
        if (is_array($value)) {
            foreach ($value as $key => $profiles) {

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

Severity
Category
Status
Source
Language