TeaThemeOptions/TeaThemeOptions

View on GitHub
src/Resources/assets/js/tooltip/tooltip.js

Summary

Maintainability
F
3 days
Test Coverage

Function get_position has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    OlTooltip.prototype.get_position = function (){
        var _ol = this,
            _off = _ol.$el.offset(),
            coords = {};

Severity: Minor
Found in src/Resources/assets/js/tooltip/tooltip.js - About 1 hr to fix

    Function init has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        OlTooltip.prototype.init = function (){
            var _ol = this;
    
            //init globals
            _ol.$win = $(window);
    Severity: Minor
    Found in src/Resources/assets/js/tooltip/tooltip.js - About 1 hr to fix

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

          OlTooltip.prototype.trigger_close = function (e){
              e.preventDefault();
              var _ol = this,
                  _delay = _ol.options.delayOut;
      
      
      Severity: Major
      Found in src/Resources/assets/js/tooltip/tooltip.js and 1 other location - About 4 hrs to fix
      src/Resources/assets/js/tooltip/tooltip.js on lines 215..232

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

      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

          OlTooltip.prototype.trigger_open = function (e){
              e.preventDefault();
              var _ol = this,
                  _delay = _ol.options.delayIn;
      
      
      Severity: Major
      Found in src/Resources/assets/js/tooltip/tooltip.js and 1 other location - About 4 hrs to fix
      src/Resources/assets/js/tooltip/tooltip.js on lines 196..213

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

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

          $.fn.olTooltip = function (method){
              if (methods[method]) {
                  return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
              }
              else if (typeof method === 'object' || !method) {
      Severity: Major
      Found in src/Resources/assets/js/tooltip/tooltip.js and 17 other locations - About 4 hrs to fix
      src/Resources/assets/js/background/background.js on lines 123..134
      src/Resources/assets/js/checkall/checkall.js on lines 107..118
      src/Resources/assets/js/checkit/checkit.js on lines 88..99
      src/Resources/assets/js/code/code.js on lines 131..142
      src/Resources/assets/js/color/color.js on lines 109..120
      src/Resources/assets/js/date/date.js on lines 80..91
      src/Resources/assets/js/dragndrop/dragndrop.js on lines 102..113
      src/Resources/assets/js/link/link.js on lines 165..176
      src/Resources/assets/js/maps/maps.js on lines 273..284
      src/Resources/assets/js/modal/modal.js on lines 99..110
      src/Resources/assets/js/multiselect/multiselect.js on lines 140..151
      src/Resources/assets/js/range/range.js on lines 74..85
      src/Resources/assets/js/social/social.js on lines 234..245
      src/Resources/assets/js/textarea/textarea.js on lines 78..89
      src/Resources/assets/js/toggle/toggle.js on lines 76..87
      src/Resources/assets/js/upload/upload.js on lines 261..272
      src/Resources/assets/js/youtube/youtube.js on lines 192..203

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

      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

              else if ('bottom' == _ol.options.position) {
                  _ol.$tooltip.addClass('arrow-top');
      
                  //bottom
                  return {
      Severity: Major
      Found in src/Resources/assets/js/tooltip/tooltip.js and 1 other location - About 2 hrs to fix
      src/Resources/assets/js/tooltip/tooltip.js on lines 144..179

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

      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 ('top' == _ol.options.position) {
                  _ol.$tooltip.addClass('arrow-bottom');
      
                  //top
                  return {
      Severity: Major
      Found in src/Resources/assets/js/tooltip/tooltip.js and 1 other location - About 2 hrs to fix
      src/Resources/assets/js/tooltip/tooltip.js on lines 153..179

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

      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

              else if ('left' == _ol.options.position) {
                  _ol.$tooltip.addClass('arrow-right');
      
                  //left
                  return {
      Severity: Major
      Found in src/Resources/assets/js/tooltip/tooltip.js and 1 other location - About 2 hrs to fix
      src/Resources/assets/js/tooltip/tooltip.js on lines 171..179

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

      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

              else {
                  _ol.$tooltip.addClass('arrow-left');
      
                  //right
                  return {
      Severity: Major
      Found in src/Resources/assets/js/tooltip/tooltip.js and 1 other location - About 2 hrs to fix
      src/Resources/assets/js/tooltip/tooltip.js on lines 162..170

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

      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