Showing 318 of 14,363 total issues
Function postSubmit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function postSubmit(FormEvent $event)
{
if (($group = $event->getData()) instanceof GroupInterface) {
$isSiteAdmin = $group->hasRole(ContributionRoleInterface::SITE_ADMIN);
$siteId = $group->getSite()->getSiteId();
- 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 transform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function transform($keywords)
{
if (null === $keywords) {
return '';
}
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$facadeClass,
MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
TranslatorInterface $translator,
AuthorizationCheckerInterface $authorizationChecker,
StatusUsageFinder $usageFinder,
- Create a ticketCreate a ticket
Method updateBlockPositionAction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function updateBlockPositionAction(Request $request, $nodeId, $language, $version, $siteId)
- Create a ticketCreate a ticket
Method testcreateOrUpdateForRedirectionToNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function testcreateOrUpdateForRedirectionToNode($locale, $id, $aliasIds, $permanent, $pattern)
- Create a ticketCreate a ticket
Method copyTranslatedBlocksInAreaAction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function copyTranslatedBlocksInAreaAction(Request $request, $nodeId, $language, $version, $areaId)
- Create a ticketCreate a ticket
Method formAction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function formAction(Request $request, $siteId, $nodeId, $language, $version)
- Create a ticketCreate a ticket
Method testInitializeNewContent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function testInitializeNewContent($contentType, $language, $linkedToSite, $siteId, $isStatusable)
- Create a ticketCreate a ticket
Method testCreateForSiteWithRedirection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function testCreateForSiteWithRedirection($locale, $id, $aliasIds, $permanent, $pattern)
- Create a ticketCreate a ticket
Method newAction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function newAction(Request $request, $siteId, $language, $parentId, $order)
- Create a ticketCreate a ticket
Method createForm
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function createForm($type, $data = null, array $options = array(), $editionRole = null, StatusInterface $status = null)
- Create a ticketCreate a ticket
Method testVote
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function testVote($object, $attribute, array $roles, $inPerimeter, $expectedVote)
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
StatusRepositoryInterface $statusRepository,
ContextBackOfficeInterface $contextManager,
$contentClass,
UniqueIdGenerator $uniqueIdGenerator,
TokenStorage $tokenStorage
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ContextBackOfficeInterface $contextManager,
EventSubscriberInterface $fieldTypeTypeSubscriber,
array $backOfficeLanguages,
array $fieldTypeParameters,
$fieldTypeClass
- Create a ticketCreate a ticket
Method createRootNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function createRootNode($siteId, $language, $name, $routePattern, $template)
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$facadeClass,
AuthorizationCheckerInterface $authorizationChecker,
EventDispatcherInterface $eventDispatcher,
MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
UserRepositoryInterface $userRepository
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$routeDocumentClass,
SiteRepositoryInterface $siteRepository,
NodeRepositoryInterface $nodeRepository,
RedirectionRepositoryInterface $redirectionRepository,
RouteDocumentRepositoryInterface $routeDocumentRepository
- Create a ticketCreate a ticket
Method checkRemoveReferencesToEntity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function checkRemoveReferencesToEntity($entity, $entityId, array $usedItems, $entityType, $itemRepository)
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Session $session,
TokenStorageInterface $tokenStorage,
$defaultLocale,
SiteRepositoryInterface $siteRepository,
AuthorizationCheckerInterface $authorizationChecker
- Create a ticketCreate a ticket
Method createErrorNodeWithStatus
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function createErrorNodeWithStatus(StatusInterface $status, $nodeId, $name, $language, SiteInterface $site)
- Create a ticketCreate a ticket