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,
- Create a ticketCreate a ticket
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 {
- Create a ticketCreate a ticket
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 {
- 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 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;
- 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 provideDataToVote
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideDataToVote()
{
return array(
array(
Phake::mock('OpenOrchestra\ModelInterface\Model\ReadNodeInterface'),
- Create a ticketCreate a ticket
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');
- Create a ticketCreate a ticket
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');
- Create a ticketCreate a ticket
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;
- Create a ticketCreate a ticket
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('');
- 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 ($siteId = $input->getOption('siteId')) {
$site = $this->getContainer()->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
if ($site) {
- 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 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));
- 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 ($siteId = $input->getOption('siteId')) {
$site = $this->getContainer()->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
if ($site) {
- 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 __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ReadSiteRepositoryInterface $siteRepository,
ContextInterface $currentSiteManager,
RouteDocumentRepositoryInterface $routeDocumentRepository,
RouteDocumentToValueObjectTransformer $routeDocumentToValueObjectTransformer,
RouteDocumentCollectionToRouteCollectionTransformer $routeDocumentCollectionToRouteCollectionTransformer,
- Create a ticketCreate a ticket
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
RouteDocumentRepositoryInterface $routeDocumentRepository,
ReadSiteRepositoryInterface $siteRepository,
RouteDocumentToValueObjectTransformer $routeDocumentToValueObjectTransformer,
ContextInterface $currentSiteManager,
RequestStack $requestStack,
- Create a ticketCreate a ticket
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]);
}
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ReadSiteRepositoryInterface $siteRepository,
ReadNodeRepositoryInterface $nodeRepository,
EngineInterface $templating,
RequestStack $requestStack,
ContextInterface $currentSiteManager,
- Create a ticketCreate a ticket
Method testGenerate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function testGenerate($support, array $blockParameters, $blockPrivate, array $strategyResponse, array $baseSubQuery, array $expected)
- Create a ticketCreate a ticket
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
\Twig_Environment $environment,
TemplateNameParserInterface $parser,
FileLocatorInterface $locator,
RequestStack $requestStack,
array $devices,
- Create a ticketCreate a ticket
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
RouteDocumentRepositoryInterface $routeDocumentRepository,
RouteDocumentToValueObjectTransformer $routeDocumentToValueObjectTransformer,
RouteDocumentCollectionToRouteCollectionTransformer $routeDocumentCollectionToRouteCollectionTransformer,
RequestStack $requestStack,
NodeManager $nodeManager,
- Create a ticketCreate a ticket
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
RouteDocumentRepositoryInterface $routeDocumentRepository,
RouteDocumentToValueObjectTransformer $routeDocumentToValueObjectTransformer,
RequestStack $requestStack,
NodeManager $nodeManager,
RequestContext $context,
- Create a ticketCreate a ticket