Showing 58 of 72 total issues
Method provideAnnotations
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideAnnotations()
{
$document0 = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');
Phake::when($document0)->getNodeId()->thenReturn(null);
- Create a ticketCreate a ticket
Function prePersist
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function prePersist(LifecycleEventArgs $event)
{
$document = $event->getDocument();
$className = get_class($document);
$generateAnnotations = $this->annotationReader->getClassAnnotation(new \ReflectionClass($className), 'OpenOrchestra\Mapping\Annotations\Document');
- 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 loadStatus
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
$enName,
$frName,
$name,
$color,
$publishedState = false,
- Create a ticketCreate a ticket
Method generateContentTypeCar
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateContentTypeCar()
{
$maxLengthOption = $this->generateOption('max_length', 25);
$required = $this->generateOption('required', true);
- Create a ticketCreate a ticket
Method load
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
- Create a ticketCreate a ticket
Method generateNodeGlobal
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateNodeGlobal($htmlContent, $language, $routePattern)
{
$nodeHomeBlock = new Block();
$nodeHomeBlock->setLabel('Wysiwyg');
$nodeHomeBlock->setLanguage($language);
- Create a ticketCreate a ticket
Function load
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
- 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 filterSearch
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function filterSearch(PaginateFinderConfiguration $configuration, Stage $qa)
{
$siteName = $configuration->getSearchIndex('site_name');
if (null !== $siteName && '' !== $siteName) {
$qa->match(array('siteName' => new \MongoRegex('/.*' . $siteName . '.*/i')));
- 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 provideNodeForRecord
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideNodeForRecord()
{
$node0 = Phake::mock('OpenOrchestra\ModelBundle\Document\Node');
Phake::when($node0)->getNodeId()->thenReturn('fakeId');
Phake::when($node0)->getPath()->thenReturn('fakeParentPath/fakePastId');
- Create a ticketCreate a ticket
Method generateNodeFr
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateNodeFr()
{
$htmlContent = <<<EOF
<div class="contact-information">
<h3>Contactez-nous</h3>
- Create a ticketCreate a ticket
Method transformSubConditionToMongoCondition
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function transformSubConditionToMongoCondition($condition, array &$aliases)
{
$elements = array();
$subElements = array();
$operator = '$and';
- Create a ticketCreate a ticket
Method generateNodeFr
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateNodeFr()
{
$htmlContent = <<<EOF
<div class='content2'>
<h1>Open-Orchestra</h1>
- Create a ticketCreate a ticket
Method generateNodeDe
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateNodeDe()
{
$htmlContent = <<<EOF
<div class="contact-information">
<h3>Kontaktieren Sie uns</h3>
- Create a ticketCreate a ticket
Method findByAliasDomain
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findByAliasDomain($domain)
{
$database = $this->dm->getDocumentDatabase($this->documentName);
$collectionName = $this->dm->getClassMetadata($this->documentName)->collection;
- Create a ticketCreate a ticket
Method generateNodeEn
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateNodeEn()
{
$htmlContent = <<<EOF
<div class="contact-information">
<h3>Contact Us</h3>
- Create a ticketCreate a ticket
Method prePersist
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prePersist(LifecycleEventArgs $event)
{
$document = $event->getDocument();
$className = get_class($document);
$generateAnnotations = $this->annotationReader->getClassAnnotation(new \ReflectionClass($className), 'OpenOrchestra\Mapping\Annotations\Document');
- Create a ticketCreate a ticket
Function load
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function load(ObjectManager $objectManager)
{
for ($i = 0; $i < 250 ; $i++) {
$objectManager->persist($this->generateNews($i, 1, 'fr'));
// Versions
- 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 filterSearch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function filterSearch(PaginateFinderConfiguration $configuration, Stage $qa, $siteId)
{
$qa->match(array('siteId' => $siteId));
$name = $configuration->getSearchIndex('name');
- 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 execute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
if (!is_null($input->getOption('type'))) {
$type = $input->getOption('type');
- 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 setPath
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setPath(LifecycleEventArgs $eventArgs)
{
$document = $eventArgs->getDocument();
if ($document instanceof NodeInterface && false === $document->isDeleted()) {
$nodeRepository = $this->container->get('open_orchestra_model.repository.node');
- Create a ticketCreate a ticket