Passed
Push — develop ( 9a1b4b...96b452 )
by Xaver
03:40
created

lib/container.js   A

Complexity

Total Complexity 5
Complexity/F 1.25

Size

Lines of Code 22
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 12
mnd 1
bc 1
fnc 4
dl 0
loc 22
rs 10
bpm 0.25
cpm 1.25
noi 0
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A container.js ➔ render 0 3 1
A container.js ➔ add 0 3 4
1
define([], function () {
2
  'use strict';
3
4
  return function (tag) {
5
    if (!tag) {
6
      tag = 'div';
7
    }
8
9
    var self = this;
10
    var container = document.createElement(tag);
11
12
    self.add = function add(d) {
13
      d.render(container);
14
    };
15
16
    self.render = function render(el) {
17
      el.appendChild(container);
18
    };
19
20
    return self;
21
  };
22
});
23