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.
Passed
Push — master ( 43bb89...906335 )
by Benjamin
01:58
created

src/util/getUpdatedRecord.js   A

Complexity

Total Complexity 4
Complexity/F 4

Size

Lines of Code 21
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 4
c 1
b 0
f 0
nc 1
mnd 3
bc 3
fnc 1
dl 0
loc 21
rs 10
bpm 3
cpm 4
noi 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A getUpdatedRecord.js ➔ ??? 0 17 4
1
/**
2
* utility classed used by all reducers to
3
* update their internal Immutable records
4
* @param {object}  state
5
* @param {string} stateKey
6
* @param {object} values
7
* @param {Immutable.Record} type
8
* @param {string} operation
9
**/
10
11
import { fromJS } from 'immutable';
12
13
export const getUpdatedDataRecord = (
14
    state, stateKey, values = {}, type, operation = 'setIn'
15
) => {
16
    if (operation === 'setIn') {
17
        return state[operation]([stateKey], new type(values));
0 ignored issues
show
Coding Style Best Practice introduced by
By convention, constructors like type should be capitalized.
Loading history...
18
    }
19
20
    else if (operation === 'mergeIn') {
21
        const p = state.get(stateKey)
22
            ? state.get(stateKey)
23
            : fromJS({});
24
25
        return state[operation]([stateKey], p.merge(values));
26
    }
27
28
    throw new Error('Update operation has not been implemented!');
29
};
30
31
export default getUpdatedDataRecord;
32