open-orchestra/open-orchestra-cms-bundle

View on GitHub

Showing 354 of 14,363 total issues

Method execute has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);
        $aliasId = $input->getArgument('aliasId');
        $limit = 20;
Severity: Major
Found in BackofficeBundle/Command/OrchestraDeleteAliasCommand.php - About 2 hrs to fix

Method configureOptions has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            array(
                'data_class' => $this->siteClass,
Severity: Major
Found in Backoffice/Form/Type/SiteType.php - About 2 hrs to fix

File RouteDocumentManagerTest.php has 266 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace OpenOrchestra\Backoffice\Tests\Manager;

use Doctrine\Common\Collections\ArrayCollection;
Severity: Minor
Found in Backoffice/Tests/Manager/RouteDocumentManagerTest.php - About 2 hrs to fix

File NodeType.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace OpenOrchestra\Backoffice\Form\Type;

use OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface;
Severity: Minor
Found in Backoffice/Form/Type/NodeType.php - About 2 hrs to fix

AbstractDataTableView has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class AbstractDataTableView extends OrchestraView
{
    /**
     * Constructor
     *

Method setUp has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUp()
    {
        $this->fieldTypesConfiguration = array(
            'text' =>
                array(
Severity: Major
Found in Backoffice/Tests/EventSubscriber/ContentTypeSubscriberTest.php - About 2 hrs to fix

Method testConfigureOptions has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testConfigureOptions()
    {
        $resolverMock = Phake::mock('Symfony\Component\OptionsResolver\OptionsResolver');

        $this->nodeType->configureOptions($resolverMock);
Severity: Major
Found in Backoffice/Tests/Form/Type/NodeTypeTest.php - About 2 hrs to fix

Method provideStatuses has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function provideStatuses()
    {
        $fullStatus = $this->generateStatus(array(
            'initialState'       => true,
            'translationState'   => true,

Method setUp has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUp()
    {
        $context = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');

        $repository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');

Function buildView has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildView(FormView $view, FormInterface $form, array $options)
    {
        if ($form->getParent() &&
            $form->getParent()->getConfig()->getType()->getName() == 'collection' &&
            $form->getConfig()->getOption('columns')
Severity: Minor
Found in Backoffice/Form/Type/Extension/AccordionExtension.php - About 2 hrs 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 validateCondition has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function validateCondition($condition)
    {
        $is_boolean = true;
        if (!empty($condition)) {
            $encapsuledElements = array();
Severity: Minor
Found in Backoffice/Validator/Constraints/BooleanConditionValidator.php - About 2 hrs 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 buildForm has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if (array_key_exists('property_path', $options) && is_null($options['property_path'])){
            $builder->setData($options['prototype_data']());
        }
Severity: Major
Found in Backoffice/Form/Type/FieldTypeType.php - About 2 hrs to fix

Method setUp has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUp()
    {
        $this->fieldOptionClass = 'OpenOrchestra\ModelBundle\Document\FieldOption';
        $this->fieldTypeClass = 'OpenOrchestra\ModelBundle\Document\FieldType';
        $this->form = Phake::mock('Symfony\Component\Form\Form');
Severity: Major
Found in Backoffice/Tests/EventSubscriber/FieldTypeTypeSubscriberTest.php - About 2 hrs to fix

Function activate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    activate($element) {
        let tags = $element.data('tags');
        let prepopulatedTags = $element.val().split(' ');
        let context = this;
        $element.tokenInput(tags, {

Function _drawGraphic has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _drawGraphic(transitions , selector) {
        var g = new dagreD3.graphlib.Graph().setGraph({});
        g.graph().rankdir = 'LR';

        for (let transition of transitions) {

Method setUp has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUp()
    {
        $this->node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');
        $this->area = Phake::mock('OpenOrchestra\ModelInterface\Model\AreaInterface');
        $this->block = Phake::mock('OpenOrchestra\ModelInterface\Model\BlockInterface');
Severity: Minor
Found in Backoffice/Tests/Manager/NodeManagerTest.php - About 2 hrs to fix

Method addFormElements has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function addFormElements(FormEvent $event)
    {
        $form = $event->getForm();
        $data = $event->getData();

Severity: Minor
Found in Backoffice/EventSubscriber/SiteSubscriber.php - About 2 hrs to fix

Method newAction has 49 lines of code (exceeds 25 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');
Severity: Minor
Found in BackofficeBundle/Controller/NodeController.php - About 1 hr to fix

Method testResolver has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testResolver()
    {
        $this->form->configureOptions($this->resolver);
        Phake::verify($this->resolver)->setDefaults(array(
            'data_class' => $this->class,
Severity: Minor
Found in UserAdminBundle/Tests/Form/Type/UserTypeTest.php - About 1 hr to fix

Method buildForm has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('siteId', 'oo_site_choice', array(
            'label'        => 'open_orchestra_backoffice.form.redirection.site_name',
            'group_id'     => 'redirection',
Severity: Minor
Found in Backoffice/Form/Type/RedirectionType.php - About 1 hr to fix
Severity
Category
Status
Source
Language