open-orchestra/open-orchestra-cms-bundle

View on GitHub

Showing 318 of 14,363 total issues

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

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name', 'text', array(
                'label' => 'open_orchestra_backoffice.form.website.name',
Severity: Major
Found in Backoffice/Form/Type/SiteType.php - About 2 hrs to fix

Method getBadRoles has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function getBadRoles()
    {
        $keyword = $this->createPhakeKeyword();

        return array(

ContextManagerTest has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

class ContextManagerTest extends AbstractBaseTestCase
{
    /**
     * @var ContextManager
     */
Severity: Minor
Found in Backoffice/Tests/Context/ContextManagerTest.php - About 2 hrs to fix

Method getConfigTreeBuilder has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('open_orchestra_backoffice');

Severity: Major
Found in BackofficeBundle/DependencyInjection/Configuration.php - About 2 hrs to fix

Method updateBlockConfiguration has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function updateBlockConfiguration(ContainerBuilder $container, array $config)
    {
        $backOfficeBlockConfiguration = array(
            FooterStrategy::NAME => array(
                'category' => 'open_orchestra_backoffice.block_configuration.category.navigation',

ContextBackOfficeManagerTest has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class ContextBackOfficeManagerTest extends AbstractBaseTestCase
{
    /**
     * @var ContextBackOfficeManager
     */
Severity: Minor
Found in Backoffice/Tests/Context/ContextBackOfficeManagerTest.php - About 2 hrs to fix

AbstractVoterTest has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class AbstractVoterTest extends AbstractBaseTestCase
{
    protected $voter;

    protected $perimeterManager;
Severity: Minor
Found in Backoffice/Tests/Security/Authorization/Voter/AbstractVoterTest.php - About 2 hrs to fix

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

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

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

File symlink.js has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module.exports = {
    //--[ FONT MONTSERRAT ]--//
    font_montserrat_700_eot: {
        src: 'web/bundles/openorchestrabackoffice/font/Montserrat/fonts/Montserrat-700/Montserrat-700.eot',
        dest: 'web/fonts/Montserrat-700/Montserrat-700.eot'
Severity: Minor
Found in GruntTasks/Targets/symlink.js - About 2 hrs to fix

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

    public function configureOptions(OptionsResolver $resolver)
    {
        $subGroupRender = array(
            'properties' => array(
                'rank' => 0,
Severity: Major
Found in Backoffice/Form/Type/NodeType.php - About 2 hrs to fix

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 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

Severity
Category
Status
Source
Language