Completed
Branch refactoring (45a804)
by Johan
01:19
created

src/renderers/index.js   A

Complexity

Total Complexity 4
Complexity/F 4

Size

Lines of Code 15
Function Count 1

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 15
rs 10
wmc 4
mnd 1
bc 1
fnc 1
bpm 1
cpm 4
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A index.js ➔ getRendererClass 0 10 4
1
import CanvasRenderer from './canvas.js';
2
import SVGRenderer from './svg.js';
3
4
function getRendererClass(name){
5
	switch (name) {
6
		case "canvas":
7
			return CanvasRenderer;
8
		case "svg":
9
			return SVGRenderer;
10
		default:
11
			throw new Error("Invalid rederer");
12
	}
13
}
14
15
export {getRendererClass};
16