Showing 318 of 14,363 total issues
Function validateCondition
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function validateCondition($condition)
{
$is_boolean = true;
if (!empty($condition)) {
$encapsuledElements = array();
- 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 buildForm
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildForm(FormBuilderInterface $builder, array $options)
{
if (array_key_exists('property_path', $options) && is_null($options['property_path'])){
$builder->setData($options['prototype_data']());
}
- Create a ticketCreate a ticket
Method setUp
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUp()
{
$this->fieldOptionClass = 'OpenOrchestra\ModelBundle\Document\FieldOption';
$this->fieldTypeClass = 'OpenOrchestra\ModelBundle\Document\FieldType';
$this->form = Phake::mock('Symfony\Component\Form\Form');
- Create a ticketCreate a ticket
Function activate
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
activate($element) {
let tags = $element.data('tags');
let prepopulatedTags = $element.val().split(' ');
let context = this;
$element.tokenInput(tags, {
- Create a ticketCreate a ticket
Method setUp
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUp()
{
$this->node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');
$this->area = Phake::mock('OpenOrchestra\ModelInterface\Model\AreaInterface');
$this->block = Phake::mock('OpenOrchestra\ModelInterface\Model\BlockInterface');
- Create a ticketCreate a ticket
Function _drawGraphic
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawGraphic(transitions , selector) {
var g = new dagreD3.graphlib.Graph().setGraph({});
g.graph().rankdir = 'LR';
for (let transition of transitions) {
- Create a ticketCreate a ticket
Method addFormElements
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addFormElements(FormEvent $event)
{
$form = $event->getForm();
$data = $event->getData();
- Create a ticketCreate a ticket
Method newAction
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function newAction(Request $request, $siteId, $language, $parentId, $order)
{
$order = (int) $order;
$nodeManager = $this->get('open_orchestra_backoffice.manager.node');
$nodeRepository = $this->get('open_orchestra_model.repository.node');
- Create a ticketCreate a ticket
Method buildForm
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('siteId', 'oo_site_choice', array(
'label' => 'open_orchestra_backoffice.form.redirection.site_name',
'group_id' => 'redirection',
- Create a ticketCreate a ticket
Method testResolver
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testResolver()
{
$this->form->configureOptions($this->resolver);
Phake::verify($this->resolver)->setDefaults(array(
'data_class' => $this->class,
- 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 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 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 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
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
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