Code Duplication    Length = 17-19 lines in 2 locations

src/Oro/Bundle/TrackingBundle/Processor/TrackingProcessor.php 2 locations

@@ 232-250 (lines=19) @@
229
     *
230
     * @return integer
231
     */
232
    protected function getIdentifyPrevVisitsCount()
233
    {
234
        $em           = $this->getEntityManager();
235
        $queryBuilder = $em
236
            ->getRepository(self::TRACKING_VISIT_ENTITY)
237
            ->createQueryBuilder('entity');
238
        $queryBuilder
239
            ->select('COUNT (entity.id)')
240
            ->where('entity.identifierDetected = false')
241
            ->andWhere('entity.parsedUID > 0')
242
            ->andWhere('entity.parsingCount < :maxRetries')
243
            ->setParameter('maxRetries', $this->getMaxRetriesCount());
244
245
        if (count($this->skipList)) {
246
            $queryBuilder->andWhere('entity.id not in(' . implode(',', $this->skipList) . ')');
247
        }
248
249
        return $queryBuilder->getQuery()->getSingleScalarResult();
250
    }
251
252
    /**
253
     * Returns count of tracking visit events to be processed.
@@ 257-273 (lines=17) @@
254
     *
255
     * @return integer
256
     */
257
    protected function getIdentifyPrevVisitEventsCount()
258
    {
259
        $em           = $this->getEntityManager();
260
        $queryBuilder = $em
261
            ->getRepository(self::TRACKING_VISIT_EVENT_ENTITY)
262
            ->createQueryBuilder('entity');
263
        $queryBuilder
264
            ->select('COUNT (entity.id)')
265
            ->andWhere('entity.parsingCount < :maxRetries')
266
            ->setParameter('maxRetries', $this->getMaxRetriesCount());
267
268
        if (count($this->skipList)) {
269
            $queryBuilder->andWhere('entity.id not in(' . implode(',', $this->skipList) . ')');
270
        }
271
272
        return $queryBuilder->getQuery()->getSingleScalarResult();
273
    }
274
275
    /**
276
     * Process previous visit events