open-orchestra/open-orchestra-model-bundle

View on GitHub

Showing 58 of 72 total issues

Function setPath has a Cognitive Complexity of 9 (exceeds 5 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');
Severity: Minor
Found in ModelBundle/EventListener/GeneratePathListener.php - About 55 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 findByHistoryAndSiteId has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $id,
        $siteId,
        array $eventTypes = null,
        $published = null,
        $limit = null,
Severity: Major
Found in ModelBundle/Repository/ContentRepository.php - About 50 mins to fix

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

    public function removeBlockInArea($blockId, $areaName, $nodeId, $siteId, $language, $version)
Severity: Minor
Found in ModelBundle/Repository/NodeRepository.php - About 45 mins to fix

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

    protected function generateContent($type, $id, $name, $language, $version, $deleted)
Severity: Minor
Found in ModelBundle/DataFixtures/MongoDB/LoadContentThousandData.php - About 45 mins to fix

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

    protected function addNewsAttributes($news, $title, $start, $end, $intro, $text)
Severity: Minor
Found in ModelBundle/DataFixtures/MongoDB/LoadContentNewsData.php - About 45 mins to fix

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

    public function findByHistoryAndSiteId($id, $siteId, array $eventTypes = null, $published = null, $limit = null, array $sort = null)
Severity: Minor
Found in ModelBundle/Repository/NodeRepository.php - About 45 mins to fix

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

    public function isTransient($className)
    {
        $parentCheck = parent::isTransient($className);

        if (true == $parentCheck) {
Severity: Minor
Found in ModelBundle/DataFixtures/Loader/OrchestraContainerAwareLoader.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 countInContextByContentTypeSiteAndLanguage has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function countInContextByContentTypeSiteAndLanguage($contentType, $siteId, $language, PaginateFinderConfiguration $configuration = null, array $searchTypes = array())
Severity: Minor
Found in ModelBundle/Repository/ContentRepository.php - About 35 mins to fix

Method testConfigDocument has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testConfigDocument($file, $class, $name, $repository = null , $filter = false)

Method countWithFilterAndContentTypeSiteAndLanguage has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function countWithFilterAndContentTypeSiteAndLanguage(PaginateFinderConfiguration $configuration, $contentType, $siteId, $language, array $searchTypes = array())
Severity: Minor
Found in ModelBundle/Repository/ContentRepository.php - About 35 mins to fix

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

    public function __construct(AbstractFixture $fixture, ContainerInterface $container, ObjectManager $manager, $version = '1', $status = 'status-published')
Severity: Minor
Found in ModelBundle/DataFixtures/MongoDB/DemoContent/AbstractDataGenerator.php - About 35 mins to fix

Method findByContentTypeAndCondition has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function findByContentTypeAndCondition($language, $contentType = '', $choiceType = self::CHOICE_AND, $condition = null, $siteId = null)
Severity: Minor
Found in ModelBundle/Repository/ContentRepository.php - About 35 mins to fix

Method findForPaginateFilterByContentTypeSiteAndLanguage has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function findForPaginateFilterByContentTypeSiteAndLanguage(PaginateFinderConfiguration $configuration, $contentType, $siteId, $language, array $searchTypes = array())
Severity: Minor
Found in ModelBundle/Repository/ContentRepository.php - About 35 mins to fix

Method testRecord has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testRecord($method, Node $node, Node $parentNode, ArrayCollection $children, $expectedPath)
Severity: Minor
Found in ModelBundle/Tests/EventListener/GeneratePathListenerTest.php - About 35 mins to fix

Method createQueryWithFilterAndLastVersion has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        PaginateFinderConfiguration $configuration,
        $siteId,
        $language,
        $elementName,
        $order = array()
Severity: Minor
Found in ModelBundle/Repository/NodeRepository.php - About 35 mins to fix

Function transformConditionToMongoCondition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function transformConditionToMongoCondition($condition, $count = 0, array $aliases = array(), $delimiter = '##')
    {
        if (!is_null($condition)) {
            $encapsuledElements = array();
            preg_match_all(KeywordableTraitInterface::GET_BALANCED_BRACKETS, $condition, $encapsuledElements);
Severity: Minor
Found in ModelBundle/Repository/RepositoryTrait/KeywordableTrait.php - About 35 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 getTreeParentIdLevelAndLanguage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getTreeParentIdLevelAndLanguage($parentId, $nbLevel, $language, $siteId)
    {
        $result = array();

        if ($nbLevel >= 0) {
Severity: Minor
Found in ModelBundle/Repository/NodeRepository.php - About 25 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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, Constraint $constraint)
    {
        if (!$value instanceof StatusableInterface) {
            return;
        }

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