Completed
Push — master ( 70dc09...e4a2b5 )
by Daniel
55s
created

custom_functions.js   A

Complexity

Total Complexity 7
Complexity/F 3.5

Size

Lines of Code 28
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
c 2
b 0
f 0
nc 1
dl 0
loc 28
rs 10
wmc 7
mnd 2
bc 4
fnc 2
bpm 2
cpm 3.5
noi 2
1
2
var MyCustomFunctions = function () {
3
    var self = this;
4
    self.decideBlackListWhiteList = function (inDecisionValue, inEvaluatedValueForBlackList, inBlackListArray, inEvaluatedValueForWhiteList, inWhiteListArray, inValueToEvaluate) {
5
        var outResultBoolean = false;
6
        var switchChoices = {
0 ignored issues
show
Unused Code introduced by
The variable switchChoices seems to be never used. Consider removing it.
Loading history...
7
            'BlackList': inEvaluatedValueForBlackList,
8
            'WhiteList': inEvaluatedValueForWhiteList
9
        };
10
        switch (inDecisionValue) {
11
            case switchChoices['BlackList']:
0 ignored issues
show
Bug introduced by
The variable switchChoices seems to be never declared. If this is a global, consider adding a /** global: switchChoices */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
12
                if (inBlackListArray.indexOf(inValueToEvaluate) === -1) {
13
                    outResultBoolean = true;
14
                }
15
                break;
16
            case switchChoices['WhiteList']:
17
                if (inWhiteListArray.indexOf(inValueToEvaluate) > -1) {
18
                    outResultBoolean = true;
19
                }
20
                break;
21
            default:
22
                // intentionally left black as is not supposed to change default valuation
23
                break;
24
        }
25
        return outResultBoolean;
26
    };
27
};
28
29
module.exports = MyCustomFunctions;
30