canax/request

View on GitHub

Showing 33 of 33 total issues

File jquery.iviewer.js has 700 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * iviewer Widget for jQuery UI
 * https://github.com/can3p/iviewer
 *
 * Copyright (c) 2009 - 2012 Dmitry Petrov
Severity: Major
Found in doc/api/js/jquery.iviewer.js - About 1 day to fix

    File jquery.dotdotdot-1.5.9.js has 520 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*    
     *    jQuery dotdotdot 1.5.9
     *    
     *    Copyright (c) 2013 Fred Heusschen
     *    www.frebsite.nl
    Severity: Major
    Found in doc/api/js/jquery.dotdotdot-1.5.9.js - About 1 day to fix

      Function dotdotdot has 203 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.fn.dotdotdot = function( o )
          {
              if ( this.length == 0 )
              {
                  if ( !o || o.debug !== false )
      Severity: Major
      Found in doc/api/js/jquery.dotdotdot-1.5.9.js - About 1 day to fix

        Function bind_events has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                $dot.bind_events = function()
                {
                    $dot.bind(
                        'update.dot',
                        function( e, c )
        Severity: Major
        Found in doc/api/js/jquery.dotdotdot-1.5.9.js - About 3 hrs to fix

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

              this.y = setter(function(val, skipCss) {
                      this._y = val;
                      if (!skipCss) {
                          this._finishAnimation();
                          this._img.css("top",this._y - (this._swapDimensions ? this.display_diff() / 2 : 0) + "px");
          Severity: Major
          Found in doc/api/js/jquery.iviewer.js and 1 other location - About 3 hrs to fix
          doc/api/js/jquery.iviewer.js on lines 965..974

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

          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

              this.x = setter(function(val, skipCss) {
                      this._x = val;
                      if (!skipCss) {
                          this._finishAnimation();
                          this._img.css("left",this._x + (this._swapDimensions ? this.display_diff() / 2 : 0) + "px");
          Severity: Major
          Found in doc/api/js/jquery.iviewer.js and 1 other location - About 3 hrs to fix
          doc/api/js/jquery.iviewer.js on lines 983..992

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

          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

          Function _create has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _create: function() {
                  var me = this;
          
                  //drag variables
                  this.dx = 0;
          Severity: Major
          Found in doc/api/js/jquery.iviewer.js - About 2 hrs to fix

            Function ellipsisElement has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function ellipsisElement( $e, $d, $i, o, after )
                {
                    var isTruncated    = false,
                        e = $e[ 0 ];
            
            
            Severity: Major
            Found in doc/api/js/jquery.dotdotdot-1.5.9.js - About 2 hrs to fix

              Function handler has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function handler(event) {
                      var orgEvent   = event || window.event,
                          args       = slice.call(arguments, 1),
                          delta      = 0,
                          deltaX     = 0,
              Severity: Major
              Found in doc/api/js/jquery.mousewheel.js - About 2 hrs to fix

                Request has 22 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Request
                {
                    /**
                     * @var string $requestUri Request URI from $_SERVER.
                     * @var string $scriptName Scriptname from $_SERVER, actual scriptname part.
                Severity: Minor
                Found in src/Request/Request.php - About 2 hrs to fix

                  Function setImageProps has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      this.setImageProps = function(disp_w, disp_h, x, y, skip_animation, complete) {
                          complete = complete || jQuery.noop;
                  
                          this.display_width(disp_w);
                          this.display_height(disp_h);
                  Severity: Minor
                  Found in doc/api/js/jquery.iviewer.js - About 1 hr to fix

                    Function set_zoom has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        set_zoom: function(new_zoom, skip_animation, zoom_center)
                        {
                            if (this._trigger('onZoom', 0, new_zoom) == false) {
                                return;
                            }
                    Severity: Minor
                    Found in doc/api/js/jquery.iviewer.js - About 1 hr to fix

                      Function watch has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              $dot.watch = function()
                              {
                                  $dot.unwatch();
                                  if ( opts.watch == 'window' )
                                  {
                      Severity: Minor
                      Found in doc/api/js/jquery.dotdotdot-1.5.9.js - About 1 hr to fix

                        Function ellipsis has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function ellipsis( $elem, $d, $i, o, after )
                            {
                                var $elements     = $elem.contents(),
                                    isTruncated    = false;
                        
                        
                        Severity: Minor
                        Found in doc/api/js/jquery.dotdotdot-1.5.9.js - About 1 hr to fix

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

                                  if(this.img_object.display_width() <= this.options.width){
                                      x = -(this.img_object.display_width() - this.options.width)/2;
                                  }
                          Severity: Major
                          Found in doc/api/js/jquery.iviewer.js and 1 other location - About 1 hr to fix
                          doc/api/js/jquery.iviewer.js on lines 477..479

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

                                  if(this.img_object.display_height() <= this.options.height){
                                      y = -(this.img_object.display_height() - this.options.height)/2;
                                  }
                          Severity: Major
                          Found in doc/api/js/jquery.iviewer.js and 1 other location - About 1 hr to fix
                          doc/api/js/jquery.iviewer.js on lines 474..476

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

                                  if(x + this.img_object.display_width() < this.options.width){
                                      x = this.options.width - this.img_object.display_width();
                                  }
                          Severity: Major
                          Found in doc/api/js/jquery.iviewer.js and 1 other location - About 1 hr to fix
                          doc/api/js/jquery.iviewer.js on lines 468..470

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

                          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(y + this.img_object.display_height() < this.options.height){
                                      y = this.options.height - this.img_object.display_height();
                                  }
                          Severity: Major
                          Found in doc/api/js/jquery.iviewer.js and 1 other location - About 1 hr to fix
                          doc/api/js/jquery.iviewer.js on lines 471..473

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

                          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

                                  $("<div>", { 'class': "iviewer_rotate_left iviewer_common iviewer_button"})
                                              .bind('mousedown touchstart',function(){me.angle(-90); return false;})
                                              .appendTo(this.container);
                          Severity: Major
                          Found in doc/api/js/jquery.iviewer.js and 1 other location - About 1 hr to fix
                          doc/api/js/jquery.iviewer.js on lines 818..820

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

                          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

                                  $("<div>", { 'class': "iviewer_zoom_out iviewer_common iviewer_button"})
                                              .bind('mousedown touchstart',function(){me.zoom_by(- 1); return false;})
                                              .appendTo(this.container);
                          Severity: Major
                          Found in doc/api/js/jquery.iviewer.js and 1 other location - About 1 hr to fix
                          doc/api/js/jquery.iviewer.js on lines 833..835

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

                          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