open-orchestra/open-orchestra-cms-bundle

View on GitHub

Showing 318 of 14,363 total issues

Method testCreateNewErrorNode has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testCreateNewErrorNode($nodeId, $name, $parentId, $siteId, $language, $template)
Severity: Minor
Found in Backoffice/Tests/Manager/NodeManagerTest.php - About 45 mins to fix

Method testBuildView has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testBuildView($isInitial, $isTranslation, $isPublished, $isautoPublish, $isAutounpublish, array $expectedProperties)
Severity: Minor
Found in Workflow/Tests/Form/Type/StatusTypeTest.php - About 45 mins to fix

Function deserializeFieldType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function deserializeFieldType(GenericDeserializationVisitor $visitor, $contentAttributeValue, array $type, Context $context)
    {
        $facade = $visitor->getCurrentObject();
        if ($facade instanceof ContentAttributeFacade && null !== $facade->type) {
            if (isset($this->fieldTypes[$facade->type]) &&
Severity: Minor
Found in ApiBundle/Handler/ContentAttributeValueHandler.php - About 45 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

Method testVote has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testVote($object, $attribute, array $roles, $inPerimeter, $expectedVote, $inProfile = true)
Severity: Minor
Found in Workflow/Tests/Security/Authorization/Voter/ContentWorkflowVoterTest.php - About 45 mins to fix

Method addBlockInAreaAction has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function addBlockInAreaAction($nodeId, $language, $version, $blockId, $areaId, $position)
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 45 mins to fix

Method deleteBlockInAreaAction has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function deleteBlockInAreaAction($nodeId, $siteId, $language, $version, $blockId, $areaName)
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 45 mins to fix

Method testCreateForNode has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testCreateForNode($language, $id, array $aliasIds, $pattern, $exceptedPattern, $parentId = null)
Severity: Minor
Found in Backoffice/Tests/Manager/RouteDocumentManagerTest.php - About 45 mins to fix

Method testCreateForSite has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testCreateForSite($language, $id, array $aliasIds, $pattern, $exceptedPattern, $parentId = null)
Severity: Minor
Found in Backoffice/Tests/Manager/RouteDocumentManagerTest.php - About 45 mins to fix

Method testVote has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testVote($object, $attribute, array $roles, $inPerimeter, $expectedVote, $inProfile = true)
Severity: Minor
Found in Workflow/Tests/Security/Authorization/Voter/NodeWorkflowVoterTest.php - About 45 mins to fix

Function _highlight has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    _highlight(name) {
        let breadcrumb = this.getBreadcrumbHighlight();
        let menu = this.getMenuHighlight();

        if (breadcrumb !== null) {

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 testBuildView has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testBuildView($groupEnabled, array $groupIds, array $subGroupIds, array $groupRender, array $subGroupRender, array $expectedResult)
Severity: Minor
Found in Backoffice/Tests/Form/Type/Extension/FormTypeGroupExtensionTest.php - About 45 mins to fix

Method verifyRedirectionRoutes has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function verifyRedirectionRoutes(array $routeDocuments, $locale, $id, array $aliasIds, $mongoNodeId, $permanent)
Severity: Minor
Found in Backoffice/Tests/Manager/RouteDocumentManagerTest.php - About 45 mins to fix

Method createNewErrorNode has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function createNewErrorNode($nodeId, $name, $parentId, $siteId, $language, $template)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php - About 45 mins to fix

Function postSubmit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function postSubmit(FormEvent $event)
    {
        if (($group = $event->getData()) instanceof GroupInterface) {
            $isSiteAdmin = $group->hasRole(ContributionRoleInterface::SITE_ADMIN);
            $siteId = $group->getSite()->getSiteId();
Severity: Minor
Found in GroupBundle/EventSubscriber/GroupPerimeterSubscriber.php - About 45 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

Method verifyNodeRoutes has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function verifyNodeRoutes($language, $id, array $aliasIds, $exceptedPattern, $routeDocuments, $nodeId)
Severity: Minor
Found in Backoffice/Tests/Manager/RouteDocumentManagerTest.php - About 45 mins to fix

Function transform has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function transform($keywords)
    {
        if (null === $keywords) {
            return '';
        }
Severity: Minor
Found in Backoffice/Form/DataTransformer/AbstractReferenceKeywordTransformer.php - About 45 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 getStyleChoices has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getStyleChoices(array $options)
    {
        $choices = array();
        if (
            isset($options['data']) &&
Severity: Minor
Found in Backoffice/Form/Type/BlockType.php - About 45 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

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

        $class,
        array $availableLanguages,
        EventSubscriberInterface $userProfilSubscriber,
        EventSubscriberInterface $userGroupSubscriber,
        TranslatorInterface $translator,
Severity: Minor
Found in UserAdminBundle/Form/Type/UserType.php - About 45 mins to fix

Function validate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, Constraint $constraint)
    {
        if ($constraint instanceof UnremovableLanguageConditionInterface) {
            $languages = array();
            foreach ($value as $alias) {

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

        TemplateManager $templateManager,
        ContextBackOfficeInterface $contextManager,
        SiteRepositoryInterface $siteRepository,
        GenerateFormManager $generateFormManager,
        BlockToArrayTransformer $blockToArrayTransformer,
Severity: Minor
Found in Backoffice/Form/Type/BlockType.php - About 45 mins to fix
Severity
Category
Status
Source
Language