Reference to constant WORKFLOW_PROFILE_CREATE
from undeclared class \OpenOrchestra\ModelInterface\WorkflowProfileEvents
Open
$this->dispatchEvent(WorkflowProfileEvents::WORKFLOW_PROFILE_CREATE, new WorkflowProfileEvent($workflowProfile));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::get
Open
$workflowProfile = $this->get('open_orchestra_model.repository.workflow_profile')->find($workflowProfileId);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::isGranted
Open
'delete_button' => $this->isGranted(ContributionActionInterface::DELETE, WorkflowProfileInterface::ENTITY_TYPE),
- Create a ticketCreate a ticket
- Exclude checks
Argument 1 (form)
is \Symfony\Component\Form\Form
but \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::handleForm()
takes \Symfony\Component\Form\FormInterface
defined at /code/BackofficeBundle/Controller/AbstractAdminController.php:29
Open
if ($this->handleForm($form, $message)) {
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant WORKFLOW_PROFILE_UPDATE
from undeclared class \OpenOrchestra\ModelInterface\WorkflowProfileEvents
Open
$this->dispatchEvent(WorkflowProfileEvents::WORKFLOW_PROFILE_UPDATE, new WorkflowProfileEvent($workflowProfile));
- Create a ticketCreate a ticket
- Exclude checks
Argument 1 (form)
is \Symfony\Component\Form\Form
but \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::renderAdminForm()
takes \Symfony\Component\Form\FormInterface
defined at /code/BackofficeBundle/Controller/AbstractAdminController.php:58
Open
return $this->renderAdminForm($form);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::get
Open
$this->get('session')->getFlashBag()->add('success', $message);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant HTTP_CREATED
from undeclared class \Symfony\Component\HttpFoundation\Response
Open
Response::HTTP_CREATED,
- Create a ticketCreate a ticket
- Exclude checks
Parameter $request
has undeclared type \Symfony\Component\HttpFoundation\Request
Open
public function newAction(Request $request)
- Create a ticketCreate a ticket
- Exclude checks
Return type of newAction()
is undeclared type \Symfony\Component\HttpFoundation\Response
Open
public function newAction(Request $request)
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::generateUrl
Open
'action' => $this->generateUrl('open_orchestra_workflow_admin_workflow_profile_new'),
- Create a ticketCreate a ticket
- Exclude checks
Return type of formAction()
is undeclared type \Symfony\Component\HttpFoundation\Response
Open
public function formAction(Request $request, $workflowProfileId)
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::get
Open
$message = $this->get('translator')->trans('open_orchestra_workflow_admin.form.workflow_profile.success');
- Create a ticketCreate a ticket
- Exclude checks
Argument 2 (event)
is \OpenOrchestra\ModelInterface\Event\WorkflowProfileEvent
but \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::dispatchEvent()
takes \Symfony\Component\EventDispatcher\Event
defined at /code/BackofficeBundle/Controller/AbstractAdminController.php:81
Open
$this->dispatchEvent(WorkflowProfileEvents::WORKFLOW_PROFILE_CREATE, new WorkflowProfileEvent($workflowProfile));
- Create a ticketCreate a ticket
- Exclude checks
Parameter $request
has undeclared type \Symfony\Component\HttpFoundation\Request
Open
public function formAction(Request $request, $workflowProfileId)
- Create a ticketCreate a ticket
- Exclude checks
Argument 1 (form)
is \Symfony\Component\Form\Form
but \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::renderAdminForm()
takes \Symfony\Component\Form\FormInterface
defined at /code/BackofficeBundle/Controller/AbstractAdminController.php:58
Open
return $this->renderAdminForm($form);
- Create a ticketCreate a ticket
- Exclude checks
Argument 2 (data)
is object
but \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::createForm()
takes null
defined at /code/BackofficeBundle/Controller/AbstractAdminController.php:94
Open
$form = $this->createForm('oo_workflow_profile', $workflowProfile, array(
- Create a ticketCreate a ticket
- Exclude checks
Call to method isValid
from undeclared class \Symfony\Component\Form\Form
Open
if ($form->isValid()) {
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \Symfony\Component\HttpFoundation\Response
Open
$response = new Response(
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::denyAccessUnlessGranted
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::CREATE, WorkflowProfileInterface::ENTITY_TYPE);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::get
Open
$message = $this->get('translator')->trans('open_orchestra_workflow_admin.form.workflow_profile.creation');
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \OpenOrchestra\ModelInterface\Event\WorkflowProfileEvent
Open
$this->dispatchEvent(WorkflowProfileEvents::WORKFLOW_PROFILE_UPDATE, new WorkflowProfileEvent($workflowProfile));
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \OpenOrchestra\ModelInterface\Event\WorkflowProfileEvent
Open
$this->dispatchEvent(WorkflowProfileEvents::WORKFLOW_PROFILE_CREATE, new WorkflowProfileEvent($workflowProfile));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::generateUrl
Open
'action' => $this->generateUrl('open_orchestra_workflow_admin_workflow_profile_form', array(
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::get
Open
$documentManager = $this->get('object_manager');
- Create a ticketCreate a ticket
- Exclude checks
Argument 2 (event)
is \OpenOrchestra\ModelInterface\Event\WorkflowProfileEvent
but \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::dispatchEvent()
takes \Symfony\Component\EventDispatcher\Event
defined at /code/BackofficeBundle/Controller/AbstractAdminController.php:81
Open
$this->dispatchEvent(WorkflowProfileEvents::WORKFLOW_PROFILE_UPDATE, new WorkflowProfileEvent($workflowProfile));
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController->container
Open
$workflowProfileClass = $this->container->getParameter('open_orchestra_model.document.workflow_profile.class');
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::CREATE, WorkflowProfileInterface::ENTITY_TYPE);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::get
Open
array('Content-type' => 'text/html; charset=utf-8', 'workflowProfileId' => $workflowProfile->getId(), 'name' => $workflowProfile->getLabel($this->get('open_orchestra_backoffice.context_backoffice_manager')->getBackOfficeLanguage()))
- Create a ticketCreate a ticket
- Exclude checks
Possibly zero references to use statement for classlike/namespace Config
(\Sensio\Bundle\FrameworkExtraBundle\Configuration)
Open
use Sensio\Bundle\FrameworkExtraBundle\Configuration as Config;
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Controller\Admin\WorkflowProfileController::denyAccessUnlessGranted
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $workflowProfile);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface
Open
'delete_button' => $this->isGranted(ContributionActionInterface::DELETE, WorkflowProfileInterface::ENTITY_TYPE),
- Create a ticketCreate a ticket
- Exclude checks
Call to method handleRequest
from undeclared class \Symfony\Component\Form\Form
Open
$form->handleRequest($request);
- Create a ticketCreate a ticket
- Exclude checks
Call to method handleRequest
from undeclared class \Symfony\Component\Form\Form
Open
$form->handleRequest($request);
- Create a ticketCreate a ticket
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($form->isValid()) {
$documentManager = $this->get('object_manager');
$documentManager->persist($workflowProfile);
$documentManager->flush();
$message = $this->get('translator')->trans('open_orchestra_workflow_admin.form.workflow_profile.creation');
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 158.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Line exceeds 120 characters; contains 248 characters Open
array('Content-type' => 'text/html; charset=utf-8', 'workflowProfileId' => $workflowProfile->getId(), 'name' => $workflowProfile->getLabel($this->get('open_orchestra_backoffice.context_backoffice_manager')->getBackOfficeLanguage()))
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$this->dispatchEvent(WorkflowProfileEvents::WORKFLOW_PROFILE_UPDATE, new WorkflowProfileEvent($workflowProfile));
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
'delete_button' => $this->isGranted(ContributionActionInterface::DELETE, WorkflowProfileInterface::ENTITY_TYPE),
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$this->dispatchEvent(WorkflowProfileEvents::WORKFLOW_PROFILE_CREATE, new WorkflowProfileEvent($workflowProfile));
- Create a ticketCreate a ticket
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
);
- Create a ticketCreate a ticket
- Exclude checks