Showing 354 of 14,363 total issues
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
*/
- 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
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;
- Create a ticketCreate a ticket
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;
- 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 addTemplateSetConfiguration
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addTemplateSetConfiguration()
{
$builder = new TreeBuilder();
$templateSet = $builder->root('template_set');
- Create a ticketCreate a ticket
File Configuration.php
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace OpenOrchestra\BackofficeBundle\DependencyInjection;
use OpenOrchestra\ModelInterface\Model\ContentInterface;
- Create a ticketCreate a ticket
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',
- Create a ticketCreate a ticket
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,
- Create a ticketCreate a ticket
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) {
- Create a ticketCreate a ticket
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 */
- 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
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) {
- 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 buildForm
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', 'text', array(
'label' => 'open_orchestra_backoffice.form.website.name',
- Create a ticketCreate a ticket
Method getBadRoles
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getBadRoles()
{
$keyword = $this->createPhakeKeyword();
return array(
- Create a ticketCreate a ticket
ContextManagerTest
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class ContextManagerTest extends AbstractBaseTestCase
{
/**
* @var ContextManager
*/
- Create a ticketCreate a ticket
Method getConfigTreeBuilder
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('open_orchestra_backoffice');
- Create a ticketCreate a ticket
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',
- Create a ticketCreate a ticket
ContextBackOfficeManagerTest
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class ContextBackOfficeManagerTest extends AbstractBaseTestCase
{
/**
* @var ContextBackOfficeManager
*/
- Create a ticketCreate a ticket
AbstractVoterTest
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractVoterTest extends AbstractBaseTestCase
{
protected $voter;
protected $perimeterManager;
- Create a ticketCreate a ticket
File symlink.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = {
//--[ FONT MONTSERRAT ]--//
font_montserrat_700_eot: {
src: 'web/bundles/openorchestrabackoffice/font/Montserrat/fonts/Montserrat-700/Montserrat-700.eot',
dest: 'web/fonts/Montserrat-700/Montserrat-700.eot'
- Create a ticketCreate a ticket
Method testConfigureOptions
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testConfigureOptions()
{
$resolver = Phake::mock('Symfony\Component\OptionsResolver\OptionsResolver');
$this->form->configureOptions($resolver);
- Create a ticketCreate a ticket
Method configureOptions
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function configureOptions(OptionsResolver $resolver)
{
$subGroupRender = array(
'properties' => array(
'rank' => 0,
- Create a ticketCreate a ticket