myems-admin/js/angular/qrcode.js

Summary

Maintainability
F
1 mo
Test Coverage

Function qrcode has a Cognitive Complexity of 795 (exceeds 5 allowed). Consider refactoring.
Open

var qrcode = function() {

  //---------------------------------------------------------------------
  // qrcode
  //---------------------------------------------------------------------
Severity: Minor
Found in myems-admin/js/angular/qrcode.js - About 2 wks 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 1570 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var qrcode = function() {

  //---------------------------------------------------------------------
  // qrcode
  //---------------------------------------------------------------------
Severity: Major
Found in myems-admin/js/angular/qrcode.js - About 1 wk to fix

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

    //---------------------------------------------------------------------
    //
    // QR Code Generator for JavaScript
    //
    // Copyright (c) 2009 Kazuhiko Arase
    Severity: Major
    Found in myems-admin/js/angular/qrcode.js - About 4 days to fix

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

        var qrcode = function(typeNumber, errorCorrectionLevel) {
      
          var PAD0 = 0xEC;
          var PAD1 = 0x11;
      
      
      Severity: Major
      Found in myems-admin/js/angular/qrcode.js - About 2 days to fix

        Function QRUtil has 211 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var QRUtil = function() {
        
            var PATTERN_POSITION_TABLE = [
              [],
              [6, 18],
        Severity: Major
        Found in myems-admin/js/angular/qrcode.js - About 1 day to fix

          Function QRRSBlock has 202 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var QRRSBlock = function() {
          
              var RS_BLOCK_TABLE = [
          
                // L
          Severity: Major
          Found in myems-admin/js/angular/qrcode.js - About 1 day to fix

            Function gifImage has 126 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var gifImage = function(width, height) {
            
                var _width = width;
                var _height = height;
                var _data = new Array(width * height);
            Severity: Major
            Found in myems-admin/js/angular/qrcode.js - About 5 hrs to fix

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

                  _this.getLostPoint = function(qrcode) {
              
                    var moduleCount = qrcode.getModuleCount();
              
                    var lostPoint = 0;
              Severity: Major
              Found in myems-admin/js/angular/qrcode.js - About 3 hrs to fix

                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) ) {
                            _modules[row + r][col + c] = true;
                          } else {
                Severity: Critical
                Found in myems-admin/js/angular/qrcode.js - About 2 hrs to fix

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

                    var base64EncodeOutputStream = function() {
                  
                      var _buffer = 0;
                      var _buflen = 0;
                      var _length = 0;
                  Severity: Minor
                  Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                    Function createStringToBytes has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      qrcode.createStringToBytes = function(unicodeData, numChars) {
                    
                        // create conversion map.
                    
                        var unicodeMap = function() {
                    Severity: Minor
                    Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

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

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

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

                          function qrPolynomial(num, shift) {
                        
                            if (typeof num.length == 'undefined') {
                              throw num.length + '/' + shift;
                            }
                        Severity: Minor
                        Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

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

                              _this.createSvgTag = function(cellSize, margin, alt, title) {
                          
                                var opts = {};
                                if (typeof arguments[0] == 'object') {
                                  // Called by options.
                          Severity: Minor
                          Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                            Function base64DecodeInputStream has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              var base64DecodeInputStream = function(str) {
                            
                                var _str = str;
                                var _pos = 0;
                                var _buffer = 0;
                            Severity: Minor
                            Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                              Function qrAlphaNum has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                var qrAlphaNum = function(data) {
                              
                                  var _mode = QRMode.MODE_ALPHA_NUM;
                                  var _data = data;
                              
                              
                              Severity: Minor
                              Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

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

                                    var _createHalfASCII = function(margin) {
                                      var cellSize = 1;
                                      margin = (typeof margin == 'undefined')? cellSize * 2 : margin;
                                
                                      var size = _this.getModuleCount() * cellSize + margin * 2;
                                Severity: Minor
                                Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

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

                                    var qrKanji = function(data) {
                                  
                                      var _mode = QRMode.MODE_KANJI;
                                      var _data = data;
                                  
                                  
                                  Severity: Minor
                                  Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                    Function qrNumber has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      var qrNumber = function(data) {
                                    
                                        var _mode = QRMode.MODE_NUMBER;
                                        var _data = data;
                                    
                                    
                                    Severity: Minor
                                    Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                      Function byteArrayOutputStream has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        var byteArrayOutputStream = function() {
                                      
                                          var _bytes = [];
                                      
                                          var _this = {};
                                      Severity: Minor
                                      Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

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

                                            var createData = function(typeNumber, errorCorrectionLevel, dataList) {
                                        
                                              var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectionLevel);
                                        
                                              var buffer = qrBitBuffer();
                                        Severity: Minor
                                        Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                          Function getLZWRaster has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              var getLZWRaster = function(lzwMinCodeSize) {
                                          
                                                var clearCode = 1 << lzwMinCodeSize;
                                                var endCode = (1 << lzwMinCodeSize) + 1;
                                                var bitLength = lzwMinCodeSize + 1;
                                          Severity: Minor
                                          Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

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

                                                var mapData = function(data, maskPattern) {
                                            
                                                  var inc = -1;
                                                  var row = _moduleCount - 1;
                                                  var bitIndex = 7;
                                            Severity: Minor
                                            Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                              Function write has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  _this.write = function(out) {
                                              
                                                    //---------------------------------
                                                    // GIF Signature
                                              
                                              
                                              Severity: Minor
                                              Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                                Function QRMath has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                  var QRMath = function() {
                                                
                                                    var EXP_TABLE = new Array(256);
                                                    var LOG_TABLE = new Array(256);
                                                
                                                
                                                Severity: Minor
                                                Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

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

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

                                                    Function createASCII has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        _this.createASCII = function(cellSize, margin) {
                                                          cellSize = cellSize || 1;
                                                    
                                                          if (cellSize < 2) {
                                                            return _createHalfASCII(margin);
                                                    Severity: Minor
                                                    Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                                      Function qrBitBuffer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                        var qrBitBuffer = function() {
                                                      
                                                          var _buffer = [];
                                                          var _length = 0;
                                                      
                                                      
                                                      Severity: Minor
                                                      Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                                        Function createTableTag has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                            _this.createTableTag = function(cellSize, margin) {
                                                        
                                                              cellSize = cellSize || 2;
                                                              margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
                                                        
                                                        
                                                        Severity: Minor
                                                        Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                                          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 myems-admin/js/angular/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 myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

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

                                                                Avoid deeply nested control flow statements.
                                                                Open

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

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                if (bitIndex == -1) {
                                                                                  byteIndex += 1;
                                                                                  bitIndex = 7;
                                                                                }
                                                                  Severity: Major
                                                                  Found in myems-admin/js/angular/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 myems-admin/js/angular/qrcode.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                    if (mask) {
                                                                                      dark = !dark;
                                                                                    }
                                                                      Severity: Major
                                                                      Found in myems-admin/js/angular/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 myems-admin/js/angular/qrcode.js - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                        if (r == -2 || r == 2 || c == -2 || c == 2
                                                                                            || (r == 0 && c == 0) ) {
                                                                                          _modules[row + r][col + c] = true;
                                                                                        } else {
                                                                                          _modules[row + r][col + c] = false;
                                                                          Severity: Major
                                                                          Found in myems-admin/js/angular/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) ) {
                                                                                            _modules[row + r][col + c] = true;
                                                                                          } else {
                                                                                            _modules[row + r][col + c] = false;
                                                                            Severity: Major
                                                                            Found in myems-admin/js/angular/qrcode.js - About 40 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                      return 63;
                                                                              Severity: Major
                                                                              Found in myems-admin/js/angular/qrcode.js - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                        return 0x2f;
                                                                                Severity: Major
                                                                                Found in myems-admin/js/angular/qrcode.js - About 30 mins to fix

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

                                                                                        for (var i = 0; i < maxEcCount; i += 1) {
                                                                                          for (var r = 0; r < rsBlocks.length; r += 1) {
                                                                                            if (i < ecdata[r].length) {
                                                                                              data[index] = ecdata[r][i];
                                                                                              index += 1;
                                                                                  Severity: Major
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 3 hrs to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 311..318

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

                                                                                  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 += 1) {
                                                                                          for (var r = 0; r < rsBlocks.length; r += 1) {
                                                                                            if (i < dcdata[r].length) {
                                                                                              data[index] = dcdata[r][i];
                                                                                              index += 1;
                                                                                  Severity: Major
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 3 hrs to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 320..327

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

                                                                                  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 < _dataList.length; i++) {
                                                                                              var data = _dataList[i];
                                                                                              buffer.put(data.getMode(), 4);
                                                                                              buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) );
                                                                                              data.write(buffer);
                                                                                  Severity: Major
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 2 hrs to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 338..343

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

                                                                                  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 < dataList.length; i += 1) {
                                                                                          var data = dataList[i];
                                                                                          buffer.put(data.getMode(), 4);
                                                                                          buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) );
                                                                                          data.write(buffer);
                                                                                  Severity: Major
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 2 hrs to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 432..437

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

                                                                                  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 myems-admin/js/angular/qrcode.js and 2 other locations - About 1 hr to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 976..1017
                                                                                  myems-admin/js/angular/qrcode.js on lines 1002..1017

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

                                                                                  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 myems-admin/js/angular/qrcode.js and 2 other locations - About 1 hr to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 976..1017
                                                                                  myems-admin/js/angular/qrcode.js on lines 989..1017

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

                                                                                  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 myems-admin/js/angular/qrcode.js and 2 other locations - About 1 hr to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 989..1017
                                                                                  myems-admin/js/angular/qrcode.js on lines 1002..1017

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

                                                                                  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 (min <= x && x < max && min <= y && y < max && _this.isDark(r, Math.floor((x - min) / cellSize))) {
                                                                                              p = 0;
                                                                                            }
                                                                                  Severity: Major
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 1 hr to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 651..653

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

                                                                                  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 (min <= x && x < max && min <= y && y < max && _this.isDark(r1, Math.floor((x - min) / cellSize))) {
                                                                                              p = ' ';
                                                                                            }
                                                                                  Severity: Major
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 1 hr to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 703..705

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

                                                                                  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 G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0);
                                                                                  Severity: Minor
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 55 mins to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 906..906

                                                                                  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

                                                                                      var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0);
                                                                                  Severity: Minor
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 55 mins to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 905..905

                                                                                  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

                                                                                        case QRMaskPattern.PATTERN110 :
                                                                                          return function(i, j) { return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; };
                                                                                  Severity: Minor
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 40 mins to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 958..959

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

                                                                                  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

                                                                                        case QRMaskPattern.PATTERN111 :
                                                                                          return function(i, j) { return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; };
                                                                                  Severity: Minor
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 40 mins to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 956..957

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

                                                                                  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

                                                                                        qrSvg += (title.text) ? '<title id="' + escapeXml(title.id) + '">' +
                                                                                            escapeXml(title.text) + '</title>' : '';
                                                                                  Severity: Minor
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 40 mins to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 536..537

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

                                                                                  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

                                                                                        qrSvg += (alt.text) ? '<description id="' + escapeXml(alt.id) + '">' +
                                                                                            escapeXml(alt.text) + '</description>' : '';
                                                                                  Severity: Minor
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 40 mins to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 534..535

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

                                                                                  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 (getBCHDigit(d) - getBCHDigit(G18) >= 0) {
                                                                                          d ^= (G18 << (getBCHDigit(d) - getBCHDigit(G18) ) );
                                                                                        }
                                                                                  Severity: Minor
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 35 mins to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 922..924

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

                                                                                  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 (getBCHDigit(d) - getBCHDigit(G15) >= 0) {
                                                                                          d ^= (G15 << (getBCHDigit(d) - getBCHDigit(G15) ) );
                                                                                        }
                                                                                  Severity: Minor
                                                                                  Found in myems-admin/js/angular/qrcode.js and 1 other location - About 35 mins to fix
                                                                                  myems-admin/js/angular/qrcode.js on lines 930..932

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

                                                                                  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