open-orchestra/open-orchestra-cms-bundle

View on GitHub

Showing 354 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

The class ContentController has 12 public methods. Consider refactoring ContentController to keep number of public methods under 10.
Open

class ContentController extends BaseController
{
    use ListStatus;

    /**

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class ContentController has an overall complexity of 50 which is very high. The configured complexity threshold is 50.
Open

class ContentController extends BaseController
{
    use ListStatus;

    /**

The class NodeController has an overall complexity of 53 which is very high. The configured complexity threshold is 50.
Open

class NodeController extends BaseController
{
    use ListStatus;

    /**

The class NodeController has 17 public methods. Consider refactoring NodeController to keep number of public methods under 10.
Open

class NodeController extends BaseController
{
    use ListStatus;

    /**

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class UpdateHistoryListSubscriber has 16 public methods. Consider refactoring UpdateHistoryListSubscriber to keep number of public methods under 10.
Open

class UpdateHistoryListSubscriber implements EventSubscriberInterface
{
    protected $tokenManager;
    protected $objectManager;
    protected $historyClass;

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class NodeStrategyTest has 11 public methods. Consider refactoring NodeStrategyTest to keep number of public methods under 10.
Open

class NodeStrategyTest extends AbstractBaseTestCase
{
    protected $nodeRepository;
    protected $strategy;
    protected $mainUrlArguments = array(

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class ContextManagerTest has 18 public methods. Consider refactoring ContextManagerTest to keep number of public methods under 10.
Open

class ContextManagerTest extends AbstractBaseTestCase
{
    /**
     * @var ContextManager
     */

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class ContextBackOfficeManagerTest has 17 public methods. Consider refactoring ContextBackOfficeManagerTest to keep number of public methods under 10.
Open

class ContextBackOfficeManagerTest extends AbstractBaseTestCase
{
    /**
     * @var ContextBackOfficeManager
     */

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class RouteDocumentManagerTest has 12 public methods. Consider refactoring RouteDocumentManagerTest to keep number of public methods under 10.
Open

class RouteDocumentManagerTest extends AbstractBaseTestCase
{
    /**
     * @var RouteDocumentManager
     */

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

Severity
Category
Status
Source
Language