WorkflowAdminBundle/EventSubscriber/AddGroupWorkflowProfileSubscriber.php
Method addWorkflowProfile
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function addWorkflowProfile(GroupFormEvent $event)
{
$builder = $event->getBuilder();
$group = $builder->getData();
$configuration = array();
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
WorkflowProfileRepositoryInterface $workflowProfileRepository,
ContentTypeRepositoryInterface $contentTypeRepository,
DataTransformerInterface $workflowProfileCollectionTransformer,
ContextBackOfficeInterface $contextManager,
TranslatorInterface $translator
- Create a ticketCreate a ticket
Function addWorkflowProfile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function addWorkflowProfile(GroupFormEvent $event)
{
$builder = $event->getBuilder();
$group = $builder->getData();
$configuration = array();
- 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
Call to method getData
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$group = $builder->getData();
- Create a ticketCreate a ticket
- Exclude checks
Call to method get
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$builder->get('workflow_profile_collections')->addModelTransformer($this->workflowProfileCollectionTransformer);
- Create a ticketCreate a ticket
- Exclude checks
Call to method findAllNotDeletedInLastVersion
from undeclared class \OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface
Open
Open
$contentTypes = $this->contentTypeRepository->findAllNotDeletedInLastVersion($site->getContentTypes());
- Create a ticketCreate a ticket
- Exclude checks
Call to method add
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$builder->add('workflow_profile_collections', 'oo_check_list_collection', array(
- Create a ticketCreate a ticket
- Exclude checks
Call to method getContentTypes
from undeclared class \OpenOrchestra\ModelInterface\Model\ReadSiteInterface
Open
Open
$contentTypes = $this->contentTypeRepository->findAllNotDeletedInLastVersion($site->getContentTypes());
- Create a ticketCreate a ticket
- Exclude checks
Call to method setAttribute
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$builder->setAttribute('sub_group_render', array_merge($builder->getAttribute('sub_group_render'), array(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $workflowProfileCollectionTransformer
has undeclared type \Symfony\Component\Form\DataTransformerInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Call to method getAttribute
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$builder->setAttribute('sub_group_render', array_merge($builder->getAttribute('sub_group_render'), array(
- Create a ticketCreate a ticket
- Exclude checks
Class implements undeclared interface \Symfony\Component\EventDispatcher\EventSubscriberInterface
Open
Open
class AddGroupWorkflowProfileSubscriber implements EventSubscriberInterface
- Create a ticketCreate a ticket
- Exclude checks
Parameter $workflowProfileRepository
has undeclared type \OpenOrchestra\ModelInterface\Repository\WorkflowProfileRepositoryInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open
Open
$configuration['default']['column'][NodeInterface::ENTITY_TYPE] = $this->translator->trans('open_orchestra_workflow_admin.profile.page');
- Create a ticketCreate a ticket
- Exclude checks
Call to method getContentTypes
from undeclared class \OpenOrchestra\ModelInterface\Model\ReadSiteInterface
Open
Open
if (!empty($site->getContentTypes())) {
- Create a ticketCreate a ticket
- Exclude checks
Call to method getAttribute
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$builder->setAttribute('group_render', array_merge($builder->getAttribute('group_render'), array(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $translator
has undeclared type \Symfony\Component\Translation\TranslatorInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Call to method findAll
from undeclared class \OpenOrchestra\ModelInterface\Repository\WorkflowProfileRepositoryInterface
Open
Open
$workflowProfiles = $this->workflowProfileRepository->findAll();
- Create a ticketCreate a ticket
- Exclude checks
Call to method trans
from undeclared class \Symfony\Component\Translation\TranslatorInterface
Open
Open
$configuration['default']['column'][NodeInterface::ENTITY_TYPE] = $this->translator->trans('open_orchestra_workflow_admin.profile.page');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setAttribute
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$builder->setAttribute('group_render', array_merge($builder->getAttribute('group_render'), array(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $contentTypeRepository
has undeclared type \OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $contentTypeRepository. Keep variable name length under 20. Open
Open
protected $contentTypeRepository;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 $workflowProfileCollectionTransformer. Keep variable name length under 20. Open
Open
protected $workflowProfileCollectionTransformer;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 $workflowProfileCollectionTransformer. Keep variable name length under 20. Open
Open
DataTransformerInterface $workflowProfileCollectionTransformer,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 $workflowProfileRepository. Keep variable name length under 20. Open
Open
WorkflowProfileRepositoryInterface $workflowProfileRepository,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 $workflowProfileRepository. Keep variable name length under 20. Open
Open
protected $workflowProfileRepository;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 $contentTypeRepository. Keep variable name length under 20. Open
Open
ContentTypeRepositoryInterface $contentTypeRepository,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 145 characters Open
Open
$configuration['default']['column'][NodeInterface::ENTITY_TYPE] = $this->translator->trans('open_orchestra_workflow_admin.profile.page');
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 162 characters Open
Open
$configuration['default']['column'][$contentType->getContentTypeId()] = $contentType->getName($this->contextManager->getBackOfficeLanguage());
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
Open
$configuration['default']['row'][] = $workflowProfile->getLabel($this->contextManager->getBackOfficeLanguage());
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 3 Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Closing brace indented incorrectly; expected 4 spaces, found 3 Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks