Showing 22 of 22 total issues
Method provideNodesAndTrees
has 255 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideNodesAndTrees()
{
$rootNodeId = 'rootNodeId';
$rootParentId = 'root';
$childNodeId = 'childNodeId';
- Create a ticketCreate a ticket
File TreeManagerTest.php
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace OpenOrchestra\DisplayBundle\Tests\Manager;
use OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase;
- Create a ticketCreate a ticket
Method show
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show(ReadBlockInterface $block)
{
$currentRequest = $this->requestStack->getCurrentRequest();
$routeAttributes = array_merge(
- Create a ticketCreate a ticket
Function show
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function show(ReadBlockInterface $block)
{
$parameters = $this->requestStack->getMasterRequest()->get('_route_params');
if (!array_key_exists('siteId', $parameters) || !array_key_exists('nodeId', $parameters)) {
throw new RouteNotFoundException();
- 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 renderNav
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderNav($numberOfPages, $currentPage = 1, $queryParameters = array(), $maxPagesDisplayedAroundCurrent = 2)
{
$navigation = array();
$firstPageDisplayed = 1;
- Create a ticketCreate a ticket
Method generateHtml
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateHtml(BBcodeElementNodeInterface $el, $preview = false)
{
$children = $el->getChildren();
$option = $el->getAttribute();
if ($preview) {
- Create a ticketCreate a ticket
Function renderNav
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function renderNav($numberOfPages, $currentPage = 1, $queryParameters = array(), $maxPagesDisplayedAroundCurrent = 2)
{
$navigation = array();
$firstPageDisplayed = 1;
- 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 show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show(ReadBlockInterface $block)
{
$template = 'OpenOrchestraDisplayBundle:Block/Video:show.html.twig';
$parameters = array(
'class' => $block->getStyle(),
- Create a ticketCreate a ticket
Method show
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show(ReadBlockInterface $block)
{
$parameters = $this->requestStack->getMasterRequest()->get('_route_params');
if (!array_key_exists('siteId', $parameters) || !array_key_exists('nodeId', $parameters)) {
throw new RouteNotFoundException();
- Create a ticketCreate a ticket
Method getYoutubeParameters
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getYoutubeParameters(ReadBlockInterface $block)
{
$urlParams = array();
foreach (array('youtubeAutoplay', 'youtubeShowinfo', 'youtubeFs', 'youtubeRel', 'youtubeDisablekb', 'youtubeLoop') as $key) {
if ($block->getAttribute($key) === true) {
- Create a ticketCreate a ticket
Function getDailymotionParameters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getDailymotionParameters(ReadBlockInterface $block)
{
$urlParams = array();
foreach (array('dailymotionAutoplay', 'dailymotionChromeless') as $key) {
- 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 testSetPublicResponseCacheParameters
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function testSetPublicResponseCacheParameters($maxAge, $expectedMaxAge, $type, $hasEsi, $maxAgeCount, $sharedMaxAgeCount)
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
EngineInterface $templating,
CacheableManager $cacheableManager,
TagManager $tagManager,
ContextInterface $currentSiteIdInterface,
EventDispatcherInterface $dispatcher
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ReadContentRepositoryInterface $contentRepository,
ReadNodeRepositoryInterface $nodeRepository,
TagManager $tagManager,
TokenStorageInterface $tokenStorage,
AuthorizationCheckerInterface $authorizationChecker
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ReadNodeRepositoryInterface $nodeRepository,
RequestStack $requestStack,
TagManager $tagManager,
AuthorizationCheckerInterface $authorizationChecker,
TokenStorageInterface $tokenStorage
- Create a ticketCreate a ticket
Method testRenderNav
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function testRenderNav($nbPages, $curPage, $params, $maxPages, $expected)
- Create a ticketCreate a ticket
Function getVimeoParameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getVimeoParameters(ReadBlockInterface $block)
{
$urlParams = array();
foreach (array('vimeoAutoplay', 'vimeoFullscreen', 'vimeoLoop') as $key) {
- 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 getStrategy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getStrategy(ReadBlockInterface $block)
{
if (isset($this->cachedStrategies[$block->getId()])) {
return $this->cachedStrategies[$block->getId()];
}
- 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 getYoutubeParameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getYoutubeParameters(ReadBlockInterface $block)
{
$urlParams = array();
foreach (array('youtubeAutoplay', 'youtubeShowinfo', 'youtubeFs', 'youtubeRel', 'youtubeDisablekb', 'youtubeLoop') as $key) {
if ($block->getAttribute($key) === true) {
- 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 generateHtml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function generateHtml(BBcodeElementNodeInterface $el, $preview = false)
{
$children = $el->getChildren();
$option = $el->getAttribute();
if ($preview) {
- 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"