redmine/redmine

View on GitHub

Showing 234 of 1,179 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

( function( factory ) {
    "use strict";

    if ( typeof define === "function" && define.amd ) {

Severity: Major
Found in app/assets/javascripts/i18n/datepicker-hu.js and 3 other locations - About 1 day to fix
app/assets/javascripts/i18n/datepicker-eu.js on lines 2..39
app/assets/javascripts/i18n/datepicker-pt.js on lines 2..47
app/assets/javascripts/i18n/datepicker-ro.js on lines 6..43

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 240.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

( function( factory ) {
    "use strict";

    if ( typeof define === "function" && define.amd ) {

Severity: Major
Found in app/assets/javascripts/i18n/datepicker-pt.js and 3 other locations - About 1 day to fix
app/assets/javascripts/i18n/datepicker-eu.js on lines 2..39
app/assets/javascripts/i18n/datepicker-hu.js on lines 2..39
app/assets/javascripts/i18n/datepicker-ro.js on lines 6..43

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 240.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

( function( factory ) {
    "use strict";

    if ( typeof define === "function" && define.amd ) {

Severity: Major
Found in app/assets/javascripts/i18n/datepicker-ro.js and 3 other locations - About 1 day to fix
app/assets/javascripts/i18n/datepicker-eu.js on lines 2..39
app/assets/javascripts/i18n/datepicker-hu.js on lines 2..39
app/assets/javascripts/i18n/datepicker-pt.js on lines 2..47

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 240.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.table = {
  type: 'button',
  title: 'Table',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/common_mark.js and 1 other location - About 7 hrs to fix
app/assets/javascripts/jstoolbar/markdown.js on lines 161..176

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 180.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.table = {
  type: 'button',
  title: 'Table',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/markdown.js and 1 other location - About 7 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 165..180

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 180.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function expandAllRowGroups(el) {
  var tbody = $(el).parents('tbody').first();
  tbody.children('tr').each(function(index) {
    if ($(this).hasClass('group')) {
      $(this).addClass('open');
Severity: Major
Found in app/assets/javascripts/application.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/application.js on lines 44..54

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 136.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function collapseAllRowGroups(el) {
  var tbody = $(el).parents('tbody').first();
  tbody.children('tr').each(function(index) {
    if ($(this).hasClass('group')) {
      $(this).removeClass('open');
Severity: Major
Found in app/assets/javascripts/application.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/application.js on lines 56..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 136.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  module WikiFormatting
    module Textile
      class HtmlParser < Redmine::WikiFormatting::HtmlParser

        self.tags = tags.merge(
Severity: Major
Found in lib/redmine/wiki_formatting/textile/html_parser.rb and 1 other location - About 3 hrs to fix
lib/redmine/wiki_formatting/markdown/html_parser.rb on lines 21..49

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 135.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  module WikiFormatting
    module Markdown
      class HtmlParser < Redmine::WikiFormatting::HtmlParser

        self.tags = tags.merge(
Severity: Major
Found in lib/redmine/wiki_formatting/markdown/html_parser.rb and 1 other location - About 3 hrs to fix
lib/redmine/wiki_formatting/textile/html_parser.rb on lines 21..49

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 135.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if(!mobileInit) {

        $('#main-menu > ul').detach().appendTo('.js-project-menu');
        $('#top-menu > ul').detach().appendTo('.js-general-menu');
        $('#sidebar > *').detach().appendTo('.js-sidebar');
Severity: Major
Found in app/assets/javascripts/responsive.js and 1 other location - About 3 hrs to fix
app/assets/javascripts/responsive.js on lines 66..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 106.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if(!desktopInit) {

        $('.js-project-menu > ul').detach().appendTo('#main-menu');
        $('.js-general-menu > ul').detach().appendTo('#top-menu');
        $('.js-sidebar > *').detach().appendTo('#sidebar');
Severity: Major
Found in app/assets/javascripts/responsive.js and 1 other location - About 3 hrs to fix
app/assets/javascripts/responsive.js on lines 53..62

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 106.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.tl = {
  type: 'button',
  title: 'Task list',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/common_mark.js and 12 other locations - About 3 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 92..103
app/assets/javascripts/jstoolbar/common_mark.js on lines 106..117
app/assets/javascripts/jstoolbar/common_mark.js on lines 137..148
app/assets/javascripts/jstoolbar/common_mark.js on lines 151..162
app/assets/javascripts/jstoolbar/markdown.js on lines 102..113
app/assets/javascripts/jstoolbar/markdown.js on lines 116..127
app/assets/javascripts/jstoolbar/markdown.js on lines 133..144
app/assets/javascripts/jstoolbar/markdown.js on lines 147..158
app/assets/javascripts/jstoolbar/textile.js on lines 102..113
app/assets/javascripts/jstoolbar/textile.js on lines 116..127
app/assets/javascripts/jstoolbar/textile.js on lines 133..144
app/assets/javascripts/jstoolbar/textile.js on lines 147..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.unbq = {
  type: 'button',
  title: 'Unquote',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 12 other locations - About 3 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 92..103
app/assets/javascripts/jstoolbar/common_mark.js on lines 106..117
app/assets/javascripts/jstoolbar/common_mark.js on lines 120..131
app/assets/javascripts/jstoolbar/common_mark.js on lines 137..148
app/assets/javascripts/jstoolbar/common_mark.js on lines 151..162
app/assets/javascripts/jstoolbar/markdown.js on lines 102..113
app/assets/javascripts/jstoolbar/markdown.js on lines 116..127
app/assets/javascripts/jstoolbar/markdown.js on lines 133..144
app/assets/javascripts/jstoolbar/markdown.js on lines 147..158
app/assets/javascripts/jstoolbar/textile.js on lines 102..113
app/assets/javascripts/jstoolbar/textile.js on lines 116..127
app/assets/javascripts/jstoolbar/textile.js on lines 133..144

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.unbq = {
  type: 'button',
  title: 'Unquote',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/common_mark.js and 12 other locations - About 3 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 92..103
app/assets/javascripts/jstoolbar/common_mark.js on lines 106..117
app/assets/javascripts/jstoolbar/common_mark.js on lines 120..131
app/assets/javascripts/jstoolbar/common_mark.js on lines 137..148
app/assets/javascripts/jstoolbar/markdown.js on lines 102..113
app/assets/javascripts/jstoolbar/markdown.js on lines 116..127
app/assets/javascripts/jstoolbar/markdown.js on lines 133..144
app/assets/javascripts/jstoolbar/markdown.js on lines 147..158
app/assets/javascripts/jstoolbar/textile.js on lines 102..113
app/assets/javascripts/jstoolbar/textile.js on lines 116..127
app/assets/javascripts/jstoolbar/textile.js on lines 133..144
app/assets/javascripts/jstoolbar/textile.js on lines 147..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.bq = {
  type: 'button',
  title: 'Quote',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 12 other locations - About 3 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 92..103
app/assets/javascripts/jstoolbar/common_mark.js on lines 106..117
app/assets/javascripts/jstoolbar/common_mark.js on lines 120..131
app/assets/javascripts/jstoolbar/common_mark.js on lines 137..148
app/assets/javascripts/jstoolbar/common_mark.js on lines 151..162
app/assets/javascripts/jstoolbar/markdown.js on lines 102..113
app/assets/javascripts/jstoolbar/markdown.js on lines 116..127
app/assets/javascripts/jstoolbar/markdown.js on lines 133..144
app/assets/javascripts/jstoolbar/markdown.js on lines 147..158
app/assets/javascripts/jstoolbar/textile.js on lines 102..113
app/assets/javascripts/jstoolbar/textile.js on lines 116..127
app/assets/javascripts/jstoolbar/textile.js on lines 147..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.ol = {
  type: 'button',
  title: 'Ordered list',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/common_mark.js and 12 other locations - About 3 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 92..103
app/assets/javascripts/jstoolbar/common_mark.js on lines 120..131
app/assets/javascripts/jstoolbar/common_mark.js on lines 137..148
app/assets/javascripts/jstoolbar/common_mark.js on lines 151..162
app/assets/javascripts/jstoolbar/markdown.js on lines 102..113
app/assets/javascripts/jstoolbar/markdown.js on lines 116..127
app/assets/javascripts/jstoolbar/markdown.js on lines 133..144
app/assets/javascripts/jstoolbar/markdown.js on lines 147..158
app/assets/javascripts/jstoolbar/textile.js on lines 102..113
app/assets/javascripts/jstoolbar/textile.js on lines 116..127
app/assets/javascripts/jstoolbar/textile.js on lines 133..144
app/assets/javascripts/jstoolbar/textile.js on lines 147..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.ol = {
  type: 'button',
  title: 'Ordered list',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 12 other locations - About 3 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 92..103
app/assets/javascripts/jstoolbar/common_mark.js on lines 106..117
app/assets/javascripts/jstoolbar/common_mark.js on lines 120..131
app/assets/javascripts/jstoolbar/common_mark.js on lines 137..148
app/assets/javascripts/jstoolbar/common_mark.js on lines 151..162
app/assets/javascripts/jstoolbar/markdown.js on lines 102..113
app/assets/javascripts/jstoolbar/markdown.js on lines 116..127
app/assets/javascripts/jstoolbar/markdown.js on lines 133..144
app/assets/javascripts/jstoolbar/markdown.js on lines 147..158
app/assets/javascripts/jstoolbar/textile.js on lines 102..113
app/assets/javascripts/jstoolbar/textile.js on lines 133..144
app/assets/javascripts/jstoolbar/textile.js on lines 147..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.bq = {
  type: 'button',
  title: 'Quote',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/markdown.js and 12 other locations - About 3 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 92..103
app/assets/javascripts/jstoolbar/common_mark.js on lines 106..117
app/assets/javascripts/jstoolbar/common_mark.js on lines 120..131
app/assets/javascripts/jstoolbar/common_mark.js on lines 137..148
app/assets/javascripts/jstoolbar/common_mark.js on lines 151..162
app/assets/javascripts/jstoolbar/markdown.js on lines 102..113
app/assets/javascripts/jstoolbar/markdown.js on lines 116..127
app/assets/javascripts/jstoolbar/markdown.js on lines 147..158
app/assets/javascripts/jstoolbar/textile.js on lines 102..113
app/assets/javascripts/jstoolbar/textile.js on lines 116..127
app/assets/javascripts/jstoolbar/textile.js on lines 133..144
app/assets/javascripts/jstoolbar/textile.js on lines 147..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.bq = {
  type: 'button',
  title: 'Quote',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/common_mark.js and 12 other locations - About 3 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 92..103
app/assets/javascripts/jstoolbar/common_mark.js on lines 106..117
app/assets/javascripts/jstoolbar/common_mark.js on lines 120..131
app/assets/javascripts/jstoolbar/common_mark.js on lines 151..162
app/assets/javascripts/jstoolbar/markdown.js on lines 102..113
app/assets/javascripts/jstoolbar/markdown.js on lines 116..127
app/assets/javascripts/jstoolbar/markdown.js on lines 133..144
app/assets/javascripts/jstoolbar/markdown.js on lines 147..158
app/assets/javascripts/jstoolbar/textile.js on lines 102..113
app/assets/javascripts/jstoolbar/textile.js on lines 116..127
app/assets/javascripts/jstoolbar/textile.js on lines 133..144
app/assets/javascripts/jstoolbar/textile.js on lines 147..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.ul = {
  type: 'button',
  title: 'Unordered list',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/markdown.js and 12 other locations - About 3 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 92..103
app/assets/javascripts/jstoolbar/common_mark.js on lines 106..117
app/assets/javascripts/jstoolbar/common_mark.js on lines 120..131
app/assets/javascripts/jstoolbar/common_mark.js on lines 137..148
app/assets/javascripts/jstoolbar/common_mark.js on lines 151..162
app/assets/javascripts/jstoolbar/markdown.js on lines 116..127
app/assets/javascripts/jstoolbar/markdown.js on lines 133..144
app/assets/javascripts/jstoolbar/markdown.js on lines 147..158
app/assets/javascripts/jstoolbar/textile.js on lines 102..113
app/assets/javascripts/jstoolbar/textile.js on lines 116..127
app/assets/javascripts/jstoolbar/textile.js on lines 133..144
app/assets/javascripts/jstoolbar/textile.js on lines 147..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language