Dependencies not installable

  • Critical
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/composer.dependencies_not_installable

SensioLabsInsight was not able to install your Composer dependencies. If you need to customize files or run commands to make it work, you can edit your SensioLabsInsight project configuration to override the default "pre_composer_script" and/or "post_composer_script" settings.

Time to fix: about 3 hours
Open Issue Permalink
Collective
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating optimized autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Creating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

Fatal error: Cannot use 'String' as class name as it is reserved in /home/foobar/code/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/String.php on line 23
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception

                                                                                                                                                                                        
  [RuntimeException]                                                                                                                                                                    
  An error occurred when executing the "'cache:clear --no-warmup'" command:                                                                                                             
                                                                                                                                                                                        
                                                                                                                                                                                        
  Fatal error: Cannot use 'String' as class name as it is reserved in /home/foobar/code/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/String.php on line 23  
                                                                                                                                                                                        
                                                                                                                                                                                        
  .                                                                                                                                                                                     
                                                                                                                                                                                        

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

Projects must not depend on dependencies with known security issues 3

  • Critical
  • Security

More information: https://insight.sensiolabs.com/what-we-analyse/composer.security_issue_in_composer

The checker detected 1 security issues in package doctrine/mongodb-odm installed in version 1.0.x-dev#328c1eba840a4f3b81d3a28211b3f1ce5445ceaf
1) Security Misconfiguration Vulnerability in various Doctrine projects.

Time to fix: about 1 day
Open Issue Permalink
Collective

The checker detected 1 security issues in package doctrine/mongodb-odm-bundle installed in version 3.0.x-dev#1ac417f1e1374474778707f9f0d7d82b19d17922
1) Security Misconfiguration Vulnerability in various Doctrine projects.

Time to fix: about 1 day
Open Issue Permalink
Collective

Controllers should contain a small set of actions

  • Major
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.controller.too_many_actions_per_controller

8% of all your controllers have more than 10 actions, the threshold is 5%.

Time to fix: about 3.2 weeks
Open Issue Permalink
Collective

