Showing 354 of 14,363 total issues
Method testConfigureOptions
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testConfigureOptions()
{
$resolver = Phake::mock('Symfony\Component\OptionsResolver\OptionsResolver');
$this->blockType->configureOptions($resolver);
- Create a ticketCreate a ticket
Method setUp
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUp()
{
$this->redirectionClass = 'OpenOrchestra\ModelBundle\Document\Redirection';
$this->contextManager = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');
- Create a ticketCreate a ticket
Method newAction
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function newAction(Request $request, $contentTypeId, $language)
{
$siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
$site = $this->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
- Create a ticketCreate a ticket
Method provideEntityAndNodes
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideEntityAndNodes()
{
$blockWithoutNodeId = 'blockWithoutNodeId';
$blockWithoutNode = Phake::mock('OpenOrchestra\ModelInterface\Model\BlockInterface');
Phake::when($blockWithoutNode)->getAttributes()->thenReturn(array());
- Create a ticketCreate a ticket
Method configureOptions
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
array(
'data_class' => null,
- Create a ticketCreate a ticket
Function validate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, Constraint $constraint)
{
$parameters = array(
'initial_state' => 0,
'translation_state' => 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
Function preSubmit
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function preSubmit(FormEvent $event)
{
$data = $event->getData();
$user = $event->getForm()->getData();
if ($user instanceof UserInterface) {
- 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 testGetPerimeterConfiguration
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGetPerimeterConfiguration()
{
$result = $this->strategy->getPerimeterConfiguration('siteId');
$this->assertEquals(array(
- Create a ticketCreate a ticket
Method configureOptions
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => $this->class,
'edit_groups' => true,
- Create a ticketCreate a ticket
Method testConfigureOptions
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testConfigureOptions()
{
$resolverMock = Phake::mock('Symfony\Component\OptionsResolver\OptionsResolver');
$this->form->configureOptions($resolverMock);
- Create a ticketCreate a ticket
Method provideStatusAndUsage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideStatusAndUsage()
{
$status0 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
Phake::when($status0)->isInitialState()->thenReturn(true);
Phake::when($status0)->isPublishedState()->thenReturn(false);
- Create a ticketCreate a ticket
Function addFormElements
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function addFormElements(FormEvent $event)
{
$form = $event->getForm();
$data = $event->getData();
- 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 process
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function process(ContainerBuilder $container)
{
$resourcePath = '.';
foreach ($container->getResources() as $resource) {
- 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 exports
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
grunt.registerTask('menu:compile', 'Open Orchestra task to find template underscore and compile it', function () {
var config = grunt.config('application.config');
- Create a ticketCreate a ticket
Method buildForm
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('label', 'text', array(
'label' => 'open_orchestra_backoffice.form.block.label',
'constraints' => new NotBlank(),
- Create a ticketCreate a ticket
Method configureOptions
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
array(
'data_class' => $this->contentTypeClass,
- Create a ticketCreate a ticket
Method formAction
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formAction(Request $request, $contentId, $language, $version)
{
$content = $this->get('open_orchestra_model.repository.content')->findOneByLanguageAndVersion($contentId, $language, $version);
if (!$content instanceof ContentInterface) {
throw new \UnexpectedValueException();
- Create a ticketCreate a ticket
Function listContent
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
listContent(contentTypeId, language, page) {
if (null === page) {
page = 1
}
this._displayLoader(Application.getRegion('content'));
- Create a ticketCreate a ticket
Method validate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validate($value, Constraint $constraint)
{
$parameters = array(
'initial_state' => 0,
'translation_state' => 0,
- Create a ticketCreate a ticket
Method setUp
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUp()
{
$this->eventDispatcher = Phake::mock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');
- Create a ticketCreate a ticket