ivmartel/dwv

View on GitHub
decoders/rii-mango/lossless.js

Summary

Maintainability
F
2 wks
Test Coverage

Function 3 has 572 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],3:[function(require,module,exports){
/*
 * Copyright (C) 2015 Michael Martinez
 * Changes: Added support for selection values 2-7, fixed minor bugs &
 * warnings, split into multiple class files, and general clean up.
Severity: Major
Found in decoders/rii-mango/lossless.js - About 2 days to fix

    File lossless.js has 977 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jpeg = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    /*
     * Copyright (C) 2015 Michael Martinez
     * Changes: Added support for selection values 2-7, fixed minor bugs &
     * warnings, split into multiple class files, and general clean up.
    Severity: Major
    Found in decoders/rii-mango/lossless.js - About 2 days to fix

      Function decode has 213 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      jpeg.lossless.Decoder.prototype.decode = function (buffer, offset, length, numBytes) {
          /*jslint bitwise: true */
      
          var current, scanNum = 0, pred = [], i, compN, temp = [], index = [], mcuNum;
      
      
      Severity: Major
      Found in decoders/rii-mango/lossless.js - About 1 day to fix

        Function 5 has 103 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{"./component-spec.js":1,"./data-stream.js":2}],5:[function(require,module,exports){
        /*
         * Copyright (C) 2015 Michael Martinez
         * Changes: Added support for selection values 2-7, fixed minor bugs &
         * warnings, split into multiple class files, and general clean up.
        Severity: Major
        Found in decoders/rii-mango/lossless.js - About 4 hrs to fix

          Function 7 has 88 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"./component-spec.js":1,"./data-stream.js":2,"./decoder.js":3,"./frame-header.js":4,"./huffman-table.js":5,"./quantization-table.js":7,"./scan-component.js":8,"./scan-header.js":9,"./utils.js":10}],7:[function(require,module,exports){
          /*
           * Copyright (C) 2015 Michael Martinez
           * Changes: Added support for selection values 2-7, fixed minor bugs &
           * warnings, split into multiple class files, and general clean up.
          Severity: Major
          Found in decoders/rii-mango/lossless.js - About 3 hrs to fix

            Function getn has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            jpeg.lossless.Decoder.prototype.getn = function (PRED, n, temp, index) {
                /*jslint bitwise: true */
            
                var result, one, n_one, mask, input;
                one = 1;
            Severity: Major
            Found in decoders/rii-mango/lossless.js - About 2 hrs to fix

              Function 4 has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              },{"./data-stream.js":2,"./frame-header.js":4,"./huffman-table.js":5,"./quantization-table.js":7,"./scan-header.js":9,"./utils.js":10}],4:[function(require,module,exports){
              /*
               * Copyright (C) 2015 Michael Martinez
               * Changes: Added support for selection values 2-7, fixed minor bugs &
               * warnings, split into multiple class files, and general clean up.
              Severity: Major
              Found in decoders/rii-mango/lossless.js - About 2 hrs to fix

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

                },{}],9:[function(require,module,exports){
                /*
                 * Copyright (C) 2015 Michael Martinez
                 * Changes: Added support for selection values 2-7, fixed minor bugs &
                 * warnings, split into multiple class files, and general clean up.
                Severity: Minor
                Found in decoders/rii-mango/lossless.js - About 1 hr to fix

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

                  jpeg.lossless.Decoder.prototype.getHuffmanValue = function (table, temp, index) {
                      /*jslint bitwise: true */
                  
                      var code, input, mask;
                      mask = 0xFFFF;
                  Severity: Minor
                  Found in decoders/rii-mango/lossless.js - About 1 hr to fix

                    Function read has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    jpeg.lossless.QuantizationTable.prototype.read = function (data, table) {
                        /*jslint bitwise: true */
                    
                        var count = 0, length, temp, t, i;
                    
                    
                    Severity: Minor
                    Found in decoders/rii-mango/lossless.js - About 1 hr to fix

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

                      jpeg.lossless.HuffmanTable.prototype.read = function(data, HuffTab) {
                          /*jslint bitwise: true */
                      
                          var count = 0, length, temp, t, c, i, j;
                      
                      
                      Severity: Minor
                      Found in decoders/rii-mango/lossless.js - About 1 hr to fix

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

                        },{"./data-stream.js":2,"./scan-component.js":8}],10:[function(require,module,exports){
                        /*
                         * Copyright (C) 2015 Michael Martinez
                         * Changes: Added support for selection values 2-7, fixed minor bugs &
                         * warnings, split into multiple class files, and general clean up.
                        Severity: Minor
                        Found in decoders/rii-mango/lossless.js - About 1 hr to fix

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

                          jpeg.lossless.Decoder.prototype.decodeRGB = function (prev, temp, index) {
                              /*jslint bitwise: true */
                          
                              var value, actab, dctab, qtab, ctrC, i, k, j;
                          
                          
                          Severity: Minor
                          Found in decoders/rii-mango/lossless.js - About 1 hr to fix

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

                            jpeg.lossless.FrameHeader.prototype.read = function (data) {
                                /*jslint bitwise: true */
                            
                                var count = 0, length, i, c, temp;
                            
                            
                            Severity: Minor
                            Found in decoders/rii-mango/lossless.js - About 1 hr to fix

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

                              jpeg.lossless.HuffmanTable.prototype.buildHuffTable = function(tab, L, V) {
                                  /*jslint bitwise: true */
                              
                                  var currentTable, temp, k, i, j, n;
                                  temp = 256;
                              Severity: Minor
                              Found in decoders/rii-mango/lossless.js - About 1 hr to fix

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

                                jpeg.lossless.ScanHeader.prototype.read = function(data) {
                                    /*jslint bitwise: true */
                                
                                    var count = 0, length, i, temp;
                                
                                
                                Severity: Minor
                                Found in decoders/rii-mango/lossless.js - About 1 hr to fix

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

                                  jpeg.lossless.Decoder = jpeg.lossless.Decoder || function (buffer, numBytes) {
                                      this.buffer = buffer;
                                      this.frame = new jpeg.lossless.FrameHeader();
                                      this.huffTable = new jpeg.lossless.HuffmanTable();
                                      this.quantTable = new jpeg.lossless.QuantizationTable();
                                  Severity: Minor
                                  Found in decoders/rii-mango/lossless.js - About 1 hr to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if ((value >> 4) === 0) {
                                                            break;
                                                        }
                                    Severity: Major
                                    Found in decoders/rii-mango/lossless.js - About 45 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                      return (0xFF00 | this.marker) << 8;
                                      Severity: Major
                                      Found in decoders/rii-mango/lossless.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                            return result;
                                        Severity: Major
                                        Found in decoders/rii-mango/lossless.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                      return (0xFF00 | this.marker) << 8;
                                          Severity: Major
                                          Found in decoders/rii-mango/lossless.js - About 30 mins to fix

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

                                                while ((((current >> 4) !== 0x0FFC) || (current === 0xFFC4))) { // SOF 0~15
                                                    switch (current) {
                                                        case 0xFFC4: // DHT
                                                            this.huffTable.read(this.stream, this.HuffTab);
                                                            break;
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 1 day to fix
                                            decoders/rii-mango/lossless.js on lines 325..366

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

                                            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 (current !== 0x0FFDA) { // SOS
                                                        switch (current) {
                                                            case 0xFFC4: // DHT
                                                                this.huffTable.read(this.stream, this.HuffTab);
                                                                break;
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 1 day to fix
                                            decoders/rii-mango/lossless.js on lines 274..315

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

                                            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

                                            },{"./data-stream.js":2,"./utils.js":10}],8:[function(require,module,exports){
                                            /*
                                             * Copyright (C) 2015 Michael Martinez
                                             * Changes: Added support for selection values 2-7, fixed minor bugs &
                                             * warnings, split into multiple class files, and general clean up.
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 7 hrs to fix
                                            decoders/rii-mango/lossless.js on lines 1..57

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

                                            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

                                            (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jpeg = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
                                            /*
                                             * Copyright (C) 2015 Michael Martinez
                                             * Changes: Added support for selection values 2-7, fixed minor bugs &
                                             * warnings, split into multiple class files, and general clean up.
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 7 hrs to fix
                                            decoders/rii-mango/lossless.js on lines 1492..1549

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

                                            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

                                                    } else {
                                                        for (i = 0; i < 64; i+=1) {
                                                            if (count > length) {
                                                                throw new Error("ERROR: Quantization table format error");
                                                            }
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 3 hrs to fix
                                            decoders/rii-mango/lossless.js on lines 1451..1462

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 105.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                    if (this.precision[t] === 8) {
                                                        for (i = 0; i < 64; i+=1) {
                                                            if (count > length) {
                                                                throw new Error("ERROR: Quantization table format error");
                                                            }
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 3 hrs to fix
                                            decoders/rii-mango/lossless.js on lines 1462..1473

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 105.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                            jpeg.lossless.Decoder.IDCT_P = [0, 5, 40, 16, 45, 2, 7, 42, 21, 56, 8, 61, 18, 47, 1, 4, 41, 23, 58, 13, 32, 24, 37, 10, 63, 17, 44, 3, 6, 43, 20,
                                                57, 15, 34, 29, 48, 53, 26, 39, 9, 60, 19, 46, 22, 59, 12, 33, 31, 50, 55, 25, 36, 11, 62, 14, 35, 28, 49, 52, 27, 38, 30, 51, 54];
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 2 hrs to fix
                                            decoders/rii-mango/lossless.js on lines 226..227

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 83.

                                            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

                                            jpeg.lossless.Decoder.TABLE = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53,
                                                10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63];
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 2 hrs to fix
                                            decoders/rii-mango/lossless.js on lines 224..225

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

                                            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

                                            jpeg.lossless.Decoder.prototype.select6 = function (compOffset) {
                                                return this.getPreviousY(compOffset) + ((this.getPreviousX(compOffset) - this.getPreviousXY(compOffset)) >> 1);
                                            };
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 1 hr to fix
                                            decoders/rii-mango/lossless.js on lines 537..539

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

                                            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

                                            jpeg.lossless.Decoder.prototype.select5 = function (compOffset) {
                                                return this.getPreviousX(compOffset) + ((this.getPreviousY(compOffset) - this.getPreviousXY(compOffset)) >> 1);
                                            };
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 1 hr to fix
                                            decoders/rii-mango/lossless.js on lines 543..545

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

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

                                            Identical blocks of code found in 4 locations. Consider refactoring.
                                            Open

                                                    if (input === 0xFF) {
                                                        this.marker = this.stream.get8();
                                                        if (this.marker !== 0) {
                                                            this.markerIndex = 9;
                                                        }
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 3 other locations - About 1 hr to fix
                                            decoders/rii-mango/lossless.js on lines 680..685
                                            decoders/rii-mango/lossless.js on lines 766..771
                                            decoders/rii-mango/lossless.js on lines 785..790

                                            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

                                            Identical blocks of code found in 4 locations. Consider refactoring.
                                            Open

                                                        if (input === 0xFF) {
                                                            this.marker = this.stream.get8();
                                                            if (this.marker !== 0) {
                                                                this.markerIndex = 9;
                                                            }
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 3 other locations - About 1 hr to fix
                                            decoders/rii-mango/lossless.js on lines 680..685
                                            decoders/rii-mango/lossless.js on lines 703..708
                                            decoders/rii-mango/lossless.js on lines 766..771

                                            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

                                            Identical blocks of code found in 4 locations. Consider refactoring.
                                            Open

                                                    if (input === 0xFF) {
                                                        this.marker = this.stream.get8();
                                                        if (this.marker !== 0) {
                                                            this.markerIndex = 9;
                                                        }
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 3 other locations - About 1 hr to fix
                                            decoders/rii-mango/lossless.js on lines 703..708
                                            decoders/rii-mango/lossless.js on lines 766..771
                                            decoders/rii-mango/lossless.js on lines 785..790

                                            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

                                            Identical blocks of code found in 4 locations. Consider refactoring.
                                            Open

                                                    if (input === 0xFF) {
                                                        this.marker = this.stream.get8();
                                                        if (this.marker !== 0) {
                                                            this.markerIndex = 9;
                                                        }
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 3 other locations - About 1 hr to fix
                                            decoders/rii-mango/lossless.js on lines 680..685
                                            decoders/rii-mango/lossless.js on lines 703..708
                                            decoders/rii-mango/lossless.js on lines 785..790

                                            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

                                                    } else {
                                                        this.outputData = new Uint16Array(new ArrayBuffer(this.xDim * this.yDim * this.numBytes * this.numComp));
                                                    }
                                            Severity: Minor
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 45 mins to fix
                                            decoders/rii-mango/lossless.js on lines 438..440

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

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                    if (this.numBytes == 1) {
                                                        this.outputData = new Uint8Array(new ArrayBuffer(this.xDim * this.yDim * this.numBytes * this.numComp));
                                                    } else {
                                            Severity: Minor
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 45 mins to fix
                                            decoders/rii-mango/lossless.js on lines 440..442

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

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                    if (this.numBytes === 1) {
                                                        if (this.numComp === 3) {
                                                            this.getter = this.getValueRGB;
                                                            this.setter = this.setValueRGB;
                                                            this.output = this.outputRGB;
                                            Severity: Minor
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 40 mins to fix
                                            decoders/rii-mango/lossless.js on lines 386..394

                                            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

                                                        if (this.numComp === 3) {
                                                            this.getter = this.getValueRGB;
                                                            this.setter = this.setValueRGB;
                                                            this.output = this.outputRGB;
                                                        } else {
                                            Severity: Minor
                                            Found in decoders/rii-mango/lossless.js and 1 other location - About 40 mins to fix
                                            decoders/rii-mango/lossless.js on lines 385..399

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

                                            jpeg.lossless.DataStream = jpeg.lossless.DataStream || ((typeof require !== 'undefined') ? require('./data-stream.js') : null);
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 4 other locations - About 30 mins to fix
                                            decoders/rii-mango/lossless.js on lines 1142..1142
                                            decoders/rii-mango/lossless.js on lines 1319..1319
                                            decoders/rii-mango/lossless.js on lines 1368..1368
                                            decoders/rii-mango/lossless.js on lines 1589..1589

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

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

                                            jpeg.lossless.Utils = jpeg.lossless.Utils || ((typeof require !== 'undefined') ? require('./utils.js') : null);
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 4 other locations - About 30 mins to fix
                                            decoders/rii-mango/lossless.js on lines 1027..1027
                                            decoders/rii-mango/lossless.js on lines 1319..1319
                                            decoders/rii-mango/lossless.js on lines 1368..1368
                                            decoders/rii-mango/lossless.js on lines 1589..1589

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

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

                                            jpeg.lossless.Utils = jpeg.lossless.Utils || ((typeof require !== 'undefined') ? require('./utils.js') : null);
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 4 other locations - About 30 mins to fix
                                            decoders/rii-mango/lossless.js on lines 1027..1027
                                            decoders/rii-mango/lossless.js on lines 1142..1142
                                            decoders/rii-mango/lossless.js on lines 1368..1368
                                            decoders/rii-mango/lossless.js on lines 1589..1589

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

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

                                            jpeg.lossless.Utils = jpeg.lossless.Utils || ((typeof require !== 'undefined') ? require('./utils.js') : null);
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 4 other locations - About 30 mins to fix
                                            decoders/rii-mango/lossless.js on lines 1027..1027
                                            decoders/rii-mango/lossless.js on lines 1142..1142
                                            decoders/rii-mango/lossless.js on lines 1319..1319
                                            decoders/rii-mango/lossless.js on lines 1589..1589

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

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

                                            jpeg.lossless.ScanComponent = jpeg.lossless.ScanComponent || ((typeof require !== 'undefined') ? require('./scan-component.js') : null);
                                            Severity: Major
                                            Found in decoders/rii-mango/lossless.js and 4 other locations - About 30 mins to fix
                                            decoders/rii-mango/lossless.js on lines 1027..1027
                                            decoders/rii-mango/lossless.js on lines 1142..1142
                                            decoders/rii-mango/lossless.js on lines 1319..1319
                                            decoders/rii-mango/lossless.js on lines 1368..1368

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

                                            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