src/backgrid_modules/header_row.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 44
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 44
rs 10
wmc 2
mnd 0
bc 2
fnc 2
bpm 1
cpm 1
noi 4

2 Functions

Rating   Name   Duplication   Size   Complexity  
A Row.extend.makeCell 0 8 1
A Row.extend.initialize 0 3 1
1
import {
0 ignored issues
show
introduced by
Definition for rule 'keyword-spacing' was not found
Loading history...
2
  Row
3
} from './row.js';
4
import {
5
  HeaderCell
6
} from './celltypes/header.js';
7
/**
8
   HeaderRow is a controller for a row of header cells.
9
10
   @class Backgrid.HeaderRow
11
   @extends Backgrid.Row
12
 */
13
var HeaderRow = Row.extend({
14
15
  /**
16
     Initializer.
17
18
     @param {Object} options
19
     @param {Backbone.Collection.<Backgrid.Column>|Array.<Backgrid.Column>|Array.<Object>} options.columns
0 ignored issues
show
Documentation introduced by
The parameter options.columns does not exist. Did you maybe forget to remove this comment?
Loading history...
20
     @param {Backgrid.HeaderCell} [options.headerCell] Customized default
21
     HeaderCell for all the columns. Supply a HeaderCell class or instance to a
22
     the `headerCell` key in a column definition for column-specific header
23
     rendering.
24
25
     @throws {TypeError} If options.columns or options.collection is undefined.
26
   */
27
  initialize: function () {
28
    Row.prototype.initialize.apply(this, arguments);
29
  },
30
31
  makeCell: function (column, options) {
32
    var headerCell = column.get("headerCell") || options.headerCell || HeaderCell;
33
    headerCell = new headerCell({
0 ignored issues
show
Coding Style Best Practice introduced by
By convention, constructors like headerCell should be capitalized.
Loading history...
introduced by
A constructor name should not start with a lowercase letter.
Loading history...
34
      column: column,
35
      collection: this.collection
36
    });
37
    return headerCell;
38
  }
39
40
});
41
42
export {
43
  HeaderRow
44
};
45