app/assets/javascripts/plugins/jtextarea.js

Summary

Maintainability
D
2 days
Test Coverage

Function jtextarea has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.jtextarea = function(opt) {
        
        var hmin=0;
                    
        var settings = {
Severity: Major
Found in app/assets/javascripts/plugins/jtextarea.js - About 3 hrs to fix

    Function html has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            html: function (ctl) {
                
                var re_nl = null;
                var st = ctl.val();
                
    Severity: Minor
    Found in app/assets/javascripts/plugins/jtextarea.js - About 1 hr to fix

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

                      for ( var i in styles ) {
                           
                          if ( /:/i.test(styles[i]) ) {
                              st = styles[i].match(/font[^;]+/ig);
                              var le = styles[i].match(/line-height[^;]+/ig);
      Severity: Major
      Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/plugins/jtextarea.js on lines 200..208

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

      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

                  for ( var i in styles ) {
                           
                      if ( /:/i.test(styles[i]) ) {
                          st = styles[i].match(/font[^;]+/ig);
                          var le = styles[i].match(/line-height[^;]+/ig);
      Severity: Major
      Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/plugins/jtextarea.js on lines 173..181

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

      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

                      if(text.indexOf('%0D%0A') > -1){
                          re_nl = /%0D%0A/g ;
                      }else if(text.indexOf('%0A') > -1){
                          re_nl = /%0A/g ;
                      }else if(text.indexOf('%0D') > -1){
      Severity: Major
      Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/plugins/jtextarea.js on lines 66..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 86.

      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

                      if(text.indexOf('%0D%0A') > -1){
                          re_nl = /%0D%0A/g ;
                      }else if(text.indexOf('%0A') > -1){
                          re_nl = /%0A/g ;
                      }else if(text.indexOf('%0D') > -1){
      Severity: Major
      Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/plugins/jtextarea.js on lines 27..33

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

      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

                      if (st) {
                          for ( var i in st ) {
                              var na = st[i].split(":");
                              jt_obj.css( na[0], na[1] );
                          }
      Severity: Major
      Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/plugins/jtextarea.js on lines 210..215

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

      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

                  if (st) {
                      for ( var i in st ) {
                          var na = st[i].split(":");
                          jt_obj.css( na[0], na[1] );
                      }
      Severity: Major
      Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/plugins/jtextarea.js on lines 183..188

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

      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