GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 28-28 lines in 2 locations

src/Analytics.php 2 locations

@@ 155-182 (lines=28) @@
152
     * @param  int $maxResults
153
     * @return array
154
     */
155
    public function getTopReferrersForPeriod(DateTime $startDate, DateTime $endDate, $maxResults)
156
    {
157
        $answer = $this->performQuery(
158
            $startDate,
159
            $endDate,
160
            'ga:pageviews',
161
            array(
162
                'dimensions' => 'ga:fullReferrer',
163
                'sort' => '-ga:pageviews',
164
                'max-results' => $maxResults
165
            )
166
        );
167
168
        if (is_null($answer->rows)) {
169
            return array();
170
        }
171
172
        $referrerData = array();
173
174
        foreach ($answer->rows as $pageRow) {
175
            $referrerData[] = array(
176
                'url' => $pageRow[0],
177
                'pageViews' => $pageRow[1]
178
            );
179
        }
180
181
        return $referrerData;
182
    }
183
184
    /**
185
     * Get the top browsers.
@@ 288-315 (lines=28) @@
285
     * @param  int $maxResults
286
     * @return array
287
     */
288
    public function getMostVisitedPagesForPeriod(DateTime $startDate, DateTime $endDate, $maxResults = 20)
289
    {
290
        $answer = $this->performQuery(
291
            $startDate,
292
            $endDate,
293
            'ga:pageviews',
294
            array(
295
                'dimensions' => 'ga:pagePath',
296
                'sort' => '-ga:pageviews',
297
                'max-results' => $maxResults
298
            )
299
        );
300
301
        if (is_null($answer->rows)) {
302
            return array();
303
        }
304
305
        $pagesData = array();
306
307
        foreach ($answer->rows as $pageRow) {
308
            $pagesData[] = array(
309
                'url' => $pageRow[0],
310
                'pageViews' => $pageRow[1]
311
            );
312
        }
313
314
        return $pagesData;
315
    }
316
317
    /**
318
     * Returns the site id (ga:xxxxxxx) for the given url.