Completed
Push — master ( a8c4d7...401d4c )
by Michael
12s queued 10s
created

script/nodeviews/PluginInlineView.js   A

Complexity

Total Complexity 4
Complexity/F 2

Size

Lines of Code 19
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 0
eloc 9
nc 1
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 4
mnd 1
bc 2
fnc 2
bpm 1
cpm 2
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A PluginInlineView.js ➔ renderNode 0 8 2
1
import AbstractNodeView from './AbstractNodeView';
2
3
class PluginInlineView extends AbstractNodeView {
4
    /**
5
     * @param {object} attrs the attributes that will be added to the dom node
6
     *
7
     * @return {void}
8
     */
9
    renderNode(attrs) {
10
        if (!this.dom) {
11
            this.dom = document.createElement('code');
12
            this.contentDOM = document.createElement('span');
13
            this.dom.appendChild(this.contentDOM);
14
        }
15
        Object.entries(attrs).forEach(([key, value]) => this.dom.setAttribute(key, value));
16
    }
17
}
18
19
export default PluginInlineView;
20