| Total Complexity | 3 |
| Complexity/F | 1.5 |
| Lines of Code | 58 |
| Function Count | 2 |
| Duplicated Lines | 58 |
| Ratio | 100 % |
| Changes | 0 | ||
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 | /** |
||
| 4 | View Code Duplication | (function (factory) { |
|
|
|
|||
| 5 | if (typeof define === 'function' && define.amd) { |
||
| 6 | // AMD. Register as an anonymous module. |
||
| 7 | define('bootstrap.wysihtml5.es-AR', ['jquery', 'bootstrap.wysihtml5'], factory); |
||
| 8 | } else { |
||
| 9 | // Browser globals |
||
| 10 | factory(jQuery); |
||
| 11 | } |
||
| 12 | }(function($){ |
||
| 13 | $.fn.wysihtml5.locale["es-AR"] = { |
||
| 14 | font_styles: { |
||
| 15 | normal: "Texto normal", |
||
| 16 | h1: "Título 1", |
||
| 17 | h2: "Título 2", |
||
| 18 | h3: "Título 3", |
||
| 19 | h4: "Título 4", |
||
| 20 | h5: "Título 5", |
||
| 21 | h6: "Título 6" |
||
| 22 | }, |
||
| 23 | emphasis: { |
||
| 24 | bold: "Negrita", |
||
| 25 | italic: "Itálica", |
||
| 26 | underline: "Subrayado", |
||
| 27 | small: "Subíndice" |
||
| 28 | }, |
||
| 29 | lists: { |
||
| 30 | ordered: "Lista ordenada", |
||
| 31 | unordered: "Lista desordenada", |
||
| 32 | indent: "Agregar sangría", |
||
| 33 | outdent: "Eliminar sangría" |
||
| 34 | }, |
||
| 35 | link: { |
||
| 36 | insert: "Insertar enlace", |
||
| 37 | cancel: "Cancelar", |
||
| 38 | target: "Abrir enlace en una ventana nueva" |
||
| 39 | }, |
||
| 40 | image: { |
||
| 41 | insert: "Insertar imagen", |
||
| 42 | cancel: "Cancelar" |
||
| 43 | }, |
||
| 44 | html: { |
||
| 45 | edit: "Editar HTML" |
||
| 46 | }, |
||
| 47 | colours: { |
||
| 48 | black: "Negro", |
||
| 49 | silver: "Plata", |
||
| 50 | gray: "Gris", |
||
| 51 | maroon: "Marrón", |
||
| 52 | red: "Rojo", |
||
| 53 | purple: "Púrpura", |
||
| 54 | green: "Verde", |
||
| 55 | olive: "Oliva", |
||
| 56 | navy: "Azul Marino", |
||
| 57 | blue: "Azul", |
||
| 58 | orange: "Naranja" |
||
| 59 | } |
||
| 60 | }; |
||
| 61 | })); |
||
| 62 |