view/js/bootstrap-wysihtml5/locales/bootstrap-wysihtml5.en-US.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 58
Function Count 2

Duplication

Duplicated Lines 50
Ratio 86.21 %

Importance

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

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
/**
2
 * English translation for bootstrap-wysihtml5
3
 */
4
(function (factory) {
5
    if (typeof define === 'function' && define.amd) {
0 ignored issues
show
Bug introduced by
The variable define seems to be never declared. If this is a global, consider adding a /** global: define */ 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...
6
        // AMD. Register as an anonymous module.
7
        define('bootstrap.wysihtml5.en-US', ['jquery', 'bootstrap.wysihtml5'], factory);
8
    } else {
9
        // Browser globals
10
        factory(jQuery);
11
    }
12 View Code Duplication
}(function ($) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13
  $.fn.wysihtml5.locale.en = $.fn.wysihtml5.locale['en-US'] = {
14
    font_styles: {
15
      normal: 'Normal text',
16
      h1: 'Heading 1',
17
      h2: 'Heading 2',
18
      h3: 'Heading 3',
19
      h4: 'Heading 4',
20
      h5: 'Heading 5',
21
      h6: 'Heading 6'
22
    },
23
    emphasis: {
24
      bold: 'Bold',
25
      italic: 'Italic',
26
      underline: 'Underline',
27
      small: 'Small'
28
    },
29
    lists: {
30
      unordered: 'Unordered list',
31
      ordered: 'Ordered list',
32
      outdent: 'Outdent',
33
      indent: 'Indent'
34
    },
35
    link: {
36
      insert: 'Insert link',
37
      cancel: 'Cancel',
38
      target: 'Open link in new window'
39
    },
40
    image: {
41
      insert: 'Insert image',
42
      cancel: 'Cancel'
43
    },
44
    html: {
45
      edit: 'Edit HTML'
46
    },
47
    colours: {
48
      black: 'Black',
49
      silver: 'Silver',
50
      gray: 'Grey',
51
      maroon: 'Maroon',
52
      red: 'Red',
53
      purple: 'Purple',
54
      green: 'Green',
55
      olive: 'Olive',
56
      navy: 'Navy',
57
      blue: 'Blue',
58
      orange: 'Orange'
59
    }
60
  };
61
}));
62