woothemes/woocommerce

View on GitHub
assets/js/jquery-qrcode/jquery.qrcode.js

Summary

Maintainability
F
1 wk
Test Coverage

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

//---------------------------------------------------------------------
// QRCode for JavaScript
//
// Copyright (c) 2009 Kazuhiko Arase
//
Severity: Major
Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 2 days to fix

    Function getLostPoint has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
    Open

        getLostPoint : function(qrCode) {
    
            var moduleCount = qrCode.getModuleCount();
    
            var lostPoint = 0;
    Severity: Minor
    Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function mapData has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        mapData : function(data, maskPattern) {
    
            var inc = -1;
            var row = this.moduleCount - 1;
            var bitIndex = 7;
    Severity: Minor
    Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function getLostPoint has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        getLostPoint : function(qrCode) {
    
            var moduleCount = qrCode.getModuleCount();
    
            var lostPoint = 0;
    Severity: Major
    Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 3 hrs to fix

      Function createBytes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      QRCode.createBytes = function(buffer, rsBlocks) {
      
          var offset = 0;
      
          var maxDcCount = 0;
      Severity: Minor
      Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function setupPositionAdjustPattern has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          setupPositionAdjustPattern : function() {
      
              var pos = QRUtil.getPatternPosition(this.typeNumber);
      
              for (var i = 0; i < pos.length; i++) {
      Severity: Minor
      Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Consider simplifying this complex logical expression.
      Open

                      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 {
      Severity: Critical
      Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 2 hrs to fix

        Function setupPositionProbePattern has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            setupPositionProbePattern : function(row, col)  {
        
                for (var r = -1; r <= 7; r++) {
        
                    if (row + r <= -1 || this.moduleCount <= row + r) continue;
        Severity: Minor
        Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function qrcode has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.fn.qrcode = function(options) {
                // if options is string,
                if( typeof options === 'string' ){
                    options    = { text: options };
                }
        Severity: Major
        Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 2 hrs to fix

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

          QRCode.createBytes = function(buffer, rsBlocks) {
          
              var offset = 0;
          
              var maxDcCount = 0;
          Severity: Minor
          Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

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

            QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {
            
                var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
            
                var buffer = new QRBitBuffer();
            Severity: Minor
            Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

              Function make has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  make : function() {
                      // Calculate automatically typeNumber if provided is < 1
                      if (this.typeNumber < 1 ){
                          var typeNumber = 1;
                          for (typeNumber = 1; typeNumber < 40; typeNumber++) {
              Severity: Minor
              Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function mapData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  mapData : function(data, maskPattern) {
              
                      var inc = -1;
                      var row = this.moduleCount - 1;
                      var bitIndex = 7;
              Severity: Minor
              Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

                Function getLengthInBits has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    getLengthInBits : function(mode, type) {
                
                        if (1 <= type && type < 10) {
                
                            // 1 - 9
                Severity: Minor
                Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function getLengthInBits has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    getLengthInBits : function(mode, type) {
                
                        if (1 <= type && type < 10) {
                
                            // 1 - 9
                Severity: Minor
                Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

                  Function createData has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {
                  
                      var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
                  
                      var buffer = new QRBitBuffer();
                  Severity: Minor
                  Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function setupTypeInfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      setupTypeInfo : function(test, maskPattern) {
                  
                          var data = (this.errorCorrectLevel << 3) | maskPattern;
                          var bits = QRUtil.getBCHTypeInfo(data);
                  
                  
                  Severity: Minor
                  Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Consider simplifying this complex logical expression.
                  Open

                                  if (qrCode.isDark(row, col)
                                          && !qrCode.isDark(row, col + 1)
                                          &&  qrCode.isDark(row, col + 2)
                                          &&  qrCode.isDark(row, col + 3)
                                          &&  qrCode.isDark(row, col + 4)
                  Severity: Major
                  Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                                    if (qrCode.isDark(row, col)
                                            && !qrCode.isDark(row + 1, col)
                                            &&  qrCode.isDark(row + 2, col)
                                            &&  qrCode.isDark(row + 3, col)
                                            &&  qrCode.isDark(row + 4, col)
                    Severity: Major
                    Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 1 hr to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (r == -2 || r == 2 || c == -2 || c == 2
                                                      || (r == 0 && c == 0) ) {
                                                  this.modules[row + r][col + c] = true;
                                              } else {
                                                  this.modules[row + r][col + c] = false;
                      Severity: Major
                      Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if (dark == qrCode.isDark(row + r, col + c) ) {
                                                    sameCount++;
                                                }
                        Severity: Major
                        Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if (bitIndex == -1) {
                                                      byteIndex++;
                                                      bitIndex = 7;
                                                  }
                          Severity: Major
                          Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if (r == 0 && c == 0) {
                                                        continue;
                                                    }
                            Severity: Major
                            Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if (mask) {
                                                          dark = !dark;
                                                      }
                              Severity: Major
                              Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if (byteIndex < data.length) {
                                                            dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1);
                                                        }
                                Severity: Major
                                Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (col + c < 0 || moduleCount <= col + c) {
                                                              continue;
                                                          }
                                  Severity: Major
                                  Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 45 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                            if (r == -2 || r == 2 || c == -2 || c == 2
                                                                    || (r == 0 && c == 0) ) {
                                                                this.modules[row + r][col + c] = true;
                                                            } else {
                                                                this.modules[row + r][col + c] = false;
                                    Severity: Major
                                    Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 40 mins to fix

                                      Function createMovieClip has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          createMovieClip : function(target_mc, instance_name, depth) {
                                      
                                              var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
                                              var cs = 1;
                                      
                                      
                                      Severity: Minor
                                      Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 25 mins to fix

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

                                      Function setupTimingPattern has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          setupTimingPattern : function() {
                                      
                                              for (var r = 8; r < this.moduleCount - 8; r++) {
                                                  if (this.modules[r][6] != null) {
                                                      continue;
                                      Severity: Minor
                                      Found in assets/js/jquery-qrcode/jquery.qrcode.js - About 25 mins to fix

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

                                      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 assets/js/jquery-qrcode/jquery.qrcode.js and 1 other location - About 2 hrs to fix
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 458..464

                                      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

                                          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 assets/js/jquery-qrcode/jquery.qrcode.js and 1 other location - About 2 hrs to fix
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 466..472

                                      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

                                              while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
                                                  d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) ) );
                                              }
                                      Severity: Major
                                      Found in assets/js/jquery-qrcode/jquery.qrcode.js and 1 other location - About 1 hr to fix
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 578..580

                                      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

                                              while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
                                                  d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) ) );
                                              }
                                      Severity: Major
                                      Found in assets/js/jquery-qrcode/jquery.qrcode.js and 1 other location - About 1 hr to fix
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 570..572

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

                                              } else if (type < 41) {
                                      
                                                  // 27 - 40
                                      
                                                  switch(mode) {
                                      Severity: Major
                                      Found in assets/js/jquery-qrcode/jquery.qrcode.js and 2 other locations - About 1 hr to fix
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 631..672
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 644..672

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

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

                                              if (1 <= type && type < 10) {
                                      
                                                  // 1 - 9
                                      
                                                  switch(mode) {
                                      Severity: Major
                                      Found in assets/js/jquery-qrcode/jquery.qrcode.js and 2 other locations - About 1 hr to fix
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 644..672
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 657..672

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

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

                                              } else if (type < 27) {
                                      
                                                  // 10 - 26
                                      
                                                  switch(mode) {
                                      Severity: Major
                                      Found in assets/js/jquery-qrcode/jquery.qrcode.js and 2 other locations - About 1 hr to fix
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 631..672
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 657..672

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

                                      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

                                          G18 : (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),
                                      Severity: Minor
                                      Found in assets/js/jquery-qrcode/jquery.qrcode.js and 1 other location - About 55 mins to fix
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 564..564

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

                                      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

                                          G15 : (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),
                                      Severity: Minor
                                      Found in assets/js/jquery-qrcode/jquery.qrcode.js and 1 other location - About 55 mins to fix
                                      assets/js/jquery-qrcode/jquery.qrcode.js on lines 565..565

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

                                      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