ttelang/divbox

View on GitHub
divbox.js

Summary

Maintainability
A
0 mins
Test Coverage

Function divbox has 568 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

  $.fn.divbox = function(opt, clickObj) {
    var _cfg = {
      width: null,
      height: null,
      speed: 500,
Severity: Major
Found in divbox.js - About 2 days to fix

    Function _run has 509 lines of code (exceeds 25 allowed). Consider refactoring.
    Wontfix

        function _run(index, init) {
          var fn = {};
          fn.closed = function() {
            $('#divbox_frame').animate({
              'top': _click.top,
    Severity: Major
    Found in divbox.js - About 2 days to fix

      File divbox.js has 594 lines of code (exceeds 250 allowed). Consider refactoring.
      Wontfix

      /*
          DivBox v1.4
      */
      (function($) {
        $.fn.divbox = function(opt, clickObj) {
      Severity: Major
      Found in divbox.js - About 1 day to fix

        Function main has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Wontfix

              fn.main = function(t, l, w, h, fncallback, fnclosed, caption) {
                fn.toggleObj('body');
                var oContent = $('#divbox_content');
                oContent.closed = function() {
                  fn.closed();
        Severity: Major
        Found in divbox.js - About 3 hrs to fix

          Function viewImage has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Wontfix

                fn.viewImage = function(src, caption) {
                  var Img = new Image();
                  Img.onerror = function() {
                    fn.error('This image cannot download!');
                  };
          Severity: Minor
          Found in divbox.js - About 2 hrs to fix

            Function onload has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Wontfix

                    Img.onload = function() {
                      $('#divbox_content').html('<img src="' + src + '" />').find('img').hide();
                      //$('#divbox_content img').attr('src',src);
                      var imgW = Img.width;
                      var imgH = Img.height;
            Severity: Minor
            Found in divbox.js - About 1 hr to fix

              Function animate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Wontfix

                    fn.animate = function(t, l, w, h, fncallback, fnclosed, caption) {
                      $('#divbox').unbind('click');
                      $(document).unbind('keydown');
                      $(_cfg.btn_closed + ',' + _cfg.btn_next + ',' + _cfg.btn_prev + ',' + _cfg.btn_number).hide();
                      var border = ie ? parseInt($(oFrame).css('border-left-width')) + parseInt($(oFrame).css(
              Severity: Minor
              Found in divbox.js - About 1 hr to fix

                Function init has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Wontfix

                      fn.init = function() {
                        if (typeof(_cfg.api.start) == 'function') _cfg.api.start(obj);
                        var requires = '#divbox,#divbox_frame,#divbox_content,#divbox_ajax';
                        $(requires).remove();
                        $(_cfg.container).prepend(
                Severity: Minor
                Found in divbox.js - About 1 hr to fix

                  Function main has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Wontfix

                        fn.main = function(t, l, w, h, fncallback, fnclosed, caption) {
                  Severity: Major
                  Found in divbox.js - About 50 mins to fix

                    Function animate has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Wontfix

                          fn.animate = function(t, l, w, h, fncallback, fnclosed, caption) {
                    Severity: Major
                    Found in divbox.js - About 50 mins to fix

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

                            fn.viewFLV = function(src, caption) {
                              var winW = fn.setwidth(400);
                              var winH = fn.setheight(300);
                              var top = sizesystem[3] + Math.round((sizesystem[5] - winH) / 2);
                              var left = Math.round((sizesystem[4] - winW) / 2);
                      Severity: Major
                      Found in divbox.js and 1 other location - About 6 hrs to fix
                      divbox.js on lines 382..391

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

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

                            fn.viewMP4 = function(src, caption) {
                              var winW = fn.setwidth(400);
                              var winH = fn.setheight(300);
                              var top = sizesystem[3] + Math.round((sizesystem[5] - winH) / 2);
                              var left = Math.round((sizesystem[4] - winW) / 2);
                      Severity: Major
                      Found in divbox.js and 1 other location - About 6 hrs to fix
                      divbox.js on lines 372..381

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

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

                            fn.viewMP3 = function(src, caption) {
                              var winW = fn.setwidth(320);
                              var winH = fn.setheight(80);
                              var top = sizesystem[3] + Math.round((sizesystem[5] - winH) / 2);
                              var left = Math.round((sizesystem[4] - winW) / 2);
                      Severity: Major
                      Found in divbox.js and 1 other location - About 6 hrs to fix
                      divbox.js on lines 420..429

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

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

                            fn.viewSWF = function(src, caption) {
                              var winW = fn.setwidth(400);
                              var winH = fn.setheight(300);
                              var top = sizesystem[3] + Math.round((sizesystem[5] - winH) / 2);
                              var left = Math.round((sizesystem[4] - winW) / 2);
                      Severity: Major
                      Found in divbox.js and 1 other location - About 6 hrs to fix
                      divbox.js on lines 392..401

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

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

                                top: _cfg.top ? sizesystem[3] + _cfg.top : sizesystem[3] + Math.round((sizesystem[5] - h) /
                                  2),
                      Severity: Major
                      Found in divbox.js and 1 other location - About 1 hr to fix
                      divbox.js on lines 122..123

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

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

                                top: _cfg.top ? sizesystem[3] + _cfg.top : sizesystem[3] + Math.round((sizesystem[5] - h) /
                                  2),
                      Severity: Major
                      Found in divbox.js and 1 other location - About 1 hr to fix
                      divbox.js on lines 132..133

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

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

                              $(_cfg.btn_closed + ',' + _cfg.btn_next + ',' + _cfg.btn_prev + ',' + _cfg.btn_number).hide();
                      Severity: Minor
                      Found in divbox.js and 1 other location - About 55 mins to fix
                      divbox.js on lines 140..140

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

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

                              $(_cfg.btn_closed + ',' + _cfg.btn_next + ',' + _cfg.btn_prev + ',' + _cfg.btn_number).hide();
                      Severity: Minor
                      Found in divbox.js and 1 other location - About 55 mins to fix
                      divbox.js on lines 85..85

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

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

                                  if (index * 1 < total - 1) {
                                    $(_cfg.btn_next).removeClass('nextDisabled').bind('click', function() {
                                      fn.nextItem(index);
                                    });
                                  } else {
                      Severity: Minor
                      Found in divbox.js and 1 other location - About 40 mins to fix
                      divbox.js on lines 209..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 48.

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

                                  if (index * 1 > 0) {
                                    $(_cfg.btn_prev).removeClass('prevDisabled').bind('click', function() {
                                      fn.prevItem(index);
                                    });
                                  } else {
                      Severity: Minor
                      Found in divbox.js and 1 other location - About 40 mins to fix
                      divbox.js on lines 221..227

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

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

                                left: _cfg.left ? sizesystem[2] + _cfg.left : Math.round((sizesystem[4] - w) / 2)
                      Severity: Minor
                      Found in divbox.js and 1 other location - About 35 mins to fix
                      divbox.js on lines 134..134

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

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

                                left: _cfg.left ? sizesystem[2] + _cfg.left : Math.round((sizesystem[4] - w) / 2)
                      Severity: Minor
                      Found in divbox.js and 1 other location - About 35 mins to fix
                      divbox.js on lines 124..124

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

                      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