Showing 55 of 55 total issues

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

//
/*
  Implement Github like autocomplete mentions
  http://ichord.github.com/At.js

Severity: Major
Found in app/javascript/js/libs/jquery.atwho.js - About 1 day to fix

    File qrcode.js has 415 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * @fileoverview
     * - Using the 'QRCode for Javascript library'
     * - Fixed dataset of 'QRCode for Javascript library' for support full-spec.
     * - this library has no dependencies.
    Severity: Minor
    Found in app/javascript/js/libs/qrcode.js - About 5 hrs to fix

      Function ddscrollSpy has 149 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.fn.ddscrollSpy = function(options){
              var $window = $(window)
              var $body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
      
      
      
      Severity: Major
      Found in app/javascript/js/libs/ddscrollspy.js - About 5 hrs to fix

        File jquery.html5-fileupload.js has 382 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         *  jQuery HTML5 File Upload
         *
         *  Author: timdream at gmail.com
         *  Web: http://timc.idv.tw/html5-file-upload/
        Severity: Minor
        Found in app/javascript/js/libs/jquery.html5-fileupload.js - About 5 hrs to fix

          Function handleFile has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var handleFile = function (settings, file) {
                  var info = {
                      // properties of standard File object || Gecko 1.9 properties
                      type: file.type || '', // MIME type
                      size: file.size || file.fileSize,
          Severity: Major
          Found in app/javascript/js/libs/jquery.html5-fileupload.js - About 4 hrs to fix

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

                var handleImage = function (settings, dataurl, info) {
                    var img = new Image();
                    img.onerror = function () {
                        log('ERROR: <img> failed to load, file is not a supported image format.');
                        settings.fileError.call(this, info, 'FILE_NOT_IMAGE', 'File is not a supported image format.');
            Severity: Major
            Found in app/javascript/js/libs/jquery.html5-fileupload.js - About 3 hrs to fix

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

                    View.prototype.next = function() {
                      var cur, next;
                      cur = this.$el.find('.cur').removeClass('cur');
                      next = cur.next();
                      if (!next.length) {
              Severity: Major
              Found in app/javascript/js/libs/jquery.atwho.js and 1 other location - About 3 hrs to fix
              app/javascript/js/libs/jquery.atwho.js on lines 659..667

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

              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

                    View.prototype.prev = function() {
                      var cur, prev;
                      cur = this.$el.find('.cur').removeClass('cur');
                      prev = cur.prev();
                      if (!prev.length) {
              Severity: Major
              Found in app/javascript/js/libs/jquery.atwho.js and 1 other location - About 3 hrs to fix
              app/javascript/js/libs/jquery.atwho.js on lines 649..657

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

              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 onload has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      img.onload = function () {
                          var ratio = Math.max(
                              img.width/settings.imageMaxWidth,
                              img.height/settings.imageMaxHeight,
                              1
              Severity: Major
              Found in app/javascript/js/libs/jquery.html5-fileupload.js - About 3 hrs to fix

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

                    for(var i=0;i<maxEcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<ecdata[r].length){data[index++]=ecdata[r][i];}}}
                Severity: Major
                Found in app/javascript/js/libs/qrcode.js and 1 other location - About 2 hrs to fix
                app/javascript/js/libs/qrcode.js on lines 118..118

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

                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

                    var data=new Array(totalCodeCount);var index=0;for(var i=0;i<maxDcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<dcdata[r].length){data[index++]=dcdata[r][i];}}}
                Severity: Major
                Found in app/javascript/js/libs/qrcode.js and 1 other location - About 2 hrs to fix
                app/javascript/js/libs/qrcode.js on lines 119..119

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

                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 handleForm has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var handleForm = function (settings, type, data, info) {
                        if (canSendFormData && type === 'file') {
                            // FormData API saves the day
                            log('INFO: Using FormData to construct form.');
                            var formdata = new FormData();
                Severity: Major
                Found in app/javascript/js/libs/jquery.html5-fileupload.js - About 2 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                      this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}}
                  Severity: Critical
                  Found in app/javascript/js/libs/qrcode.js - About 2 hrs to fix

                    Function exports has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function(api) {
                      var validEnv = ['development', 'test', 'production']
                      var currentEnv = api.env()
                      var isDevelopmentEnv = api.env('development')
                      var isProductionEnv = api.env('production')
                    Severity: Major
                    Found in babel.config.js - About 2 hrs to fix

                      Function fileUpload has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.fn.fileUpload = function(settings) {
                              this.each(function(i, el) {
                                  if ($(el).is('input[type=file]')) {
                                      log('INFO: binding onchange event to a input[type=file].');
                                      $(el).bind(
                      Severity: Major
                      Found in app/javascript/js/libs/jquery.html5-fileupload.js - About 2 hrs to fix

                        Function spyonmenuitems has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    function spyonmenuitems($menu){
                                        var $menuitems = $menu.find('a[href^="#"]')
                                        targets = []
                                        curtarget = ''
                                        totaltargetsheight = 0
                        Severity: Minor
                        Found in app/javascript/js/libs/ddscrollspy.js - About 1 hr to fix

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

                              return data;};var QRMode={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3};var QRErrorCorrectLevel={L:1,M:0,Q:3,H:2};var QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:(1<<10)|(1<<8)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0),G18:(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)|(1<<5)|(1<<2)|(1<<0),G15_MASK:(1<<14)|(1<<12)|(1<<10)|(1<<4)|(1<<1),getBCHTypeInfo:function(data){var d=data<<10;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)>=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));}
                          Severity: Major
                          Found in app/javascript/js/libs/qrcode.js and 1 other location - About 1 hr to fix
                          app/javascript/js/libs/qrcode.js on lines 121..121

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

                          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

                              return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));}
                          Severity: Major
                          Found in app/javascript/js/libs/qrcode.js and 1 other location - About 1 hr to fix
                          app/javascript/js/libs/qrcode.js on lines 120..120

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

                          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 highlightitem has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      function highlightitem(){
                                          if (targets.length == 0)
                                              return
                                          var prevtarget = curtarget
                                          var scrolltop = $spytarget.scrollTop()
                          Severity: Minor
                          Found in app/javascript/js/libs/ddscrollspy.js - About 1 hr to fix

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

                                                var targetoffset = (o.spytarget == window)? $target.offset().top : (target.offsetParent == o.spytarget)? target.offsetTop : target.offsetTop - o.spytarget.offsetTop
                            Severity: Major
                            Found in app/javascript/js/libs/ddscrollspy.js and 1 other location - About 1 hr to fix
                            app/javascript/js/libs/ddscrollspy.js on lines 117..117

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

                            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