Passed
Push — master ( 61dd3f...482d1b )
by greg
01:51
created

src/cli/cms/templates/handlebars/math.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 12
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 1
c 1
b 0
f 0
nc 1
mnd 0
bc 1
fnc 1
dl 0
loc 12
rs 10
bpm 1
cpm 1
noi 1
1
2
export default function math(lvalue, operator, rvalue, options) {
0 ignored issues
show
Unused Code introduced by
The parameter options is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
3
  lvalue = parseFloat(lvalue)
4
  rvalue = parseFloat(rvalue)
5
        
6
  return {
7
    '+': lvalue + rvalue,
8
    '-': lvalue - rvalue,
9
    '*': lvalue * rvalue,
10
    '/': lvalue / rvalue,
11
    '%': lvalue % rvalue
12
  }[operator]
13
}
14