redmine/redmine

View on GitHub
app/assets/javascripts/jstoolbar/textile.js

Summary

Maintainability
F
4 days
Test Coverage

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.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/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.ul = {
  type: 'button',
  title: 'Unordered 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 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 3 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.precode = {
  type: 'button',
  title: 'Highlighted code',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 2 other locations - About 2 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 192..203
app/assets/javascripts/jstoolbar/markdown.js on lines 188..199

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 94.

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 3 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.h3 = {
  type: 'button',
  title: 'Heading 3',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 2 other locations - About 2 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 75..86
app/assets/javascripts/jstoolbar/markdown.js on lines 85..96

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 88.

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 6 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.h1 = {
  type: 'button',
  title: 'Heading 1',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 5 other locations - About 2 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 51..62
app/assets/javascripts/jstoolbar/common_mark.js on lines 63..74
app/assets/javascripts/jstoolbar/markdown.js on lines 61..72
app/assets/javascripts/jstoolbar/markdown.js on lines 73..84
app/assets/javascripts/jstoolbar/textile.js on lines 73..84

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 84.

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 6 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.h2 = {
  type: 'button',
  title: 'Heading 2',
  fn: {
    wiki: function() {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 5 other locations - About 2 hrs to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 51..62
app/assets/javascripts/jstoolbar/common_mark.js on lines 63..74
app/assets/javascripts/jstoolbar/markdown.js on lines 61..72
app/assets/javascripts/jstoolbar/markdown.js on lines 73..84
app/assets/javascripts/jstoolbar/textile.js on lines 61..72

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 84.

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 3 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.strong = {
  type: 'button',
  title: 'Strong',
  shortcut: 'b',
  fn: {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 10..17
app/assets/javascripts/jstoolbar/markdown.js on lines 10..17

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 69.

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 5 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.ins = {
  type: 'button',
  title: 'Underline',
  shortcut: 'u',
  fn: {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 4 other locations - About 1 hr to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 20..27
app/assets/javascripts/jstoolbar/markdown.js on lines 20..27
app/assets/javascripts/jstoolbar/markdown.js on lines 30..37
app/assets/javascripts/jstoolbar/textile.js on lines 20..27

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 66.

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 5 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.em = {
  type: 'button',
  title: 'Italic',
  shortcut: 'i',
  fn: {
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 4 other locations - About 1 hr to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 20..27
app/assets/javascripts/jstoolbar/markdown.js on lines 20..27
app/assets/javascripts/jstoolbar/markdown.js on lines 30..37
app/assets/javascripts/jstoolbar/textile.js on lines 30..37

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 66.

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 3 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.help = {
  type: 'button',
  title: 'Help',
  fn: {
    wiki: function() { window.open(this.help_link, '', 'resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes') }
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 228..234
app/assets/javascripts/jstoolbar/markdown.js on lines 224..230

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 63.

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 9 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.img = {
  type: 'button',
  title: 'Image',
  fn: {
    wiki: function() { this.encloseSelection("!", "!") }
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 8 other locations - About 1 hr to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 183..189
app/assets/javascripts/jstoolbar/common_mark.js on lines 209..215
app/assets/javascripts/jstoolbar/common_mark.js on lines 217..223
app/assets/javascripts/jstoolbar/markdown.js on lines 179..185
app/assets/javascripts/jstoolbar/markdown.js on lines 205..211
app/assets/javascripts/jstoolbar/markdown.js on lines 213..219
app/assets/javascripts/jstoolbar/textile.js on lines 178..184
app/assets/javascripts/jstoolbar/textile.js on lines 204..210

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 62.

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 9 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.link = {
  type: 'button',
  title: 'Wiki link',
  fn: {
    wiki: function() { this.encloseSelection("[[", "]]") }
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 8 other locations - About 1 hr to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 183..189
app/assets/javascripts/jstoolbar/common_mark.js on lines 209..215
app/assets/javascripts/jstoolbar/common_mark.js on lines 217..223
app/assets/javascripts/jstoolbar/markdown.js on lines 179..185
app/assets/javascripts/jstoolbar/markdown.js on lines 205..211
app/assets/javascripts/jstoolbar/markdown.js on lines 213..219
app/assets/javascripts/jstoolbar/textile.js on lines 178..184
app/assets/javascripts/jstoolbar/textile.js on lines 212..218

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 62.

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 9 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.pre = {
  type: 'button',
  title: 'Preformatted text',
  fn: {
    wiki: function() { this.encloseLineSelection('<pre>\n', '\n</pre>') }
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 8 other locations - About 1 hr to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 183..189
app/assets/javascripts/jstoolbar/common_mark.js on lines 209..215
app/assets/javascripts/jstoolbar/common_mark.js on lines 217..223
app/assets/javascripts/jstoolbar/markdown.js on lines 179..185
app/assets/javascripts/jstoolbar/markdown.js on lines 205..211
app/assets/javascripts/jstoolbar/markdown.js on lines 213..219
app/assets/javascripts/jstoolbar/textile.js on lines 204..210
app/assets/javascripts/jstoolbar/textile.js on lines 212..218

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 62.

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 6 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.code = {
  type: 'button',
  title: 'Code',
  fn: {
    wiki: function() { this.singleTag('@') }
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 5 other locations - About 1 hr to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 30..36
app/assets/javascripts/jstoolbar/common_mark.js on lines 39..45
app/assets/javascripts/jstoolbar/markdown.js on lines 40..46
app/assets/javascripts/jstoolbar/markdown.js on lines 49..55
app/assets/javascripts/jstoolbar/textile.js on lines 40..46

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 61.

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 6 locations. Consider refactoring.
Open

jsToolBar.prototype.elements.del = {
  type: 'button',
  title: 'Deleted',
  fn: {
    wiki: function() { this.singleTag('-') }
Severity: Major
Found in app/assets/javascripts/jstoolbar/textile.js and 5 other locations - About 1 hr to fix
app/assets/javascripts/jstoolbar/common_mark.js on lines 30..36
app/assets/javascripts/jstoolbar/common_mark.js on lines 39..45
app/assets/javascripts/jstoolbar/markdown.js on lines 40..46
app/assets/javascripts/jstoolbar/markdown.js on lines 49..55
app/assets/javascripts/jstoolbar/textile.js on lines 49..55

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 61.

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

There are no issues that match your filters.

Category
Status