Showing 318 of 14,363 total issues
Method newAction
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function newAction(Request $request)
{
$groupClass = $this->getParameter('open_orchestra_user.document.group.class');
/** @var GroupInterface $group */
$group = new $groupClass();
- Create a ticketCreate a ticket
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$facadeClass,
EncryptionManager $encrypter,
SiteRepositoryInterface $siteRepository,
StatusRepositoryInterface $statusRepository,
EventDispatcherInterface $eventDispatcher,
- Create a ticketCreate a ticket
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ContentTypeRepositoryInterface $contentTypeRepository,
StatusRepositoryInterface $statusRepository,
$contentAttributeClass,
MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
$fieldTypesConfiguration,
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ($this->hasGroup(CMSGroupContext::AUTHORIZATIONS)) {
$canDelete = $this->authorizationChecker->isGranted(ContributionActionInterface::DELETE, $status)
&& !$this->usageFinder->hasUsage($status)
&& !$status->isInitialState()
&& !$status->isPublishedState()
- Create a ticketCreate a ticket
Function deleteAction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function deleteAction($contentTypeId)
{
if (0 == $this->get('open_orchestra_model.repository.content')->countByContentType($contentTypeId)) {
$contentTypes = $this->get('open_orchestra_model.repository.content_type')->findBy(array('contentTypeId' => $contentTypeId));
if (count($contentTypes) > 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
Function assertSameTransitions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function assertSameTransitions(array $expectedTransitions, array $flattenedTransitions)
{
foreach ($expectedTransitions as $transition) {
$flattenedTransition = $transition->getStatusFrom()->getId() . '-' . $transition->getStatusTo()->getId();
$this->assertContains($flattenedTransition, $flattenedTransitions);
- 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 newAction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function newAction(Request $request, $siteId, $language, $parentId, $order)
{
$order = (int) $order;
$nodeManager = $this->get('open_orchestra_backoffice.manager.node');
$nodeRepository = $this->get('open_orchestra_model.repository.node');
- 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 buildView
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function buildView(FormView $view, FormInterface $form, array $options)
{
if ($form->getConfig()->getAttribute('group_enabled')) {
$view->vars['group'] = array();
$groupRender = $form->getConfig()->getAttribute('group_render');
- 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 voteOnAttribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
if ($this->isSuperAdmin($token)) {
return true;
}
- 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 extractContentsFromElement
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function extractContentsFromElement($element, array $references = array())
{
if ($this->isContentSearchAttribute($element)) {
$references[] = $element['contentId'];
- 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 extractKeywordsFromElement
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function extractKeywordsFromElement($element, array $references = array())
{
if ($this->isKeywordsConditionAttribute($element)) {
$keywordIds = $this->extractKeywordIdsFromConditionAttribute($element);
foreach ($keywordIds as $keywordId) {
- 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 buildForm
has a Cognitive Complexity of 9 (exceeds 5 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) {
- 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 newAction
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function newAction(Request $request, $nodeId, $language, $version, $areaId, $position, $component)
- Create a ticketCreate a ticket
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$facadeClass,
DisplayBlockManager $displayBlockManager,
BlockConfigurationManager $blockConfigurationManager,
TranslatorInterface $translator,
NodeRepositoryInterface $nodeRepository,
- Create a ticketCreate a ticket
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$facadeClass,
MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
ContentRepositoryInterface $contentRepository,
ContentTypeRepositoryInterface $contentTypeRepository,
AuthorizationCheckerInterface $authorizationChecker,
- Create a ticketCreate a ticket
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiClientRepositoryInterface $apiClientRepository,
UserRepositoryInterface $userRepository,
EncoderFactory $encoderFactory,
Serializer $serializer,
ValidatorInterface $validator,
- Create a ticketCreate a ticket
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
NodeManager $nodeManager,
ContextBackOfficeInterface $contextManager,
SiteRepositoryInterface $siteRepository,
TemplateManager $templateManager,
$nodeClass,
- Create a ticketCreate a ticket
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
EventSubscriberInterface $groupPerimeterSubscriber,
EventDispatcherInterface $eventDispatcher,
DataTransformerInterface $groupRoleTransformer,
DataTransformerInterface $groupPerimeterTransformer,
GeneratePerimeterManager $generatePerimeterManager,
- Create a ticketCreate a ticket
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$redirectionClass,
ContextBackOfficeInterface $contextManager,
DocumentManager $documentManager,
EventDispatcherInterface $eventDispatcher,
SiteRepositoryInterface $siteRepository,
- Create a ticketCreate a ticket
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$facadeClass,
StatusRepositoryInterface $statusRepository,
ContentRepositoryInterface $contentRepository,
AuthorizationCheckerInterface $authorizationChecker,
ContextBackOfficeInterface $contextManager,
- Create a ticketCreate a ticket