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 = 46-67 lines in 2 locations

src/actions/plugins/pager/PagerActions.js 1 location

@@ 30-96 (lines=67) @@
27
    afterAsyncFunc
28
}) => {
29
30
    if (typeof dataSource === 'function') {
31
32
        return (dispatch) => {
33
34
            dispatch(dismissEditor({ stateKey }));
35
36
            dispatch(
37
                setLoaderState({ state: true, stateKey })
38
            );
39
40
            dataSource(
41
                {pageIndex, pageSize}, filterFields, sort
42
            ).then((response) => {
43
44
                if (response && response.data) {
45
46
                    dispatch({
47
                        type: PAGE_REMOTE,
48
                        pageIndex: pageIndex,
49
                        stateKey
50
                    });
51
52
                    dispatch({
53
                        type: SET_DATA,
54
                        data: response.data,
55
                        total: response.total,
56
                        currentRecords: response.items,
57
                        success: true,
58
                        stateKey
59
                    });
60
61
                    if (afterAsyncFunc
62
                        && typeof afterAsyncFunc === 'function') {
63
                        afterAsyncFunc();
64
                    }
65
                }
66
67
                else {
68
69
                    if (response && !response.data) {
70
                        /* eslint-disable no-console */
71
                        console.warn([
72
                            'A response was recieved but',
73
                            'no data entry was found'
74
                        ].join(' '));
75
                        console.warn([
76
                            'Please see',
77
                            'https://github.com/bencripps/react-redux-grid',
78
                            'for documentation'
79
                        ].join(' '));
80
                        /* eslint-enable no-console */
81
                    }
82
83
                    dispatch({
84
                        type: ERROR_OCCURRED,
85
                        error: 'Unable to Retrieve Grid Data',
86
                        errorOccurred: true,
87
                        stateKey
88
                    });
89
                }
90
91
                dispatch(
92
                    setLoaderState({ state: false, stateKey })
93
                );
94
            });
95
        };
96
    }
97
};
98
99
export const setPageAsync = ({

src/actions/GridActions.js 1 location

@@ 239-284 (lines=46) @@
236
            setLoaderState({state: true, stateKey })
237
        );
238
239
        if (typeof dataSource === 'function') {
240
            return dataSource({pageIndex}, {}, sortParams).then((response) => {
241
242
                if (response && response.data) {
243
244
                    dispatch({
245
                        type: SET_DATA,
246
                        data: response.data,
247
                        total: response.total,
248
                        currentRecords: response.data,
249
                        success: true,
250
                        stateKey
251
                    });
252
253
                }
254
255
                else {
256
257
                    if (response && !response.data) {
258
                        /* eslint-disable no-console */
259
                        console.warn(
260
                            `A response was recieved but no data
261
                             entry was found`
262
                        );
263
                        console.warn(
264
                            `Please see
265
                             https://github.com/bencripps/react-redux-grid
266
                             for documentation`
267
                        );
268
                        /* eslint-enable no-console */
269
                    }
270
271
                    dispatch({
272
                        type: ERROR_OCCURRED,
273
                        error: 'Unable to Retrieve Grid Data',
274
                        errorOccurred: true,
275
                        stateKey
276
                    });
277
                }
278
279
                dispatch(
280
                    setLoaderState({state: false, stateKey })
281
                );
282
            });
283
284
        }
285
286
        return Request.api({
287
            route: dataSource,