src/reducer.js   A
last analyzed

Complexity

Total Complexity 5
Complexity/F 2.5

Size

Lines of Code 13
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 5
c 1
b 0
f 0
nc 1
mnd 2
bc 2
fnc 2
dl 0
loc 13
rs 10
bpm 1
cpm 2.5
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A reducer.js ➔ ??? 0 11 1
1
import { ACTION_TYPES } from './constants';
2
3
export default ({ locationParser, immutable }) => (state = immutable ? require('immutable').fromJS({}) : {}, { type, payload }) => {
4
5
    if (type === ACTION_TYPES.LOCATION_CHANGED) {
6
7
        const result = locationParser(payload);
8
9
        return immutable ? require('immutable').fromJS(result) : result;
10
    }
11
12
    return state;
13
};