Showing 58 of 72 total issues
File NodeRepository.php
has 757 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace OpenOrchestra\ModelBundle\Repository;
use Doctrine\Common\Collections\Collection;
- Create a ticketCreate a ticket
NodeRepository
has 66 functions (exceeds 20 allowed). Consider refactoring. Open
class NodeRepository extends AbstractAggregateRepository implements FieldAutoGenerableRepositoryInterface, NodeRepositoryInterface
{
use AutoPublishableTrait;
use UseTrackableTrait;
use StatusableTrait;
- Create a ticketCreate a ticket
Method getConfigTreeBuilder
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('open_orchestra_model');
- Create a ticketCreate a ticket
RouteDocument
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class RouteDocument implements RouteDocumentInterface
{
/**
* @var string $id
*
- Create a ticketCreate a ticket
Node
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class Node implements NodeInterface
{
use TimestampableDocument;
use BlameableDocument;
use Versionable;
- Create a ticketCreate a ticket
File ContentRepository.php
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace OpenOrchestra\ModelBundle\Repository;
use Doctrine\Common\Collections\Collection;
- Create a ticketCreate a ticket
ContentRepository
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class ContentRepository extends AbstractAggregateRepository implements FieldAutoGenerableRepositoryInterface, ContentRepositoryInterface, KeywordableTraitInterface
{
use KeywordableTrait;
use UseTrackableTrait;
use FilterTrait;
- Create a ticketCreate a ticket
FieldType
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class FieldType implements FieldTypeInterface
{
/**
* @var string $fieldId
*
- Create a ticketCreate a ticket
Site
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Site implements SiteInterface
{
use Sitemapable;
use SoftDeleteable;
- Create a ticketCreate a ticket
ContentType
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class ContentType implements ContentTypeInterface
{
use BlameableDocument;
use TimestampableDocument;
use Versionable;
- Create a ticketCreate a ticket
AbstractStatus
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractStatus implements StatusInterface
{
/**
* @var string $id
*
- Create a ticketCreate a ticket
Method generateGlobalBlock
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateGlobalBlock(ObjectManager $manager, $language)
{
$siteBlockLogo = new Block();
$siteBlockLogo->setLabel('Wysiwyg logo');
$siteBlockLogo->setStyle('default');
- Create a ticketCreate a ticket
Block
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Block implements BlockInterface
{
use Cacheable;
use TimestampableDocument;
- Create a ticketCreate a ticket
Function transformSubConditionToMongoCondition
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function transformSubConditionToMongoCondition($condition, array &$aliases)
{
$elements = array();
$subElements = array();
$operator = '$and';
- 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 preUpdate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function preUpdate(LifecycleEventArgs $event)
{
if (!($object = $event->getDocument()) instanceof ContentInterface || in_array($object->getContentId(), $this->contentManaged)) {
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 generateContentTypeCustomer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateContentTypeCustomer()
{
$maxLengthOption = $this->generateOption('max_length', 25);
$required = $this->generateOption('required', true);
- Create a ticketCreate a ticket
Method generateContentTypeNews
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateContentTypeNews()
{
$maxLengthOption = $this->generateOption('max_length', 25);
$required = $this->generateOption('required', true);
$dateWidgetOption = $this->generateOption('widget', 'single_text');
- Create a ticketCreate a ticket
Function process
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function process(ContainerBuilder $container)
{
$resourcePath = '.';
foreach ($container->getResources() as $resource) {
- 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 execute
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
if (!is_null($input->getOption('type'))) {
$type = $input->getOption('type');
- Create a ticketCreate a ticket
Method provideDocumentClass
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideDocumentClass()
{
return array(
'1' => array("empty", "OpenOrchestra\\ModelBundle\\Document\\Content" , "content" , "OpenOrchestra\\ModelBundle\\Repository\\ContentRepository" , true),
'2' => array("empty", "OpenOrchestra\\ModelBundle\\Document\\ContentAttribute" , "content_attribute" ),
- Create a ticketCreate a ticket