Public methods in controller classes should only be actions (with the Action suffix) 36

  • Major
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.controller.non_action_public_method_in_controller_class

  1. *
  2. * @param $config
  3. *
  4. * @return array
  5. */
  6. public function getCriteria($config)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Mercedes Rey
  7. {
  8. $request = $this->container->get('request_stack')->getCurrentRequest();
  9. $criteria = $request->get('criteria', array());
  10. if (array_key_exists('reset', $criteria)) {
  1. * @param $criteria
  2. * @param null $selectedSeriesId
  3. *
  4. * @return array|mixed|Pagerfanta
  5. */
  6. public function getResources(Request $request, $config, $criteria, $selectedSeriesId = null)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  7. {
  8. $sorting = $this->getSorting($request);
  9. $repository = $this->getRepository();
  10. $session = $this->get('session');
  11. $session_namespace = 'admin/series';
  1. *
  2. * @return JsonResponse
  3. *
  4. * @Route("add/sorting/", name="pumukit_new_admin_live_event_set_sorting")
  5. */
  6. public function addSessionSorting(Request $request)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by pogando
  7. {
  8. $session = $this->get('session');
  9. if ($request->request->get('field')) {
  10. $field = $request->request->get('field');
  1. * @param $multimediaObjectId
  2. *
  3. * @return JsonResponse
  4. * @Route("/delete/tag/{multimediaObjectId}/{tagCod}", name="pumukitnewadmin_unesco_delete_tag")
  5. */
  6. public function deleteTagDnD($tagCod, $multimediaObjectId)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by pogando
  7. {
  8. $dm = $this->container->get('doctrine_mongodb')->getManager();
  9. $tagService = $this->container->get('pumukitschema.tag');
  10. $translator = $this->get('translator');
  1. * @param $multimediaObjectId
  2. *
  3. * @return JsonResponse
  4. * @Route("/add/tag/{multimediaObjectId}/{tagCod}", name="pumukitnewadmin_unesco_add_tag")
  5. */
  6. public function addTagDnD($tagCod, $multimediaObjectId)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by pogando
  7. {
  8. $dm = $this->container->get('doctrine_mongodb')->getManager();
  9. $tagService = $this->container->get('pumukitschema.tag');
  10. $multimediaObject = $dm->getRepository('PumukitSchemaBundle:MultimediaObject')->findOneById(
  1. * @param string $option
  2. *
  3. * @return JsonResponse
  4. * @Route("/option/selected/{option}", name="pumukitnewadmin_unesco_options_list")
  5. */
  6. public function optionsMultimediaObjects(Request $request, $option)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by pogando
  7. {
  8. $session = $this->get('session');
  9. $session->remove('admin/unesco/tag');
  10. $session->remove('admin/unesco/page');
  11. $session->remove('admin/unesco/paginate');
  1. {
  2. $breadcrumbs = $this->get('pumukit_web_tv.breadcrumbs');
  3. $breadcrumbs->addMultimediaObject($multimediaObject);
  4. }
  5. public function preExecute(MultimediaObject $multimediaObject, Request $request)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Alfro
  6. {
  7. if ($opencasturl = $multimediaObject->getProperty('opencasturl')) {
  8. $this->incNumView($multimediaObject);
  9. $this->dispatch($multimediaObject);
  10. if ($invert = $multimediaObject->getProperty('opencastinvert')) {
  1. return $this->redirect($opencasturl);
  2. }
  3. }
  4. public function testBroadcast(MultimediaObject $multimediaObject, Request $request)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Alfro
  5. {
  6. if (($broadcast = $multimediaObject->getBroadcast()) &&
  7. (Broadcast::BROADCAST_TYPE_PUB !== $broadcast->getBroadcastTypeId()) &&
  8. ((!($broadcastName = $request->headers->get('PHP_AUTH_USER', false))) ||
  9. ($request->headers->get('PHP_AUTH_PW') !== $broadcast->getPasswd()) ||
  1. }
  2. /**
  3. * Overwrite to update the session.
  4. */
  5. public function delete($resource)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  6. {
  7. $config = $this->getConfiguration();
  8. $event = $this->dispatchEvent('pre_delete', $resource);
  9. if (!$event->isStopped()) {
  10. $this->get('session')->remove('admin/'.$config->getResourceName().'/id');
  1. }
  2. return $this->redirect($this->generateUrl('pumukitnewadmin_'.$resourceName.'_list'));
  3. }
  4. public function find($id)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  5. {
  6. $config = $this->getConfiguration();
  7. $repository = $this->getRepository();
  8. $criteria = array('id' => $id);
  1. }
  2. /**
  3. * Gets the criteria values.
  4. */
  5. public function getCriteria($config)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  6. {
  7. $criteria = $config->getCriteria();
  8. if (array_key_exists('reset', $criteria)) {
  9. $this->get('session')->remove('admin/'.$config->getResourceName().'/criteria');
  1. }
  2. /**
  3. * Gets the list of resources according to a criteria.
  4. */
  5. public function getResources(Request $request, $config, $criteria)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  6. {
  7. $sorting = $config->getSorting();
  8. $repository = $this->getRepository();
  9. $session = $this->get('session');
  10. $session_namespace = 'admin/'.$config->getResourceName();
  1. *
  2. * @param object|null $resource
  3. *
  4. * @return FormInterface
  5. */
  6. public function getForm($resource = null)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Mercedes Rey
  7. {
  8. $formName = $this->config->getFormType();
  9. $prefix = 'pumukitnewadmin_';
  10. $formType = 'Pumukit\\NewAdminBundle\\Form\\Type\\'.ucfirst(substr($formName, strlen($prefix))).'Type';
  1. * Get all groups for logged in user
  2. * according to user scope.
  3. *
  4. * @return ArrayCollection
  5. */
  6. public function getAllGroups()

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by mrey
  7. {
  8. $groupService = $this->get('pumukitschema.group');
  9. $userService = $this->get('pumukitschema.user');
  10. $loggedInUser = $this->getUser();
  11. if ($loggedInUser->isSuperAdmin() || $userService->hasGlobalScope($loggedInUser)) {
  1. }
  2. /**
  3. * Overwrite to check Broadcast creation.
  4. */
  5. public function delete($broadcast)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by mrey
  6. {
  7. $this->checkCreateBroadcastDisabled();
  8. $event = $this->dispatchEvent('pre_delete', $broadcast);
  9. if (!$event->isStopped()) {
  1. }
  2. /**
  3. * Gets the list of resources according to a criteria.
  4. */
  5. public function getResources(Request $request, $config, $criteria)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by mrey
  6. {
  7. $sorting = $this->getSorting($request);
  8. $repository = $this->getRepository();
  9. $session = $this->get('session');
  10. $sessionNamespace = 'admin/group';
  1. }
  2. return $this->redirect($this->generateUrl('pumukitnewadmin_group_data_resources', array('id' => $group->getId(), 'resourceName' => 'embeddedbroadcast')));
  3. }
  4. public function getCriteria($config)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  5. {
  6. $new_criteria = parent::getCriteria($config);
  7. if (isset($new_criteria['origin']) &&
  8. '/all/i' == (string) $new_criteria['origin']) {
  9. unset($new_criteria['origin']);
  1. }
  2. /**
  3. * Gets the criteria values.
  4. */
  5. public function getCriteria($config)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Mercedes Rey
  6. {
  7. $criteria = $config->getCriteria();
  8. if (array_key_exists('reset', $criteria)) {
  9. $this->get('session')->remove('admin/event/criteria');
  1. }
  2. /**
  3. * Gets the list of resources according to a criteria.
  4. */
  5. public function getResources(Request $request, $config, $criteria)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Mercedes Rey
  6. {
  7. $sorting = array('date' => -1);
  8. $repository = $this->getRepository();
  9. $session = $this->get('session');
  10. $session_namespace = 'admin/event';
  1. }
  2. /**
  3. * Gets the list of resources according to a criteria.
  4. */
  5. public function getResources(Request $request, $config, $criteria)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Mercedes Rey
  6. {
  7. $sorting = $config->getSorting();
  8. $repository = $this->getRepository();
  9. $session = $this->get('session');
  10. $session_namespace = 'admin/live';
  1. }
  2. /**
  3. * Gets the criteria values.
  4. */
  5. public function getCriteria($config)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by pogando
  6. {
  7. $request = $this->container->get('request_stack')->getCurrentRequest();
  8. $criteria = $request->get('criteria', array());
  9. if (array_key_exists('reset', $criteria)) {
  1. }
  2. /**
  3. * Gets the list of resources according to a criteria.
  4. */
  5. public function getResources(Request $request, $config, $criteria)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by pogando
  6. {
  7. $sorting = $this->getSorting($request, $this->getResourceName($request));
  8. $repository = $this->getRepository();
  9. $session = $this->get('session');
  10. $session_namespace = 'admin/'.$this->getResourceName($request);
  1. *
  2. * @param object|null $permissionProfile
  3. *
  4. * @return FormInterface
  5. */
  6. public function getForm($permissionProfile = null)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by mrey
  7. {
  8. $translator = $this->get('translator');
  9. $locale = $this->getRequest()->getLocale();
  10. $form = $this->createForm(new PermissionProfileType($translator, $locale), $permissionProfile);
  1. /**
  2. * Gets the list of resources according to a criteria.
  3. *
  4. * Override to get 9 resources per page
  5. */
  6. public function getResources(Request $request, $config, $criteria)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by mrey
  7. {
  8. $sorting = $config->getSorting();
  9. if (!isset($sorting['rank'])) {
  10. $sorting['rank'] = 1;
  11. }
  1. }
  2. /**
  3. * Gets the criteria values.
  4. */
  5. public function getCriteria($config, $locale = 'en')

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  6. {
  7. $criteria = $config->getCriteria();
  8. if (array_key_exists('reset', $criteria)) {
  9. $this->get('session')->remove('admin/person/criteria');
  1. }
  2. /**
  3. * Gets the list of resources according to a criteria.
  4. */
  5. public function getResources(Request $request, $config, $criteria, $selectedPersonId = null)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  6. {
  7. $sorting = $this->getSorting($request);
  8. $repository = $this->getRepository();
  9. $session = $this->get('session');
  1. }
  2. /**
  3. * Gets the criteria values.
  4. */
  5. public function getCriteria(Request $request)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Alfro
  6. {
  7. $criteria = $request->get('criteria', array());
  8. if (array_key_exists('reset', $criteria)) {
  9. $this->get('session')->remove('admin/playlist/criteria');
  1. }
  2. /**
  3. * Gets the list of resources according to a criteria.
  4. */
  5. public function getResources(Request $request, $config, $criteria)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by mrey
  6. {
  7. $sorting = $config->getSorting();
  8. $sorting['rank'] = 'asc';
  9. $repository = $this->getRepository();
  10. $session = $this->get('session');
  1. *
  2. * @param $config
  3. *
  4. * @return array
  5. */
  6. public function getCriteria($config)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  7. {
  8. $criteria = $config->getCriteria();
  9. if (array_key_exists('reset', $criteria)) {
  10. $this->get('session')->remove('admin/user/criteria');
  1. }
  2. /*
  3. * Genera la salida de GetRecord
  4. */
  5. public function getRecord($request)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  6. {
  7. if ($request->query->get('metadataPrefix') !== 'oai_dc') {
  8. return $this->error('cannotDisseminateFormat', 'cannotDisseminateFormat');
  9. }
  1. $XMLidentify->addChild('granularity', 'YYYY-MM-DDThh:mm:ssZ');
  2. return $this->genResponse($XMLrequest, $XMLidentify);
  3. }
  4. public function listIdentifiers($request)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  5. {
  6. $verb = $request->query->get('verb');
  7. $limit = 10;
  8. try {
  1. }
  2. /**
  3. * Gets the criteria values.
  4. */
  5. public function getCriteria($request)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Aaron Aballe
  6. {
  7. $criteria = $request->get('criteria', array());
  8. if (array_key_exists('reset', $criteria)) {
  9. $this->get('session')->remove('admin/opencast/criteria');
  1. /**
  2. * @Route("/users/{username}/pager/{type}", name="pumukit_webtv_byuser_objects_pager", defaults={"username": null, "type": "multimediaobject"})
  3. * @ParamConverter("user", class="PumukitSchemaBundle:User", options={"mapping": {"username": "username"}})
  4. * @Template()
  5. */
  6. public function userObjectsPager(User $user, Request $request)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by mrey
  7. {
  8. list($scroll_list, $numberCols, $limit, $roleCode) = $this->getParameters();
  9. $type = $request->get('type');
  10. $person = $user->getPerson();
  1. 'results' => $results,
  2. 'number_cols' => $numberCols,
  3. );
  4. }
  5. public function getChannelTitle($channelNumber)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Alfro
  6. {
  7. $title = isset($this->titles[$channelNumber]) ? $this->titles[$channelNumber] : 'No title';
  8. $title = $this->get('translator')->trans($title);
  9. return $title;
  1. $title = $this->get('translator')->trans($title);
  2. return $title;
  3. }
  4. public function getTagsForChannel($channelNumber)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Alfro
  5. {
  6. $tagCods = isset($this->tags[$channelNumber]) ? $this->tags[$channelNumber] : array();
  7. $tags = array();
  8. $repoTags = $this->get('doctrine_mongodb')->getRepository('PumukitSchemaBundle:Tag');
  9. foreach ($tagCods as $tagCod) {
  1. $relatedMms = $mmobjRepo->findRelatedMultimediaObjects($multimediaObject);
  2. return array('multimediaObjects' => $relatedMms);
  3. }
  4. public function preExecute(MultimediaObject $multimediaObject, Request $request, $secret = false)

    Non-action public method found in controller class

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Alfro
  5. {
  6. if ($multimediaObject->getProperty('opencasturl') && !$request->query->has('track_id')) {
  7. if ($secret) {
  8. return $this->forward('PumukitWebTVBundle:Opencast:magic', array('request' => $request, 'multimediaObject' => $multimediaObject));
  9. } else {

Absolute path constants __DIR__ and __FILE__ should not be used 13

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.dependency_injection.use_dir_file_constant

  1. }
  2. */
  3. //TODO
  4. //$console = $this->getContainer()->getParameter('kernel.root_dir').'/console';
  5. $console = __DIR__.'/../../../../app/console';

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  6. $pb
  7. ->add('php')
  8. ->add($console)
  9. ->add(sprintf('--env=%s', $this->environment))
  1. echo "Failed to copy $newFile...\n";
  2. }
  3. $zip = new ZipArchive();
  4. if ($zip->open($newFile, ZIPARCHIVE::CREATE) == true) {
  5. $zip->extractTo(realpath(dirname(__FILE__).'/../Resources/public/'));

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Alfro
  6. $zip->close();
  7. }
  8. }
  9. $progress = new \Symfony\Component\Console\Helper\ProgressBar($output, 13);
  10. $output->writeln("\nCreating resources...");
  1. }
  2. private function load_pic_series($series, $pic)
  3. {
  4. $seriesPicService = $this->getContainer()->get('pumukitschema.seriespic');
  5. $originalPicPath = realpath(dirname(__FILE__).'/../Resources/public/images/'.$pic.'.jpg');

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Alfro
  6. $picPath = realpath(dirname(__FILE__).'/../Resources/public/images').'/pic'.$pic.'.jpg';
  7. if (copy($originalPicPath, $picPath)) {
  8. $picFile = new UploadedFile($picPath, 'pic'.$pic.'.png', null, null, null, true);
  9. $series = $seriesPicService->addPicFile($series, $picFile);
  10. }
  1. private function load_pic_series($series, $pic)
  2. {
  3. $seriesPicService = $this->getContainer()->get('pumukitschema.seriespic');
  4. $originalPicPath = realpath(dirname(__FILE__).'/../Resources/public/images/'.$pic.'.jpg');
  5. $picPath = realpath(dirname(__FILE__).'/../Resources/public/images').'/pic'.$pic.'.jpg';

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Alfro
  6. if (copy($originalPicPath, $picPath)) {
  7. $picFile = new UploadedFile($picPath, 'pic'.$pic.'.png', null, null, null, true);
  8. $series = $seriesPicService->addPicFile($series, $picFile);
  9. }
  10. $dm = $this->getContainer()->get('doctrine_mongodb')->getManager();
  1. {
  2. $jobService = $this->getContainer()->get('pumukitencoder.job');
  3. $language = 'es';
  4. $description = array();
  5. if ($audio == true) {
  6. $path = realpath(dirname(__FILE__).'/../Resources/public/videos/'.$folder.'/'.$track.'.m4a');

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Alfro
  7. $jobService->createTrackWithFile($path, 'master_copy', $multimediaObject, $language, $description);
  8. $jobService->createTrackWithFile($path, 'audio_aac', $multimediaObject, $language, $description);
  9. } else {
  10. $path = realpath(dirname(__FILE__).'/../Resources/public/videos/'.$folder.'/'.$track.'.mp4');
  11. $jobService->createTrackWithFile($path, 'master_copy', $multimediaObject, $language, $description);
  1. if ($audio == true) {
  2. $path = realpath(dirname(__FILE__).'/../Resources/public/videos/'.$folder.'/'.$track.'.m4a');
  3. $jobService->createTrackWithFile($path, 'master_copy', $multimediaObject, $language, $description);
  4. $jobService->createTrackWithFile($path, 'audio_aac', $multimediaObject, $language, $description);
  5. } else {
  6. $path = realpath(dirname(__FILE__).'/../Resources/public/videos/'.$folder.'/'.$track.'.mp4');

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Alfro
  7. $jobService->createTrackWithFile($path, 'master_copy', $multimediaObject, $language, $description);
  8. $jobService->createTrackWithFile($path, 'video_h264', $multimediaObject, $language, $description);
  9. }
  10. }
  1. }
  2. private function load_pic_multimediaobject($multimediaObject, $pic)
  3. {
  4. $mmsPicService = $this->getContainer()->get('pumukitschema.mmspic');
  5. $originalPicPath = realpath(dirname(__FILE__).'/../Resources/public/images/'.$pic.'.jpg');

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Alfro
  6. $picPath = realpath(dirname(__FILE__).'/../Resources/public/images').'/pic'.$pic.'.jpg';
  7. if (copy($originalPicPath, $picPath)) {
  8. $picFile = new UploadedFile($picPath, 'pic'.$pic.'.png', null, null, null, true);
  9. $multimediaObject = $mmsPicService->addPicFile($multimediaObject, $picFile);
  10. }
  1. private function load_pic_multimediaobject($multimediaObject, $pic)
  2. {
  3. $mmsPicService = $this->getContainer()->get('pumukitschema.mmspic');
  4. $originalPicPath = realpath(dirname(__FILE__).'/../Resources/public/images/'.$pic.'.jpg');
  5. $picPath = realpath(dirname(__FILE__).'/../Resources/public/images').'/pic'.$pic.'.jpg';

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Alfro
  6. if (copy($originalPicPath, $picPath)) {
  7. $picFile = new UploadedFile($picPath, 'pic'.$pic.'.png', null, null, null, true);
  8. $multimediaObject = $mmsPicService->addPicFile($multimediaObject, $picFile);
  9. }
  10. $dm = $this->getContainer()->get('doctrine_mongodb')->getManager();
  1. protected function executeTags(InputInterface $input, OutputInterface $output)
  2. {
  3. $this->tagsRepo = $this->dm->getRepository('PumukitSchemaBundle:Tag');
  4. $finder = new Finder();
  5. $finder->files()->in(__DIR__.'/'.$this->tagsPath);

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by mrey
  6. $file = $input->getArgument('file');
  7. if ((0 == strcmp($file, '')) && (!$finder)) {
  8. $output->writeln("<error>Tags: There's no data to initialize</error>");
  9. return -1;
  1. protected function executeTags(InputInterface $input, OutputInterface $output, $force = true)
  2. {
  3. $this->tagsRepo = $this->dm->getRepository('PumukitSchemaBundle:Tag');
  4. $finder = new Finder();
  5. $finder->files()->in(__DIR__.'/'.$this->tagsPath);

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Mercedes Rey
  6. $file = $input->getArgument('file');
  7. if ((0 == strcmp($file, '')) && (!$finder)) {
  8. $output->writeln("<error>Tags: There's no data to initialize</error>");
  9. return -1;
  1. protected function executeRoles(InputInterface $input, OutputInterface $output)
  2. {
  3. $this->rolesRepo = $this->dm->getRepository('PumukitSchemaBundle:Role');
  4. $finder = new Finder();
  5. $finder->files()->in(__DIR__.'/'.$this->rolesPath);

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Mercedes Rey
  6. $file = $input->getArgument('file');
  7. if ((0 == strcmp($file, '')) && (!$finder)) {
  8. $output->writeln("<error>Roles: There's no data to initialize</error>");
  9. return -1;
  1. }
  2. protected function executePermissionProfiles(InputInterface $input, OutputInterface $output)
  3. {
  4. $finder = new Finder();
  5. $finder->files()->in(__DIR__.'/'.$this->permissionProfilesPath);

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by mrey
  6. $file = $input->getArgument('file');
  7. if ((0 == strcmp($file, '')) && (!$finder)) {
  8. $output->writeln("<error>PermissionProfiles: There's no data to initialize</error>");
  9. return -1;
  1. {
  2. $this->dm = $documentManager;
  3. $this->mmsPicService = $mmsPicService;
  4. $this->picExtractorService = $picExtractorService;
  5. $this->logger = $logger;
  6. $this->resourcesDir = realpath(__DIR__.'/../Resources/public/images');

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. $this->defaultAudioPic = realpath($this->resourcesDir.'/sound_bn.png');
  8. $this->audioPicCopy = $this->resourcesDir.'/sound_bn_copy.png';
  9. $this->defaultAudioPicOriginalName = 'sound_bn.png';
  10. $this->autoExtractPic = $autoExtractPic;
  11. }

Source code should not contain FIXME comments 2

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/task_fixme_comment

  1. $formMeta = $this->createForm(new MultimediaObjectTemplateMetaType($translator, $locale), $mmtemplate);
  2. $pubDecisionsTags = $factoryService->getTagsByCod('PUBDECISIONS', true);
  3. //These fields are form fields that are rendered separately, so they should be 'excluded' from the generic foreach.
  4. //FIXME: There is a cleaner approach FOR SURE.

    FIXME comments are left in the code when a bug has been noticed but not fixed. You should fix the bug and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Alfro
  5. $exclude_fields = array();
  6. $show_later_fields = array('pumukitnewadmin_series_i18n_header', 'pumukitnewadmin_series_i18n_footer', 'pumukitnewadmin_series_i18n_line2', 'pumukitnewadmin_series_template', 'pumukitnewadmin_series_sorting', 'pumukitnewadmin_series_series_style');
  7. $showSeriesTypeTab = $this->container->hasParameter('pumukit2.use_series_channels') && $this->container->getParameter('pumukit2.use_series_channels');
  8. if (!$showSeriesTypeTab) {
  9. $exclude_fields[] = 'pumukitnewadmin_series_series_type';
  1. */
  2. public function getMultimediaObjectWithTag(Tag $tag)
  3. {
  4. foreach ($this->multimedia_objects as $mmo) {
  5. //if ($mmo->tags->contains($tag)) {
  6. //FIXME no pasa el test phpunit cuando se llama desde seriestest

    FIXME comments are left in the code when a bug has been noticed but not fixed. You should fix the bug and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Alfro
  7. if ($mmo->containsTag($tag)) {
  8. return $mmo;
  9. }
  10. }

Logical operators should be avoided 39

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.boolean_statement

  1. {
  2. $dm = $this->container->get('doctrine_mongodb')->getManager();
  3. $nextSession = $dm->getRepository('PumukitSchemaBundle:MultimediaObject')->findNextEventSessions($multimediaObject->getId());
  4. $nowSessions = $dm->getRepository('PumukitSchemaBundle:MultimediaObject')->findNowEventSessions($multimediaObject->getId());
  5. if (count($nextSession) > 0 or count($nowSessions) > 0) {

    The or operator does not have the same precedence as ||. This could lead to unexpected behavior, use || instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. $translator = $this->get('translator');
  7. $this->updateBreadcrumbs($translator->trans('Live events'), 'pumukit_webtv_events');
  8. return $this->iframeEventAction($multimediaObject, $request, false);
  9. } else {
  1. $form = $this->createForm(new ContactType($translator, $locale));
  2. $activeContact = false;
  3. $captchaPublicKey = '';
  4. if ($this->container->hasParameter('liveevent_contact_and_share') and $this->container->getParameter('liveevent_contact_and_share')) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  5. $captchaPublicKey = $this->container->getParameter('captcha_public_key');
  6. $activeContact = true;
  7. }
  8. $nowSessions = $dm->getRepository('PumukitSchemaBundle:MultimediaObject')->findNowEventSessions($multimediaObject->getId());
  1. $nextSessions = $dm->getRepository('PumukitSchemaBundle:MultimediaObject')->findNextEventSessions($multimediaObject->getId());
  2. $date = new \DateTime();
  3. $firstNextSession = '';
  4. foreach ($multimediaObject->getEmbeddedEvent()->getEmbeddedEventSession() as $session) {
  5. if ($session->getStart() < $date and $session->getEnds() > $date) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. $firstNextSession = $session->getStart()->getTimestamp() * 1000;
  7. break;
  8. } elseif ($session->getStart() > $date) {
  9. $firstNextSession = $session->getStart()->getTimestamp() * 1000;
  10. break;
  1. $criteria['_id'] = new \MongoId($data['name']);
  2. } else {
  3. $criteria['embeddedEvent.name.'.$request->getLocale()] = new \MongoRegex('/'.$data['name'].'/i');
  4. }
  5. }
  6. if ($data['date']['from'] and $data['date']['to']) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $start = strtotime($data['date']['from']);
  8. $ends = strtotime($data['date']['to'].'23:59:59');
  9. $criteria['embeddedEvent.embeddedEventSession'] = array('$elemMatch' => array(
  10. 'start' => array(
  1. $adapter = new ArrayAdapter($multimediaObjects);
  2. $mms = new Pagerfanta($adapter);
  3. $mms->setMaxPerPage(10)->setNormalizeOutOfRangePages(true);
  4. if (($mms->getNbPages() < $mms->getCurrentPage()) or ($mms->getNbPages() < $session->get('admin/live/event/page'))) {

    The or operator does not have the same precedence as ||. This could lead to unexpected behavior, use || instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  5. $mms->setCurrentPage(1);
  6. } else {
  7. $mms->setCurrentPage($page);
  8. }
  1. if ($request->request->get('field')) {
  2. $field = $request->request->get('field');
  3. if ('embeddedEvent.name' === $request->request->get('field')) {
  4. $field = 'embeddedEvent.name.'.$request->getLocale();
  5. }
  6. if ($session->has('admin/live/event/sort/field') and $session->get('admin/live/event/sort/field') === $field) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $session->set('admin/live/event/sort/type', (($session->get('admin/live/event/sort/type') == 'desc') ? 'asc' : 'desc'));
  8. } else {
  9. $session->set('admin/live/event/sort/type', 'desc');
  10. }
  1. {
  2. $session = $this->get('session');
  3. $page = $session->get('admin/unesco/page', 1);
  4. $maxPerPage = $session->get('admin/unesco/paginate', 10);
  5. if (isset($tag) or $session->has('admin/unesco/tag')) {

    The or operator does not have the same precedence as ||. This could lead to unexpected behavior, use || instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. $tag = (isset($tag) ? $tag : $session->get('admin/unesco/tag'));
  7. }
  8. if ($session->has('UNESCO/criteria')) {
  9. $multimediaObjects = $this->searchMultimediaObjects($session->get('UNESCO/criteria'), $tag);
  10. } elseif ($tag) {
  1. $newCriteria = array();
  2. $tag = array();
  3. if ($criteria) {
  4. foreach ($criteria as $key => $value) {
  5. if (('id' === $key) and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. $newCriteria['_id'] = new \MongoId($value);
  7. $formBasic = true;
  8. } elseif (('seriesID' === $key) and !empty($value)) {
  9. $newCriteria['series'] = new \MongoId($value);
  10. $formBasic = true;
  1. if ($criteria) {
  2. foreach ($criteria as $key => $value) {
  3. if (('id' === $key) and !empty($value)) {
  4. $newCriteria['_id'] = new \MongoId($value);
  5. $formBasic = true;
  6. } elseif (('seriesID' === $key) and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $newCriteria['series'] = new \MongoId($value);
  8. $formBasic = true;
  9. } elseif ('type' === $key and !empty($value)) {
  10. if ('all' !== $value) {
  11. $newCriteria['type'] = intval($value);
  1. $newCriteria['_id'] = new \MongoId($value);
  2. $formBasic = true;
  3. } elseif (('seriesID' === $key) and !empty($value)) {
  4. $newCriteria['series'] = new \MongoId($value);
  5. $formBasic = true;
  6. } elseif ('type' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. if ('all' !== $value) {
  8. $newCriteria['type'] = intval($value);
  9. $formBasic = true;
  10. }
  11. } elseif ('duration' === $key and !empty($value)) {
  1. } elseif ('type' === $key and !empty($value)) {
  2. if ('all' !== $value) {
  3. $newCriteria['type'] = intval($value);
  4. $formBasic = true;
  5. }
  6. } elseif ('duration' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $newCriteria['tracks.duration'] = $value;
  8. $formBasic = true;
  9. } elseif ('year' === $key and !empty($value)) {
  10. $newCriteria['year'] = $value;
  11. $formBasic = true;
  1. $formBasic = true;
  2. }
  3. } elseif ('duration' === $key and !empty($value)) {
  4. $newCriteria['tracks.duration'] = $value;
  5. $formBasic = true;
  6. } elseif ('year' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $newCriteria['year'] = $value;
  8. $formBasic = true;
  9. } elseif ('text' === $key and !empty($value)) {
  10. $newCriteria['$text'] = $value;
  11. $formBasic = true;
  1. $newCriteria['tracks.duration'] = $value;
  2. $formBasic = true;
  3. } elseif ('year' === $key and !empty($value)) {
  4. $newCriteria['year'] = $value;
  5. $formBasic = true;
  6. } elseif ('text' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $newCriteria['$text'] = $value;
  8. $formBasic = true;
  9. } elseif ('broadcast' === $key and !empty($value)) {
  10. if ('all' !== $value) {
  11. $newCriteria['embeddedBroadcast.type'] = $value;
  1. $newCriteria['year'] = $value;
  2. $formBasic = true;
  3. } elseif ('text' === $key and !empty($value)) {
  4. $newCriteria['$text'] = $value;
  5. $formBasic = true;
  6. } elseif ('broadcast' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. if ('all' !== $value) {
  8. $newCriteria['embeddedBroadcast.type'] = $value;
  9. }
  10. } elseif ('statusPub' === $key) {
  11. if ('-1' !== $value) {
  1. }
  2. } elseif ('statusPub' === $key) {
  3. if ('-1' !== $value) {
  4. $newCriteria['status'] = intval($value);
  5. }
  6. } elseif ('announce' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $tag[] = 'PUDENEW';
  8. } elseif ('puderadio' === $key and !empty($value)) {
  9. $tag[] = 'PUDERADIO';
  10. } elseif ('pudetv' === $key and !empty($value)) {
  11. $tag[] = 'PUDETV';
  1. if ('-1' !== $value) {
  2. $newCriteria['status'] = intval($value);
  3. }
  4. } elseif ('announce' === $key and !empty($value)) {
  5. $tag[] = 'PUDENEW';
  6. } elseif ('puderadio' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $tag[] = 'PUDERADIO';
  8. } elseif ('pudetv' === $key and !empty($value)) {
  9. $tag[] = 'PUDETV';
  10. } elseif ('genre' === $key and !empty($value)) {
  11. $tag[] = $value;
  1. }
  2. } elseif ('announce' === $key and !empty($value)) {
  3. $tag[] = 'PUDENEW';
  4. } elseif ('puderadio' === $key and !empty($value)) {
  5. $tag[] = 'PUDERADIO';
  6. } elseif ('pudetv' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $tag[] = 'PUDETV';
  8. } elseif ('genre' === $key and !empty($value)) {
  9. $tag[] = $value;
  10. } elseif ('roles' === $key) {
  11. foreach ($value as $key2 => $field) {
  1. $tag[] = 'PUDENEW';
  2. } elseif ('puderadio' === $key and !empty($value)) {
  3. $tag[] = 'PUDERADIO';
  4. } elseif ('pudetv' === $key and !empty($value)) {
  5. $tag[] = 'PUDETV';
  6. } elseif ('genre' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $tag[] = $value;
  8. } elseif ('roles' === $key) {
  9. foreach ($value as $key2 => $field) {
  10. if (!empty($field)) {
  11. $newCriteria['roles'][$key2] = new \MongoRegex('/.*'.$field.'.*/i');
  1. }
  2. } elseif (in_array(
  3. $key,
  4. array('initPublicDate', 'finishPublicDate', 'initRecordDate', 'finishRecordDate')
  5. )) {
  6. if ('initPublicDate' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $newCriteria['public_date_init'] = $value;
  8. } elseif ('finishPublicDate' === $key and !empty($value)) {
  9. $newCriteria['public_date_finish'] = $value;
  10. } elseif ('initRecordDate' === $key and !empty($value)) {
  11. $newCriteria['record_date_init'] = $value;
  1. $key,
  2. array('initPublicDate', 'finishPublicDate', 'initRecordDate', 'finishRecordDate')
  3. )) {
  4. if ('initPublicDate' === $key and !empty($value)) {
  5. $newCriteria['public_date_init'] = $value;
  6. } elseif ('finishPublicDate' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $newCriteria['public_date_finish'] = $value;
  8. } elseif ('initRecordDate' === $key and !empty($value)) {
  9. $newCriteria['record_date_init'] = $value;
  10. } elseif ('finishRecordDate' === $key and !empty($value)) {
  11. $newCriteria['record_date_finish'] = $value;
  1. )) {
  2. if ('initPublicDate' === $key and !empty($value)) {
  3. $newCriteria['public_date_init'] = $value;
  4. } elseif ('finishPublicDate' === $key and !empty($value)) {
  5. $newCriteria['public_date_finish'] = $value;
  6. } elseif ('initRecordDate' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $newCriteria['record_date_init'] = $value;
  8. } elseif ('finishRecordDate' === $key and !empty($value)) {
  9. $newCriteria['record_date_finish'] = $value;
  10. }
  11. } elseif (!empty($value)) {
  1. $newCriteria['public_date_init'] = $value;
  2. } elseif ('finishPublicDate' === $key and !empty($value)) {
  3. $newCriteria['public_date_finish'] = $value;
  4. } elseif ('initRecordDate' === $key and !empty($value)) {
  5. $newCriteria['record_date_init'] = $value;
  6. } elseif ('finishRecordDate' === $key and !empty($value)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $newCriteria['record_date_finish'] = $value;
  8. }
  9. } elseif (!empty($value)) {
  10. $newCriteria[$key.'.'.$request->getLocale()] = new \MongoRegex('/.*'.$value.'.*/i');
  11. }
  1. $dm = $this->container->get('doctrine_mongodb')->getManager();
  2. $session = $this->get('session');
  3. $session->set('admin/unesco/tag', $tag);
  4. $tagCondition = $tag;
  5. if (isset($tag) and !in_array($tag, array('1', '2'))) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. $tagCondition = (strtoupper(substr($tag, 0, 1)));
  7. }
  8. switch ($tagCondition) {
  9. case '1':
  1. default:
  2. $query = $dm->getRepository('PumukitSchemaBundle:MultimediaObject')->createStandardQueryBuilder();
  3. break;
  4. }
  5. if (isset($criteria) and !empty($criteria)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. $query = $this->addCriteria($query, $criteria);
  7. }
  8. return $query;
  9. }
  1. private function addCriteria($query, $criteria)
  2. {
  3. $request = $this->get('request_stack')->getMasterRequest();
  4. foreach ($criteria as $key => $field) {
  5. if ('roles' === $key and count($field) >= 1) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. foreach ($field as $key2 => $value) {
  7. $query->field('people')->elemMatch($query->expr()->field('cod')->equals($key2)->field('people.name')->equals($value));
  8. }
  9. } elseif ('public_date_init' === $key and !empty($field)) {
  10. $public_date_init = $field;
  1. foreach ($criteria as $key => $field) {
  2. if ('roles' === $key and count($field) >= 1) {
  3. foreach ($field as $key2 => $value) {
  4. $query->field('people')->elemMatch($query->expr()->field('cod')->equals($key2)->field('people.name')->equals($value));
  5. }
  6. } elseif ('public_date_init' === $key and !empty($field)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $public_date_init = $field;
  8. } elseif ('public_date_finish' === $key and !empty($field)) {
  9. $public_date_finish = $field;
  10. } elseif ('record_date_init' === $key and !empty($field)) {
  11. $record_date_init = $field;
  1. foreach ($field as $key2 => $value) {
  2. $query->field('people')->elemMatch($query->expr()->field('cod')->equals($key2)->field('people.name')->equals($value));
  3. }
  4. } elseif ('public_date_init' === $key and !empty($field)) {
  5. $public_date_init = $field;
  6. } elseif ('public_date_finish' === $key and !empty($field)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $public_date_finish = $field;
  8. } elseif ('record_date_init' === $key and !empty($field)) {
  9. $record_date_init = $field;
  10. } elseif ('record_date_finish' === $key and !empty($field)) {
  11. $record_date_finish = $field;
  1. }
  2. } elseif ('public_date_init' === $key and !empty($field)) {
  3. $public_date_init = $field;
  4. } elseif ('public_date_finish' === $key and !empty($field)) {
  5. $public_date_finish = $field;
  6. } elseif ('record_date_init' === $key and !empty($field)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $record_date_init = $field;
  8. } elseif ('record_date_finish' === $key and !empty($field)) {
  9. $record_date_finish = $field;
  10. } elseif ('$text' === $key and !empty($field)) {
  11. $this->get('pumukitnewadmin.multimedia_object_search')
  1. $public_date_init = $field;
  2. } elseif ('public_date_finish' === $key and !empty($field)) {
  3. $public_date_finish = $field;
  4. } elseif ('record_date_init' === $key and !empty($field)) {
  5. $record_date_init = $field;
  6. } elseif ('record_date_finish' === $key and !empty($field)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $record_date_finish = $field;
  8. } elseif ('$text' === $key and !empty($field)) {
  9. $this->get('pumukitnewadmin.multimedia_object_search')
  10. ->completeSearchQueryBuilder($field, $query, $request->getLocale());
  11. } elseif ('type' === $key and !empty($field)) {
  1. $public_date_finish = $field;
  2. } elseif ('record_date_init' === $key and !empty($field)) {
  3. $record_date_init = $field;
  4. } elseif ('record_date_finish' === $key and !empty($field)) {
  5. $record_date_finish = $field;
  6. } elseif ('$text' === $key and !empty($field)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $this->get('pumukitnewadmin.multimedia_object_search')
  8. ->completeSearchQueryBuilder($field, $query, $request->getLocale());
  9. } elseif ('type' === $key and !empty($field)) {
  10. if ('all' !== $field) {
  11. $query->field('type')->equals($field);
  1. } elseif ('record_date_finish' === $key and !empty($field)) {
  2. $record_date_finish = $field;
  3. } elseif ('$text' === $key and !empty($field)) {
  4. $this->get('pumukitnewadmin.multimedia_object_search')
  5. ->completeSearchQueryBuilder($field, $query, $request->getLocale());
  6. } elseif ('type' === $key and !empty($field)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. if ('all' !== $field) {
  8. $query->field('type')->equals($field);
  9. }
  10. } elseif ('tracks.duration' == $key and !empty($field)) {
  11. $query = $this->findDuration($query, $key, $field);
  1. ->completeSearchQueryBuilder($field, $query, $request->getLocale());
  2. } elseif ('type' === $key and !empty($field)) {
  3. if ('all' !== $field) {
  4. $query->field('type')->equals($field);
  5. }
  6. } elseif ('tracks.duration' == $key and !empty($field)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $query = $this->findDuration($query, $key, $field);
  8. } elseif ('year' === $key and !empty($field)) {
  9. $query = $this->findDuration($query, 'year', $field);
  10. } else {
  11. $query->field($key)->equals($field);
  1. if ('all' !== $field) {
  2. $query->field('type')->equals($field);
  3. }
  4. } elseif ('tracks.duration' == $key and !empty($field)) {
  5. $query = $this->findDuration($query, $key, $field);
  6. } elseif ('year' === $key and !empty($field)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $query = $this->findDuration($query, 'year', $field);
  8. } else {
  9. $query->field($key)->equals($field);
  10. }
  11. }
  1. } else {
  2. $query->field($key)->equals($field);
  3. }
  4. }
  5. if (isset($public_date_init) and isset($public_date_finish)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. $query->field('public_date')->range(
  7. new \MongoDate(strtotime($public_date_init)),
  8. new \MongoDate(strtotime($public_date_finish))
  9. );
  10. } elseif (isset($public_date_init) and !empty($public_date_init)) {
  1. if (isset($public_date_init) and isset($public_date_finish)) {
  2. $query->field('public_date')->range(
  3. new \MongoDate(strtotime($public_date_init)),
  4. new \MongoDate(strtotime($public_date_finish))
  5. );
  6. } elseif (isset($public_date_init) and !empty($public_date_init)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $date = date($public_date_init.'T23:59:59');
  8. $query->field('public_date')->range(
  9. new \MongoDate(strtotime($public_date_init)),
  10. new \MongoDate(strtotime($date))
  11. );
  1. $date = date($public_date_init.'T23:59:59');
  2. $query->field('public_date')->range(
  3. new \MongoDate(strtotime($public_date_init)),
  4. new \MongoDate(strtotime($date))
  5. );
  6. } elseif (isset($public_date_finish) and !empty($public_date_finish)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $date = date($public_date_finish.'T23:59:59');
  8. $query->field('public_date')->range(
  9. new \MongoDate(strtotime($public_date_finish)),
  10. new \MongoDate(strtotime($date))
  11. );
  1. new \MongoDate(strtotime($public_date_finish)),
  2. new \MongoDate(strtotime($date))
  3. );
  4. }
  5. if (isset($record_date_init) and isset($record_date_finish)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. $query->field('record_date')->range(
  7. new \MongoDate(strtotime($record_date_init)),
  8. new \MongoDate(strtotime($record_date_finish))
  9. );
  10. } elseif (isset($record_date_init)) {
  1. foreach ($event->getEmbeddedEventSession() as $session) {
  2. $sessionStart = clone $session->getStart();
  3. $sessionEnds = $sessionStart->add(new \DateInterval('PT'.$session->getDuration().'S'));
  4. if ($session->getStart()->getTimestamp() > $now) {
  5. $aSessions[$session->getStart()->getTimestamp()][] = $session;
  6. } elseif (($session->getStart()->getTimestamp() < $now) and ($sessionEnds->getTimestamp() > $now)) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  7. $aSessions[$session->getStart()->getTimestamp()][] = $session;
  8. }
  9. }
  10. if (!empty($aSessions)) {
  11. ksort($aSessions);
  1. return self::$menuResponse;
  2. }
  3. protected function getMenuParameters()
  4. {
  5. if ($this->container->hasParameter('pumukit_new_admin.advance_live_event') and $this->container->getParameter('pumukit_new_admin.advance_live_event')) {

    The and operator does not have the same precedence as &&. This could lead to unexpected behavior, use && instead.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by pogando
  6. $dm = $this->container->get('doctrine_mongodb')->getManager();
  7. $events = $dm->getRepository('PumukitSchemaBundle:MultimediaObject')->findEventsMenu();
  8. $menuEvents = array();
  9. $nowOrFuture = false;
  10. foreach ($events as $event) {

PHP super globals should never be used 12

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.use_super_globals

  1. * @Template("PumukitNewAdminBundle:Pic:upload_event.html.twig")
  2. */
  3. public function uploadAction(Event $event, Request $request)
  4. {
  5. try {
  6. if (empty($_FILES) && empty($_POST)) {

    $_FILES super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  8. }
  9. if ($request->files->has('file')) {
  10. $picService = $this->get('pumukitlive.eventpic');
  11. $media = $picService->addPicFile($event, $request->files->get('file'));
  1. * @Template("PumukitNewAdminBundle:Pic:upload_event.html.twig")
  2. */
  3. public function uploadAction(Event $event, Request $request)
  4. {
  5. try {
  6. if (empty($_FILES) && empty($_POST)) {

    $_POST super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  8. }
  9. if ($request->files->has('file')) {
  10. $picService = $this->get('pumukitlive.eventpic');
  11. $media = $picService->addPicFile($event, $request->files->get('file'));
  1. {
  2. $formData = $request->get('pumukitnewadmin_material', array());
  3. $materialService = $this->get('pumukitschema.material');
  4. try {
  5. if (empty($_FILES) && empty($_POST)) {

    $_FILES super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  6. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  7. }
  8. if (($request->files->has('file')) && (!$request->get('url', null))) {
  9. $multimediaObject = $materialService->addMaterialFile($multimediaObject, $request->files->get('file'), $formData);
  10. } elseif ($request->get('url', null)) {
  1. {
  2. $formData = $request->get('pumukitnewadmin_material', array());
  3. $materialService = $this->get('pumukitschema.material');
  4. try {
  5. if (empty($_FILES) && empty($_POST)) {

    $_POST super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  6. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  7. }
  8. if (($request->files->has('file')) && (!$request->get('url', null))) {
  9. $multimediaObject = $materialService->addMaterialFile($multimediaObject, $request->files->get('file'), $formData);
  10. } elseif ($request->get('url', null)) {
  1. * @Template("PumukitNewAdminBundle:Pic:upload.html.twig")
  2. */
  3. public function uploadAction(MultimediaObject $multimediaObject, Request $request)
  4. {
  5. try {
  6. if (empty($_FILES) && empty($_POST)) {

    $_FILES super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  8. }
  9. if ($request->files->has('file')) {
  10. $picService = $this->get('pumukitschema.mmspic');
  11. $media = $picService->addPicFile($multimediaObject, $request->files->get('file'));
  1. * @Template("PumukitNewAdminBundle:Pic:upload.html.twig")
  2. */
  3. public function uploadAction(MultimediaObject $multimediaObject, Request $request)
  4. {
  5. try {
  6. if (empty($_FILES) && empty($_POST)) {

    $_POST super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  8. }
  9. if ($request->files->has('file')) {
  10. $picService = $this->get('pumukitschema.mmspic');
  11. $media = $picService->addPicFile($multimediaObject, $request->files->get('file'));
  1. */
  2. public function uploadAction(Series $playlist, Request $request)
  3. {
  4. $isBanner = false;
  5. try {
  6. if (empty($_FILES) && empty($_POST)) {

    $_POST super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  8. }
  9. if ($request->files->has('file')) {
  10. $picService = $this->get('pumukitschema.seriespic');
  11. $isBanner = $request->query->get('banner', false);
  1. */
  2. public function uploadAction(Series $playlist, Request $request)
  3. {
  4. $isBanner = false;
  5. try {
  6. if (empty($_FILES) && empty($_POST)) {

    $_FILES super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  8. }
  9. if ($request->files->has('file')) {
  10. $picService = $this->get('pumukitschema.seriespic');
  11. $isBanner = $request->query->get('banner', false);
  1. */
  2. public function uploadAction(Series $series, Request $request)
  3. {
  4. $isBanner = false;
  5. try {
  6. if (empty($_FILES) && empty($_POST)) {

    $_FILES super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  8. }
  9. if ($request->files->has('file')) {
  10. $picService = $this->get('pumukitschema.seriespic');
  11. $isBanner = $request->query->get('banner', false);
  1. */
  2. public function uploadAction(Series $series, Request $request)
  3. {
  4. $isBanner = false;
  5. try {
  6. if (empty($_FILES) && empty($_POST)) {

    $_POST super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  8. }
  9. if ($request->files->has('file')) {
  10. $picService = $this->get('pumukitschema.seriespic');
  11. $isBanner = $request->query->get('banner', false);
  1. list($language, $description) = $this->getArrayData($formData);
  2. $jobService = $this->get('pumukitencoder.job');
  3. try {
  4. if (empty($_FILES) && empty($_POST)) {

    $_POST super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  5. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  6. }
  7. if (($request->files->has('resource')) && ('file' == $request->get('file_type'))) {
  8. $multimediaObject = $jobService->createTrackFromLocalHardDrive($multimediaObject, $request->files->get('resource'), $profile, $priority, $language, $description);
  9. } elseif (($request->get('file', null)) && ('inbox' == $request->get('file_type'))) {
  1. list($language, $description) = $this->getArrayData($formData);
  2. $jobService = $this->get('pumukitencoder.job');
  3. try {
  4. if (empty($_FILES) && empty($_POST)) {

    $_FILES super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by rubenrua
  5. throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
  6. }
  7. if (($request->files->has('resource')) && ('file' == $request->get('file_type'))) {
  8. $multimediaObject = $jobService->createTrackFromLocalHardDrive($multimediaObject, $request->files->get('resource'), $profile, $priority, $language, $description);
  9. } elseif (($request->get('file', null)) && ('inbox' == $request->get('file_type'))) {

The EntityManager should not be flushed within a loop 5

  • Major
  • Performance

More information: https://insight.sensiolabs.com/what-we-analyse/doctrine.use_flush_in_loop

  1. $message = '[checkService] Job executing for a long time, set status to ERROR ';
  2. $job->appendOutput($message);
  3. $this->logger->error(
  4. $message.$job->getId()
  5. );
  6. $this->dm->flush();

    Calling flush is a resource intensive operation, especially when a lot of entities are managed by Doctrine. You should avoid flushing inside a loop.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by pogando
  7. }
  8. }
  9. }
  10. /**
  1. if (!$mmobj) {
  2. continue;
  3. }
  4. $playlist->getPlaylist()->addMultimediaObject($mmobj);
  5. $dm->persist($playlist);
  6. $dm->flush();

    Calling flush is a resource intensive operation, especially when a lot of entities are managed by Doctrine. You should avoid flushing inside a loop.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Alfro
  7. }
  8. return $this->redirect($this->generateUrl('pumukitnewadmin_playlistmms_list', array('id' => $playlist->getId())));
  9. }
  1. $this->isGranted(Permission::CHANGE_MMOBJECT_STATUS) &&
  2. $value['status'] != $mm->getStatus()
  3. ) {
  4. $mm->setStatus($value['status']);
  5. $dm->persist($mm);
  6. $dm->flush();

    Calling flush is a resource intensive operation, especially when a lot of entities are managed by Doctrine. You should avoid flushing inside a loop.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  7. }
  8. }
  9. }
  10. }
  1. foreach ($mms as $multimediaObject) {
  2. $output->writeln('Fixing '.$type.'_jobs of multimedia object '.$multimediaObject->getId());
  3. $multimediaObject->removeProperty($type.'_jobs');
  4. $this->dm->persist($multimediaObject);
  5. $this->dm->flush();

    Calling flush is a resource intensive operation, especially when a lot of entities are managed by Doctrine. You should avoid flushing inside a loop.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by rubenrua
  6. }
  7. }
  8. private function syncTags(InputInterface $input, OutputInterface $output)
  9. {
  1. $annotations = $annotRepo->findBy(array('multimediaObject' => new \MongoId($src->getId())));
  2. foreach ($annotations as $annot) {
  3. $clonedAnnot = clone $annot;
  4. $clonedAnnot->setMultimediaObject($new->getId());
  5. $this->dm->persist($clonedAnnot);
  6. $this->dm->flush(); //necessary?

    Calling flush is a resource intensive operation, especially when a lot of entities are managed by Doctrine. You should avoid flushing inside a loop.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  7. }
  8. if ($embeddedBroadcast = $src->getEmbeddedBroadcast()) {
  9. $clonedEmbeddedBroadcast = $this->embeddedBroadcastService->cloneResource($embeddedBroadcast);
  10. $new->setEmbeddedBroadcast($clonedEmbeddedBroadcast);

Symfony controller action method should not be too long

  • Major
  • Readability

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.controller.action_method_too_long

18% of all actions have more than 20 lines. This violation is raised when more than 10% actions are too long.

Time to fix: about 7 days
Open Issue Permalink
Collective

Symfony applications should not contain a config.php file

  • Major
  • Security

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.web_config_should_not_be_present

in web

This config.php file should only be used to bootstrap a Symfony application. Before releasing to production, you should remove it, otherwise attackers could get valuable insight about your application.

Time to fix: about 1 hour
Open Issue Permalink
Collective
  • web
    • images
    • swf
    • app.php
    • app_dev.php
    • config.php
    • favicon.ico
    • robots.txt

Template should not have too many variables

  • Minor
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.controller.too_many_template_variables

10% of all your templates have more than 6 variables, the threshold is 5%.

Collective

Occurences of the rule violations:

Source code should not contain TODO comments 153

  • Minor
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/task_todo_comment

  1. $job->setPathIni($pathFile);
  2. $job->setDuration($duration);
  3. $job->setPriority($priority);
  4. $job->setInitVars($initVars);
  5. if (null !== $language) {
  6. //TODO languageId is only language "es", "en", "gl"

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. $job->setLanguageId($language);
  8. }
  9. if (!empty($description)) {
  10. $job->setI18nDescription($description);
  11. }
  1. $this->propService->errorJob($multimediaObject, $job);
  2. // If the transco is disconnected or there is an authentication issue, we don't want to send more petitions to this transco.
  3. if ($e instanceof ExecutorException && 'prod' == $this->environment) {
  4. $cpuName = $job->getCpu();
  5. $this->cpuService->activateMaintenance($cpuName);
  6. //TODO: Refactor in a service and send email to sysadmin.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. }
  8. }
  9. $this->dm->persist($job);
  10. $this->dm->flush();
  1. $commandLine = $twig->render('bat', $vars);
  2. $this->logger->info('[renderBat] CommandLine: '.$commandLine);
  3. $cpu = $this->cpuService->getCpuByName($job->getCpu());
  4. if (CpuService::TYPE_WINDOWS === $cpu['type']) {
  5. //TODO - PATH UNIX TRANSCODER and PATH WIN TRANSCODER

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  6. }
  7. return $commandLine;
  8. }
  1. 'playlist' => $series,
  2. 'mms' => $mms,
  3. );
  4. }
  5. //TODO: This? Or getResources(like in PlaylistController?)

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  6. protected function getPlaylistMmobjs(Series $series, $request)
  7. {
  8. $mmsList = $series->getPlaylist()->getMultimediaObjects();
  9. $adapter = new DoctrineCollectionAdapter($mmsList);
  10. $pagerfanta = new Pagerfanta($adapter);
  1. }
  2. return $description;
  3. }
  4. //TODO: Pass to a SERVICE

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  5. private function countMmobjsByStatus($series)
  6. {
  7. if (isset($this->countMmobjsByStatus[$series->getId()])) {
  8. return $this->countMmobjsByStatus[$series->getId()];
  9. }
  1. return $this->countMmobjsByStatus[$series->getId()] = $result;
  2. return $result;
  3. }
  4. //TODO: Pass to a SERVICE

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  5. private function countMmobjsWithTag($series, $tagCod)
  6. {
  7. if (isset($this->countMmobjsWithTag[$series->getId()][$tagCod])) {
  8. return $this->countMmobjsWithTag[$series->getId()][$tagCod];
  9. }
  1. $personService = $this->get('pumukitschema.person');
  2. $person = $personService->findPersonById($request->get('id'));
  3. $personalScopeRoleCode = $personService->getPersonalScopeRoleCode();
  4. try {
  5. $multimediaObject = $personService->createRelationPerson($person, $role, $multimediaObject);
  6. // TODO Snackbars and toasts

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. //$message = sprintf($this->getContext()->getI18N()->__("Persona asociada correctamente a la plantilla con el rol \"%s\"."), $this->role->getName());
  8. //$msg_alert = array('info', $message);
  9. } catch (\Exception $e) {
  10. //$message = sprintf($this->getContext()->getI18N()->__("Persona ya asociada a la plantilla con el rol \"%s\"."), $this->role->getName());
  11. //$this->msg_alert = array('error', $message);
  1. $toDom = dom_import_simplexml($XMLmetadata);
  2. $fromDom = dom_import_simplexml($XMLoai_dc);
  3. $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true));
  4. }
  5. //TODO Delete using ResumptionToken

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  6. private function validateToken($resumptionToken)
  7. {
  8. if ($resumptionToken !== null) {
  9. $error = false;
  1. private function generatePic(MultimediaObject $multimediaObject, Track $track)
  2. {
  3. if ($multimediaObject->getPics()->isEmpty() && $this->autoExtractPic) {
  4. try {
  5. if ($multimediaObject->isOnlyAudio() || $track->isOnlyAudio()) {
  6. // TODO: Change return values when adding final default audio image

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by mrey
  7. //return $this->addDefaultAudioPic($multimediaObject, $track);
  8. return false;
  9. } else {
  10. return $this->generatePicFromVideo($multimediaObject, $track);
  11. }
  1. */
  2. public function picstoaddlistAction(MultimediaObject $multimediaObject, Request $request)
  3. {
  4. $picService = $this->get('pumukitschema.mmspic');
  5. // TODO search in picservice according to page (in criteria)

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by mrey
  6. if ($request->get('page', null)) {
  7. $this->get('session')->set('admin/mmspic/page', $request->get('page', 1));
  8. }
  9. $page = intval($this->get('session')->get('admin/mmspic/page', 1));
  10. $limit = 12;
  1. */
  2. public function picstoaddlistAction(Series $playlist, Request $request)
  3. {
  4. $picService = $this->get('pumukitschema.seriespic');
  5. // TODO search in picservice according to page (in criteria)

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  6. if ($request->get('page', null)) {
  7. $this->get('session')->set('admin/playlistpic/page', $request->get('page', 1));
  8. }
  9. $page = intval($this->get('session')->get('admin/playlistpic/page', 1));
  10. $limit = 12;
  1. */
  2. public function picstoaddlistAction(Series $series, Request $request)
  3. {
  4. $picService = $this->get('pumukitschema.seriespic');
  5. // TODO search in picservice according to page (in criteria)

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by mrey
  6. if ($request->get('page', null)) {
  7. $this->get('session')->set('admin/seriespic/page', $request->get('page', 1));
  8. }
  9. $page = intval($this->get('session')->get('admin/seriespic/page', 1));
  10. $limit = 12;
  1. 'reload_links' => $request->query->get('reload_links', false),
  2. );
  3. }
  4. /**
  5. * TODO See: Pumukit\EncoderBundle\Controller\InfoController::retryJobAction.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  6. *
  7. * @ParamConverter("multimediaObject", class="PumukitSchemaBundle:MultimediaObject", options={"id" = "mmId"})
  8. * @ParamConverter("job", class="PumukitEncoderBundle:Job", options={"id" = "jobId"})
  9. */
  10. public function retryJobAction(MultimediaObject $multimediaObject, Job $job, Request $request)
  1. return $this->redirect($this->generateUrl('pumukitnewadmin_track_list', array('id' => $multimediaObject->getId())));
  2. }
  3. /**
  4. * TODO See: Pumukit\EncoderBundle\Controller\InfoController::infoJobAction.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  5. *
  6. * @ParamConverter("multimediaObject", class="PumukitSchemaBundle:MultimediaObject", options={"id" = "mmId"})
  7. * @ParamConverter("job", class="PumukitEncoderBundle:Job", options={"id" = "jobId"})
  8. * @Template
  9. */
  1. return array('multimediaObject' => $multimediaObject, 'job' => $job, 'command' => $command);
  2. }
  3. /**
  4. * TODO See: Pumukit\EncoderBundle\Controller\InfoController::deleteJobAction.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  5. *
  6. * @ParamConverter("multimediaObject", class="PumukitSchemaBundle:MultimediaObject", options={"id" = "mmId"})
  7. */
  8. public function deleteJobAction(MultimediaObject $multimediaObject, Request $request)
  9. {
  1. return $this->redirect($this->generateUrl('pumukitnewadmin_track_list', array('id' => $multimediaObject->getId())));
  2. }
  3. /**
  4. * TODO See: Pumukit\EncoderBundle\Controller\InfoController::updateJobPriorityAction.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  5. */
  6. public function updateJobPriorityAction(Request $request)
  7. {
  8. $priority = $request->get('priority');
  9. $jobId = $request->get('jobId');
  1. self::SORT_PUB_ASC => array('public_date' => 'asc'),
  2. self::SORT_PUB_DES => array('public_date' => 'des'),
  3. self::SORT_REC_DES => array('record_date' => 'des'),
  4. self::SORT_REC_ASC => array('record_date' => 'asc'),
  5. self::SORT_ALPHAB => array('title.es' => 'asc'),
  6. //TODO culture

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by pogando
  7. );
  8. public static $sortText = array(
  9. self::SORT_MANUAL => 'manual',
  10. self::SORT_PUB_ASC => 'publication date ascending',
  1. public function getFilteredTracksWithTags(array $any_tags = array(), array $all_tags = array(), array $not_any_tags = array(), array $not_all_tags = array(), $all = true)
  2. {
  3. $r = array();
  4. foreach ($this->tracks as $track) {
  5. // TODO Move 'hide' field to tag 'hidden' in track (see hidden vs display tag)

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by pogando
  6. if ($track->getHide() && $all) {
  7. continue;
  8. }
  9. if ($any_tags && !$track->containsAnyTag($any_tags)) {
  10. continue;
  1. * @return Track|null
  2. */
  3. public function getFilteredTrackWithTags(array $any_tags = array(), array $all_tags = array(), array $not_any_tags = array(), array $not_all_tags = array(), $all = true)
  4. {
  5. foreach ($this->tracks as $track) {
  6. // TODO Move 'hide' field to tag 'hidden' in track (see hidden vs display tag)

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by pogando
  7. if ($track->getHide() && $all) {
  8. continue;
  9. }
  10. if ($any_tags && !$track->containsAnyTag($any_tags)) {
  11. continue;
  1. if (($job = $dm->find('PumukitEncoderBundle:Job', $id)) === null) {
  2. throw new \RuntimeException("Not job found with id $id.");
  3. }
  4. //TODO STATUS is executing when this command is executed. Must be waiting.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  5. /*
  6. if ((!$input->getOption('force')) && (JOB::STATUS_WAITING != $job->getStatus())) {
  7. throw new \RuntimeException("The job is not in the waiting state");
  8. }
  9. */
  1. if ((!$input->getOption('force')) && (JOB::STATUS_WAITING != $job->getStatus())) {
  2. throw new \RuntimeException("The job is not in the waiting state");
  3. }
  4. */
  5. //TODO Add log.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  6. $jobService->execute($job);
  7. }
  8. }
  1. * @Route("/annotations.{_format}", defaults={"_format"="json"}, requirements={"_format": "json|xml"})
  2. * @Method("GET")
  3. */
  4. public function getAction(Request $request)
  5. {
  6. //TODO: Do the annotation getting using a service function.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  7. //$opencastAnnotationService = $this->container->get('video_editor.opencast_annotations');
  8. $serializer = $this->get('serializer');
  9. $episode = $request->get('episode');
  10. $type = $request->get('type');
  1. $limit = $request->get('limit') ?: 10;
  2. $offset = $request->get('offset') ?: 0;
  3. $total = 10;
  4. //TODO: Do the annotation getting using a service function.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  5. //$resAnnotations = $opencastAnnotationService->getOpencastAnnotations();
  6. $resAnnotations = array();
  7. $annonRepo = $this->get('doctrine_mongodb')->getRepository('PumukitSchemaBundle:Annotation');
  8. $annonQB = $annonRepo->createQueryBuilder();
  1. * @Method("PUT")
  2. * @Security("has_role('ROLE_ACCESS_MULTIMEDIA_SERIES')")
  3. */
  4. public function createNewAction(Request $request)
  5. {
  6. //TODO: Do the annotation getting using a service function.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  7. //$opencastAnnotationService = $this->container->get('video_editor.opencast_annotations');
  8. $serializer = $this->get('serializer');
  9. //$annonRepo = $this->get('doctrine_mongodb')->getRepository('PumukitSchemaBundle:Annotation');
  10. $episode = $request->get('episode');
  1. $annotation->setOutPoint($outPoint);
  2. $annotation->setIsPrivate($isPrivate);
  3. $annotation->setLength(0); //This field is not very useful.
  4. $annotation->setCreated(new \DateTime());
  5. $userId = $this->getUser() ? $this->getUser()->getId() : 'anonymous';
  6. $annotation->setUserId($userId); //TODO: How do we get the user_id?

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  7. $session = new Session(); //Using symfony sessions instead of php session_id()
  8. $session = $session->getId();
  9. $annotation->setSession($session);
  10. $this->get('doctrine_mongodb.odm.document_manager')->persist($annotation);
  1. * @Method("PUT")
  2. * @Security("has_role('ROLE_ACCESS_MULTIMEDIA_SERIES')")
  3. */
  4. public function editAction(Annotation $annotation, Request $request)
  5. {
  6. //TODO: Do the annotation getting using a service function.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  7. //$opencastAnnotationService = $this->container->get('video_editor.opencast_annotations');
  8. $serializer = $this->get('serializer');
  9. $value = $request->get('value');
  10. $annotation->setValue($value);
  1. //$showSeries = false;
  2. /* if (('null' === $seriesId) || (null === $seriesId)) { */
  3. /* $showSeries = true; */
  4. /* } */
  5. // TODO Fragment this. Develop better way.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Mercedes Rey
  6. $option = $this->getKeyData('option', $typeData);
  7. try {
  8. if ('single' === $option) {
  9. $filetype = $this->getKeyData('filetype', $trackData);
  10. if ('file' === $filetype) {
  1. if ($multimediaObject) {
  2. $formDispatcher->dispatchSubmit($this->getUser(), $multimediaObject, $formData);
  3. try {
  4. $multimediaObject = $jobService->createTrackFromInboxOnServer($multimediaObject, $filePath, $profile, $priority, $language, $description);
  5. } catch (\Exception $e) {
  6. // TODO: filter invalid files another way

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Mercedes Rey
  7. if (!strpos($e->getMessage(), 'Unknown error')) {
  8. $this->removeInvalidMultimediaObject($multimediaObject, $series);
  9. throw $e;
  10. }
  11. }
  1. }
  2. }
  3. }
  4. }
  5. } catch (\Exception $e) {
  6. // TODO filter unknown errors

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Mercedes Rey
  7. $message = preg_replace("/\r|\n/", '', $e->getMessage());
  8. return array(
  9. 'uploaded' => 'failed',
  10. 'message' => $message,
  1. 'show_series' => $showSeries,
  2. 'same_series' => $sameSeries,
  3. );
  4. }
  5. } else {
  6. // TODO THROW EXCEPTION OR RENDER SPECIFIC TEMPLATE WITH MESSAGE

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Mercedes Rey
  7. return array(
  8. 'uploaded' => 'failed',
  9. 'message' => 'No data received',
  10. 'option' => null,
  11. 'seriesId' => $seriesId,
  1. }
  2. }
  3. }
  4. /**
  5. * TODO add doc.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  6. */
  7. private function generateJobs(MultimediaObject $multimediaObject, $pubChannelCod)
  8. {
  9. $jobs = array();
  10. $default_profiles = $this->profileService->getDefaultProfiles();
  1. 'aria-label' => $this->translator->trans('Password', array(), null, $this->locale),
  2. 'autocomplete' => 'off',
  3. ),
  4. 'required' => true,
  5. 'label' => $this->translator->trans('Password', array(), null, $this->locale), ))
  6. /* TODO check password

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Mercedes Rey
  7. ->add('plain_password', 'repeated', array(
  8. 'type' => 'password',
  9. 'options' => array('attr' => array('oninvalid' => "setCustomValidity('password-field')")),
  10. 'required' => false,
  11. 'invalid_message' => 'The password fields must match.',
  1. // End of find Series with Tags
  2. /**
  3. * Find distinct url pics in series.
  4. * TODO Limit and sort.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by pogando
  5. *
  6. * @param Series $series
  7. *
  8. * @return ArrayCollection
  9. */
  1. return $this->createStandardQueryBuilder()->field('series')->references($series)->distinct('pics.url')->getQuery()->execute();
  2. }
  3. /**
  4. * Find distinct url pics.
  5. * TODO Limit and sort.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by pogando
  6. *
  7. * @return ArrayCollection
  8. */
  9. public function findDistinctUrlPics()
  10. {
  1. return $qb->sort('rank', 1)->getQuery()->execute();
  2. }
  3. /**
  4. * Find by series, tag code and status.
  5. * TODO not needed (Using findBySeries and filter).

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by pogando
  6. *
  7. * @param Series
  8. * @param string $tagCod
  9. * @param array $status
  10. *
  1. return $qb;
  2. }
  3. public function getGroupsIdsArray($groups)
  4. {
  5. // TODO #10479: Find better way to get array with only IDs of groups

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by mrey
  6. if ($groups) {
  7. if (gettype($groups) !== 'array') {
  8. $groups = $groups->toArray();
  9. $groupsIds = $this->getMongoIds($groups);
  10. } else {
  1. return $groupsIds;
  2. }
  3. /**
  4. * TODO review and move to EmbeddedEventSessionService.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  5. *
  6. * @param $multimediaObjectId
  7. *
  8. * @return array
  9. */
  1. return $result;
  2. }
  3. /**
  4. * TODO review and move to EmbeddedEventSessionService.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  5. *
  6. * @param $multimediaObjectId
  7. *
  8. * @return array
  9. */
  1. return $collection->aggregate($pipeline)->toArray();
  2. }
  3. /**
  4. * TODO review and move to EmbeddedEventSessionService.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  5. */
  6. public function findEventsMenu()
  7. {
  8. $dm = $this->getDocumentManager();
  9. $collection = $dm->getDocumentCollection('PumukitSchemaBundle:MultimediaObject');
  1. $jobService->createTrackFromLocalHardDrive(
  2. $multimediaObject, $file, $profile, $priority, $language, $description,
  3. array(), $duration, JobService::ADD_JOB_NOT_CHECKS
  4. );
  5. } catch (\Exception $e) {
  6. //TODO Hanle error.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by mrey
  7. throw $e;
  8. }
  9. $this->get('pumukitschema.sorted_multimedia_object')->reorder($series);
  1. $opencastUrls = array();
  2. if (null != $opencastId) {
  3. try {
  4. $archiveMediaPackage = $this->opencastClient->getMediapackageFromArchive($opencastId);
  5. } catch (\Exception $e) {
  6. // TODO - Trace error

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by mrey
  7. return $opencastUrls;
  8. }
  9. $media = $this->getMediaPackageField($archiveMediaPackage, 'media');
  10. $tracks = $this->getMediaPackageField($media, 'track');
  11. if (isset($tracks[0])) {
  1. * @MongoDB\String
  2. * @MongoDB\UniqueIndex(order="asc")
  3. * @Assert\Regex("/^\w*$/")
  4. * @Gedmo\TreePathSource
  5. *
  6. * TODO Unique Index #6098

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  7. */
  8. private $cod = '';
  9. /**
  10. * @var bool
  1. if ($isBanner) {
  2. $pic->setHide(true);
  3. $pic->addTag('banner');
  4. $series = $this->addBanner($series, $pic->getUrl(), $bannerTargetUrl);
  5. }
  6. // TODO: add pic the latest if it is banner

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  7. $series->addPic($pic);
  8. $this->dm->persist($series);
  9. $this->dm->flush();
  10. $this->seriesDispatcher->dispatchUpdate($series);
  1. if ($isBanner) {
  2. $pic->setHide(true);
  3. $pic->addTag('banner');
  4. $series = $this->addBanner($series, $pic->getUrl(), $bannerTargetUrl);
  5. }
  6. // TODO: add pic the latest if it is banner

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Ruben Gonzalez
  7. $series->addPic($pic);
  8. $this->dm->persist($series);
  9. $this->dm->flush();
  10. $this->seriesDispatcher->dispatchUpdate($series);
  1. * Pumukit\EncoderBundle\Document\Job.
  2. *
  3. * @MongoDB\Document(repositoryClass="Pumukit\EncoderBundle\Repository\JobRepository")
  4. *
  5. *
  6. * TODO: JobService as a Job Factory. Delete 'sets' of inmutable data, use a constructor and create `start`, `finish` and `error` function.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. */
  8. class Job
  9. {
  10. const STATUS_ERROR = -1;
  11. const STATUS_PAUSED = 0;
  1. */
  2. private $mm_id;
  3. /**
  4. * //@var int $language_id
  5. * // TODO check this or next

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Mercedes Rey
  6. * // language code instead of integer
  7. * //@MongoDB\Int.
  8. */
  9. //private $language_id;
  1. if (!$process->isSuccessful()) {
  2. throw new ExecutorException($process->getErrorOutput());
  3. }
  4. //TODO mix strerr and strout.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Brais Piñeiro
  5. return sprintf("%s\n%s", $process->getOutput(), $process->getErrorOutput());
  6. }
  7. }
  1. * @return array filtered profiles
  2. */
  3. public function getProfilesByTags($tags)
  4. {
  5. $tags = is_array($tags) ? $tags : array($tags);
  6. //TODO Add tag

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  7. return array_filter($this->profiles, function ($profile) use ($tags) {
  8. return 0 == count(array_diff($tags, array_filter(preg_split('/[,\s]+/', $profile['tags']))));
  9. });
  10. }
  1. protected function execute(InputInterface $input, OutputInterface $output)
  2. {
  3. $this->dm = $this->getContainer()->get('doctrine_mongodb')->getManager();
  4. $detector = $this->getContainer()->get('vipx_bot_detect.detector');
  5. //TODO add to pumukit yml.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  6. $this->execRemoveQuery('TTK Zabbix Agent');
  7. foreach ($detector->getMetadatas() as $metadata) {
  8. if ('' === $metadata->getAgent() && 'exact' !== $metadata->getAgentMatch()) {
  9. continue;
  1. $tagsTree = $this->getDoctrine()
  2. ->getRepository('PumukitSchemaBundle:Tag')
  3. ->getTree($groundsRoot);
  4. //Create array structure
  5. //TODO Move this logic to a service.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  6. $tagsArray = array();
  7. $parentPathLength = strlen($groundsRoot->getPath());
  8. foreach ($tagsTree as $tag) {
  9. $path = sprintf('%s__object', $tag->getPath());
  10. $keys = explode('|', $path);
  1. $tagsArray = $ref;
  2. //End removes unnecessary parent nodes.
  3. //Count number multimediaObjects
  4. $provider = $request->get('provider');
  5. //TODO Move this logic into a service.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  6. $counterMmobjs = $this->countMmobjInTags($provider);
  7. $linkService = $this->get('pumukit_web_tv.link_service');
  8. foreach ($tagsArray as $id => $parent) {
  9. if ($id == '__object') {
  10. continue;
  1. }
  2. return array('allGrounds' => $allGrounds, 'title' => $groundsRoot->getTitle(), 'list_general_tags' => $listGeneralParam);
  3. }
  4. //TODO Move this function into a service.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  5. private function countMmobjInTags($provider = null)
  6. {
  7. $dm = $this->get('doctrine_mongodb.odm.document_manager');
  8. $multimediaObjectsColl = $dm->getDocumentCollection('PumukitSchemaBundle:MultimediaObject');
  9. $criteria = array('status' => MultimediaObject::STATUS_PUBLISHED, 'tags.cod' => 'PUCHWEBTV', 'tags.cod' => 'ITUNESU');
  1. }
  2. return $mmobjCount;
  3. }
  4. //TODO Move this function into a service.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  5. private function countGeneralMmobjsInTag($tag, $provider = null)
  6. {
  7. $dm = $this->get('doctrine_mongodb.odm.document_manager');
  8. $repo = $dm->getRepository('PumukitSchemaBundle:MultimediaObject');
  9. $qb = $repo->createBuilderWithGeneralTag($tag);
  1. $this->generatePic($event->getMultimediaObject(), $event->getTrack());
  2. }
  3. private function generatePic(MultimediaObject $multimediaObject, Track $track)
  4. {
  5. //TODO check if repeat

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  6. if ($this->enable) {
  7. if (!$multimediaObject->isOnlyAudio() && !$track->isOnlyAudio()) {
  8. return $this->generatePicFromVideo($multimediaObject, $track);
  9. }
  10. }
  1. # TODO: Delete when WhiteOctoberPagerFantaBundle have our pull request translations on new tag

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by pogando
  2. # Commit: https://github.com/FriendsOfSymfony/FOSUserBundle/commit/95564b778c0e3d519c8929228569ede4d9074748
  3. # Group
  4. group:
  5. edit:
  6. submit: Actualizar grupo
  1. errorsOnChecks=1;
  2. fi
  3. # Finds console.log() calls for javascript code
  4. # TODO: This grep is excluding the 'public' directories on purpose, although most of the js code is there.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Alfro
  5. # The issue is that there are external libraries with console.logs on their code as of now, and since we don't
  6. # use a dependencies manager for web assets (bower, jam, ...) those libraries are included in the code.
  7. if egrep --color=auto -nr 'console.log\(' src/Pumukit/ --include \*.html* --include \*.js* --exclude-dir=public ; then
  8. echo "";
  9. echo "ERROR: Found one or several console.log() calls on the js code.";
  1. class RemoteHTTPExecutor
  2. {
  3. public function execute($command, array $cpu)
  4. {
  5. //TODO TEST

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by rubenrua
  6. if (!function_exists('curl_init')) {
  7. throw new ExecutorException('Curl is required to execute remote commands.');
  8. }
  9. if (false === $curl = curl_init()) {
in