open-orchestra/open-orchestra-front-bundle

View on GitHub

Showing 24 of 32 total issues

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

    public function provideNode()
    {
        $maxAge = array(
            'block1' => 75,
            'block2' => 125,
Severity: Major
Found in FrontBundle/Tests/Manager/NodeResponseManagerTest.php - About 2 hrs to fix

Method generate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)
    {
        $request = $this->requestStack->getMasterRequest();
        if (isset($parameters[self::REDIRECT_TO_LANGUAGE])) {
            try {
Severity: Minor
Found in FrontBundle/Routing/Database/OpenOrchestraDatabaseUrlGenerator.php - About 1 hr to fix

Function generate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)
    {
        $request = $this->requestStack->getMasterRequest();
        if (isset($parameters[self::REDIRECT_TO_LANGUAGE])) {
            try {
Severity: Minor
Found in FrontBundle/Routing/Database/OpenOrchestraDatabaseUrlGenerator.php - About 1 hr 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 setCurrentSiteInfo has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function setCurrentSiteInfo($host, $path)
    {
        $path = $this->formatPath($path);
        $currentSiteId = null;
        $currentLanguage = null;
Severity: Minor
Found in FrontBundle/EventSubscriber/KernelExceptionSubscriber.php - About 1 hr 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 provideDataToVote has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function provideDataToVote()
    {
        return array(
            array(
                Phake::mock('OpenOrchestra\ModelInterface\Model\ReadNodeInterface'),
Severity: Minor
Found in FrontBundle/Tests/Security/Authorization/Voter/NodeVoterTest.php - About 1 hr to fix

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

    public function setUp()
    {
        $this->updatedDate = new \DateTime();
        $this->nodeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');
        $this->node = Phake::mock('OpenOrchestra\ModelInterface\Model\ReadNodeInterface');
Severity: Minor
Found in FrontBundle/Tests/Manager/SitemapManagerTest.php - About 1 hr to fix

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

    public function setUp()
    {
        $this->mainAlias = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteAliasInterface');
        Phake::when($this->mainAlias)->getLanguage()->thenReturn($this->currentLanguage);
        $this->site = Phake::mock('OpenOrchestra\ModelInterface\Model\ReadSiteInterface');
Severity: Minor
Found in FrontBundle/Tests/EventSubscriber/KernelExceptionSubscriberTest.php - About 1 hr to fix

Method setCurrentSiteInfo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function setCurrentSiteInfo($host, $path)
    {
        $path = $this->formatPath($path);
        $currentSiteId = null;
        $currentLanguage = null;
Severity: Minor
Found in FrontBundle/EventSubscriber/KernelExceptionSubscriber.php - About 1 hr to fix

Function execute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $context = $this->getContainer()->get('router')->getContext();
        $context->setBaseUrl('');

Severity: Minor
Found in FrontBundle/Command/OrchestraGenerateErrorPagesCommand.php - About 1 hr 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 execute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($siteId = $input->getOption('siteId')) {
            $site = $this->getContainer()->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
            if ($site) {
Severity: Minor
Found in FrontBundle/Command/OrchestraGenerateSitemapCommand.php - About 1 hr 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 generate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function generate(ReadBlockInterface $block, array $baseSubQuery)
    {
        $blockPrivate = !$this->displayBlockManager->isPublic($block);
        $blockParameters = $this->displayBlockManager->getBlockParameter($block);
        $subQuery = array_merge($baseSubQuery, $this->generateSubQueryCache($blockPrivate));
Severity: Minor
Found in FrontBundle/SubQuery/SubQueryGeneratorManager.php - About 1 hr 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 execute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($siteId = $input->getOption('siteId')) {
            $site = $this->getContainer()->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
            if ($site) {
Severity: Minor
Found in FrontBundle/Command/OrchestraGenerateRobotsCommand.php - About 1 hr 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 __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        ReadSiteRepositoryInterface $siteRepository,
        ContextInterface $currentSiteManager,
        RouteDocumentRepositoryInterface $routeDocumentRepository,
        RouteDocumentToValueObjectTransformer $routeDocumentToValueObjectTransformer,
        RouteDocumentCollectionToRouteCollectionTransformer $routeDocumentCollectionToRouteCollectionTransformer,
Severity: Major
Found in FrontBundle/Routing/Database/OpenOrchestraDatabaseRouter.php - About 1 hr to fix

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

        RouteDocumentRepositoryInterface $routeDocumentRepository,
        ReadSiteRepositoryInterface $siteRepository,
        RouteDocumentToValueObjectTransformer $routeDocumentToValueObjectTransformer,
        ContextInterface $currentSiteManager,
        RequestStack $requestStack,
Severity: Major
Found in FrontBundle/Routing/Database/OpenOrchestraDatabaseUrlGenerator.php - About 1 hr to fix

Function getTemplate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTemplate($name, $device)
    {
        if (is_array($device) && !empty($device)) {
            return $this->getTemplate($name, $device[0]);
        }
Severity: Minor
Found in FrontBundle/Twig/Renderable.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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        ReadSiteRepositoryInterface $siteRepository,
        ReadNodeRepositoryInterface $nodeRepository,
        EngineInterface $templating,
        RequestStack $requestStack,
        ContextInterface $currentSiteManager,
Severity: Minor
Found in FrontBundle/EventSubscriber/KernelExceptionSubscriber.php - About 45 mins to fix

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

    public function testGenerate($support, array $blockParameters, $blockPrivate, array $strategyResponse, array $baseSubQuery, array $expected)
Severity: Minor
Found in FrontBundle/Tests/SubQuery/SubQueryGeneratorManagerTest.php - About 45 mins to fix

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

        \Twig_Environment $environment,
        TemplateNameParserInterface $parser,
        FileLocatorInterface $locator,
        RequestStack $requestStack,
        array $devices,
Severity: Minor
Found in FrontBundle/Twig/OrchestraTwigEngine.php - About 45 mins to fix

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

        RouteDocumentRepositoryInterface $routeDocumentRepository,
        RouteDocumentToValueObjectTransformer $routeDocumentToValueObjectTransformer,
        RouteDocumentCollectionToRouteCollectionTransformer $routeDocumentCollectionToRouteCollectionTransformer,
        RequestStack $requestStack,
        NodeManager $nodeManager,
Severity: Minor
Found in FrontBundle/Routing/Database/OpenOrchestraDatabaseLinkRouter.php - About 45 mins to fix

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

        RouteDocumentRepositoryInterface $routeDocumentRepository,
        RouteDocumentToValueObjectTransformer $routeDocumentToValueObjectTransformer,
        RequestStack $requestStack,
        NodeManager $nodeManager,
        RequestContext $context,
Severity: Minor
Found in FrontBundle/Routing/Database/OpenOrchestraDatabaseLinkGenerator.php - About 45 mins to fix
Severity
Category
Status
Source
Language