open-orchestra/open-orchestra-cms-bundle

View on GitHub

Showing 318 of 14,363 total issues

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $routeDocumentClass,
        SiteRepositoryInterface $siteRepository,
        NodeRepositoryInterface $nodeRepository,
        RedirectionRepositoryInterface $redirectionRepository,
        RouteDocumentRepositoryInterface $routeDocumentRepository
Severity: Minor
Found in Backoffice/Manager/RouteDocumentManager.php - About 35 mins to fix

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $facadeClass,
        AuthorizationCheckerInterface $authorizationChecker,
        MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
        GroupRepositoryInterface $groupRepository,
        BusinessRulesManager $businessRulesManager
Severity: Minor
Found in GroupBundle/Transformer/GroupTransformer.php - About 35 mins to fix

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        CsvToReferenceKeywordTransformer $csvToReferenceKeywordTransformer,
        ConditionToReferenceKeywordTransformer $conditionToReferenceKeywordTransformer,
        KeywordRepositoryInterface $keywordRepository,
        RouterInterface $router,
        AuthorizationCheckerInterface $authorizationChecker
Severity: Minor
Found in Backoffice/Form/Type/Component/KeywordsChoiceType.php - About 35 mins to fix

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $facadeClass,
        AuthorizationCheckerInterface $authorizationChecker,
        EventDispatcherInterface $eventDispatcher,
        MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
        UserRepositoryInterface $userRepository
Severity: Minor
Found in UserAdminBundle/Transformer/UserTransformer.php - About 35 mins to fix

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        Session $session,
        TokenStorageInterface $tokenStorage,
        $defaultLocale,
        SiteRepositoryInterface $siteRepository,
        AuthorizationCheckerInterface $authorizationChecker
Severity: Minor
Found in Backoffice/Context/ContextBackOfficeManager.php - About 35 mins to fix

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $contentTypeClass,
        TranslatorInterface $translator,
        array $backOfficeLanguages,
        ContentTypeTypeSubscriber $contentTypeTypeSubscriber,
        ContentTypeStatusableSubscriber $contentTypeStatusableSubscriber
Severity: Minor
Found in Backoffice/Form/Type/ContentTypeType.php - About 35 mins to fix

Method testPreSubmit has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testPreSubmit($developer, $adminPlatform, $data, $nbrAdd, $nbrDelete)
Severity: Minor
Found in UserAdminBundle/Tests/EventSubscriber/UserProfilSubscriberTest.php - About 35 mins to fix

Method checkAddReferencesToEntity has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function checkAddReferencesToEntity($entity, $entityId, array $usedItems, $entityType, $itemRepository)
Severity: Minor
Found in Backoffice/Tests/Reference/Strategies/AbstractReferenceStrategyTest.php - About 35 mins to fix

Method createRootNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function createRootNode($siteId, $language, $name, $routePattern, $template)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php - About 35 mins to fix

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        WorkflowProfileRepositoryInterface $workflowProfileRepository,
        ContentTypeRepositoryInterface $contentTypeRepository,
        DataTransformerInterface $workflowProfileCollectionTransformer,
        ContextBackOfficeInterface $contextManager,
        TranslatorInterface $translator

Function UrlPaginateViewMixin has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

let UrlPaginateViewMixin = (superclass) => class extends superclass {

    /**
     * @inheritDoc
     */

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 addPreviewLinks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addPreviewLinks(FacadeInterface $facade, NodeInterface $node)
    {
        if ($this->hasGroup(CMSGroupContext::PREVIEW) && $site = $this->siteRepository->findOneBySiteId($node->getSiteId())) {
            /** @var SiteAliasInterface $alias */
            $encryptedId = $this->encrypter->encrypt($node->getId());
Severity: Minor
Found in ApiBundle/Transformer/NodeTransformer.php - About 35 mins to fix

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 _submit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    _submit(event) {
        event.preventDefault();
        if (this._validForm()) {
            let serializeFields = $('form', this.$el).serializeArray();
            let oo_internal_link = {};

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 testSqlExpression has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    testSqlExpression(testedString) {
        let isSqlExpression = true
        if(this.getBalancedBracketsRegExp().test(testedString)) {
            let subTestedString = this.getBalancedBracketsRegExp().exec(testedString);
            testedString = testedString.replace(subTestedString[0], '#');

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 getAgglomeratedPerimeter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getAgglomeratedPerimeter(UserInterface $user, $entityType)
    {
        if (false === $this->hasCachedPerimeters($user, $entityType)) {
            $cachedPerimeter = $this->perimeterManager->createPerimeter($entityType);
            foreach ($user->getGroups() as $group) {
Severity: Minor
Found in Backoffice/Security/Authorization/Voter/AbstractPerimeterVoter.php - About 35 mins to fix

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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $data = $view->vars['columns']['labels']['data'];

        $language = $this->contextManager->getBackOfficeLanguage();
Severity: Minor
Found in Backoffice/Form/Type/FieldTypeType.php - About 35 mins to fix

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 isInPerimeter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function isInPerimeter($item, PerimeterInterface $perimeter)
    {
        if ($perimeter->getType() == $this->getType() && is_string($item)) {
            foreach ($perimeter->getItems() as $path) {
                if (0 === strpos($item, $path)) {
Severity: Minor
Found in Backoffice/Perimeter/Strategy/NodePerimeterStrategy.php - About 35 mins to fix

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 updateNodeOnSiteAliasUpdate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateNodeOnSiteAliasUpdate(SiteEvent $event)
    {
        $languages = array();
        foreach ($event->getOldAliases() as $alias) {
            $languages[] = $alias->getLanguage();
Severity: Minor
Found in Backoffice/EventSubscriber/UpdateNodeSiteAliasSubscriber.php - About 35 mins to fix

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 addFormType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addFormType(FormEvent $event)
    {
        $form = $event->getForm();
        $data = $event->getData();
        $event->setData($data);
Severity: Minor
Found in Backoffice/EventSubscriber/ContentSearchSubscriber.php - About 35 mins to fix

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 reorderNodes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function reorderNodes(array $orderedNodes, NodeInterface $parentNode)
    {
        foreach ($orderedNodes as $position => $nodeId) {
            $nodeVersions = $this->nodeRepository->findByNodeAndSite($nodeId, $parentNode->getSiteId());

Severity: Minor
Found in Backoffice/Manager/NodeManager.php - About 35 mins to fix

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

Severity
Category
Status
Source
Language