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;
- Create a ticketCreate a ticket
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,
- Create a ticketCreate a ticket
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);
- Create a ticketCreate a ticket
File NodeController.php
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace OpenOrchestra\ApiBundle\Controller;
use Doctrine\Common\Collections\ArrayCollection;
- Create a ticketCreate a ticket
Method addYoutubeForm
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addYoutubeForm(FormBuilderInterface $builder)
{
$builder
->add('youtubeVideoId', 'oo_video', array(
- Create a ticketCreate a ticket
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',
- Create a ticketCreate a ticket
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) {
- Read upRead up
- Create a ticketCreate a ticket
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()),
- Create a ticketCreate a ticket
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',
- Create a ticketCreate a ticket
Method testDefaultConfig
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testDefaultConfig()
{
$container = $this->loadContainerFromFile('empty');
$defaultLanguage = array(
- Create a ticketCreate a ticket
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;
- Read upRead up
- Create a ticketCreate a ticket
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;
/**
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 NodeController has 17 public methods. Consider refactoring NodeController to keep number of public methods under 10. Open
class NodeController extends BaseController
{
use ListStatus;
/**
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 NodeController has an overall complexity of 53 which is very high. The configured complexity threshold is 50. Open
class NodeController extends BaseController
{
use ListStatus;
/**
- Create a ticketCreate a ticket
- Exclude checks
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;
/**
- Create a ticketCreate a ticket
- Exclude checks
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(
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
*/
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
*/
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 NodeManagerTest has 13 public methods. Consider refactoring NodeManagerTest to keep number of public methods under 10. Open
class NodeManagerTest extends AbstractBaseTestCase
{
/**
* @var NodeManager
*/
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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