Passed
Push — master ( e1efef...d34f83 )
by
unknown
15:24
created

script/plugins/Menu/MenuItems/BlockquoteMenuItemDispatcher.js   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 22
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 15
c 0
b 0
f 0
dl 0
loc 22
rs 10
wmc 3
mnd 1
bc 1
fnc 2
bpm 0.5
cpm 1.5
noi 2

2 Functions

Rating   Name   Duplication   Size   Complexity  
A BlockquoteMenuItemDispatcher.isAvailable 0 3 1
A BlockquoteMenuItemDispatcher.getMenuItem 0 11 2
1
import { wrapIn } from 'prosemirror-commands';
2
import AbstractMenuItemDispatcher from './AbstractMenuItemDispatcher';
3
import { svgIcon } from '../MDI';
4
import MenuItem from '../MenuItem';
5
6
export default class BlockquoteMenuItemDispatcher extends AbstractMenuItemDispatcher {
7
    static isAvailable(schema) {
8
        return !!schema.nodes.blockquote;
9
    }
10
11
    static getMenuItem(schema) {
12
        if (!this.isAvailable(schema)) {
13
            console.log(schema);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
14
            throw new Error('Blockquote is not available in schema!');
15
        }
16
        return new MenuItem({
17
            command: wrapIn(schema.nodes.blockquote),
18
            icon: svgIcon('format-quote-close'),
19
            label: LANG.plugins.prosemirror['label:blockquote'],
0 ignored issues
show
Bug introduced by
The variable LANG seems to be never declared. If this is a global, consider adding a /** global: LANG */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
20
        });
21
    }
22
}
23